azure_mgmt_automation 0.15.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2015-10-31/generated/azure_mgmt_automation.rb +111 -97
  3. data/lib/2015-10-31/generated/azure_mgmt_automation/activity_operations.rb +39 -32
  4. data/lib/2015-10-31/generated/azure_mgmt_automation/agent_registration_information.rb +28 -24
  5. data/lib/2015-10-31/generated/azure_mgmt_automation/automation_account_operations.rb +92 -81
  6. data/lib/2015-10-31/generated/azure_mgmt_automation/automation_client.rb +25 -9
  7. data/lib/2015-10-31/generated/azure_mgmt_automation/certificate_operations.rb +81 -69
  8. data/lib/2015-10-31/generated/azure_mgmt_automation/connection_operations.rb +81 -69
  9. data/lib/2015-10-31/generated/azure_mgmt_automation/connection_type_operations.rb +67 -56
  10. data/lib/2015-10-31/generated/azure_mgmt_automation/credential_operations.rb +81 -69
  11. data/lib/2015-10-31/generated/azure_mgmt_automation/dsc_compilation_job_operations.rb +67 -56
  12. data/lib/2015-10-31/generated/azure_mgmt_automation/dsc_compilation_job_stream.rb +124 -0
  13. data/lib/2015-10-31/generated/azure_mgmt_automation/dsc_configuration_operations.rb +215 -70
  14. data/lib/2015-10-31/generated/azure_mgmt_automation/dsc_node_configuration_operations.rb +68 -67
  15. data/lib/2015-10-31/generated/azure_mgmt_automation/dsc_node_operations.rb +67 -56
  16. data/lib/2015-10-31/generated/azure_mgmt_automation/fields.rb +14 -11
  17. data/lib/2015-10-31/generated/azure_mgmt_automation/hybrid_runbook_worker_group_operations.rb +72 -57
  18. data/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb +123 -100
  19. data/lib/2015-10-31/generated/azure_mgmt_automation/job_schedule_operations.rb +72 -57
  20. data/lib/2015-10-31/generated/azure_mgmt_automation/job_stream_operations.rb +39 -32
  21. data/lib/2015-10-31/generated/azure_mgmt_automation/keys.rb +120 -0
  22. data/lib/2015-10-31/generated/azure_mgmt_automation/linked_workspace_operations.rb +120 -0
  23. data/lib/2015-10-31/generated/azure_mgmt_automation/models/activity_list_result.rb +1 -1
  24. data/lib/2015-10-31/generated/azure_mgmt_automation/models/activity_parameter.rb +35 -2
  25. data/lib/2015-10-31/generated/azure_mgmt_automation/models/activity_parameter_validation_set.rb +47 -0
  26. data/lib/2015-10-31/generated/azure_mgmt_automation/models/advanced_schedule_monthly_occurrence.rb +1 -1
  27. data/lib/2015-10-31/generated/azure_mgmt_automation/models/agent_registration_key_name.rb +2 -2
  28. data/lib/2015-10-31/generated/azure_mgmt_automation/models/agent_registration_regenerate_key_parameter.rb +2 -2
  29. data/lib/2015-10-31/generated/azure_mgmt_automation/models/automation_account.rb +9 -9
  30. data/lib/2015-10-31/generated/azure_mgmt_automation/models/automation_account_list_result.rb +1 -1
  31. data/lib/2015-10-31/generated/azure_mgmt_automation/models/automation_key_name.rb +16 -0
  32. data/lib/2015-10-31/generated/azure_mgmt_automation/models/automation_key_permissions.rb +16 -0
  33. data/lib/2015-10-31/generated/azure_mgmt_automation/models/certificate.rb +10 -7
  34. data/lib/2015-10-31/generated/azure_mgmt_automation/models/certificate_list_result.rb +1 -1
  35. data/lib/2015-10-31/generated/azure_mgmt_automation/models/certificate_update_parameters.rb +1 -1
  36. data/lib/2015-10-31/generated/azure_mgmt_automation/models/connection.rb +10 -7
  37. data/lib/2015-10-31/generated/azure_mgmt_automation/models/connection_list_result.rb +1 -1
  38. data/lib/2015-10-31/generated/azure_mgmt_automation/models/connection_type.rb +12 -0
  39. data/lib/2015-10-31/generated/azure_mgmt_automation/models/connection_type_list_result.rb +1 -1
  40. data/lib/2015-10-31/generated/azure_mgmt_automation/models/credential.rb +11 -7
  41. data/lib/2015-10-31/generated/azure_mgmt_automation/models/credential_list_result.rb +1 -1
  42. data/lib/2015-10-31/generated/azure_mgmt_automation/models/credential_update_parameters.rb +1 -1
  43. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_compilation_job.rb +44 -4
  44. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_compilation_job_create_parameters.rb +12 -0
  45. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_compilation_job_list_result.rb +1 -1
  46. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_configuration.rb +20 -9
  47. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_configuration_list_result.rb +13 -1
  48. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_configuration_update_parameters.rb +132 -0
  49. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node.rb +22 -25
  50. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node_configuration.rb +20 -15
  51. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node_configuration_create_or_update_parameters.rb +13 -1
  52. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node_configuration_list_result.rb +1 -1
  53. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node_extension_handler_association_property.rb +58 -0
  54. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node_list_result.rb +1 -1
  55. data/lib/2015-10-31/generated/azure_mgmt_automation/models/dsc_node_report_list_result.rb +1 -1
  56. data/lib/2015-10-31/generated/azure_mgmt_automation/models/group_type_enum.rb +16 -0
  57. data/lib/2015-10-31/generated/azure_mgmt_automation/models/hybrid_runbook_worker.rb +11 -0
  58. data/lib/2015-10-31/generated/azure_mgmt_automation/models/hybrid_runbook_worker_group.rb +12 -0
  59. data/lib/2015-10-31/generated/azure_mgmt_automation/models/hybrid_runbook_worker_groups_list_result.rb +1 -1
  60. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job.rb +37 -1
  61. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job_create_parameters.rb +0 -42
  62. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job_list_result.rb +1 -1
  63. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job_provisioning_state.rb +18 -0
  64. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job_schedule.rb +26 -1
  65. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job_schedule_list_result.rb +1 -1
  66. data/lib/2015-10-31/generated/azure_mgmt_automation/models/job_stream_list_result.rb +1 -1
  67. data/lib/2015-10-31/generated/azure_mgmt_automation/models/key.rb +73 -0
  68. data/lib/2015-10-31/generated/azure_mgmt_automation/models/key_list_result.rb +56 -0
  69. data/lib/2015-10-31/generated/azure_mgmt_automation/models/{sub_resource.rb → linked_workspace.rb} +7 -6
  70. data/lib/2015-10-31/generated/azure_mgmt_automation/models/module_list_result.rb +1 -1
  71. data/lib/2015-10-31/generated/azure_mgmt_automation/models/module_model.rb +20 -9
  72. data/lib/2015-10-31/generated/azure_mgmt_automation/models/proxy_resource.rb +62 -0
  73. data/lib/2015-10-31/generated/azure_mgmt_automation/models/resource.rb +11 -32
  74. data/lib/2015-10-31/generated/azure_mgmt_automation/models/runbook.rb +9 -9
  75. data/lib/2015-10-31/generated/azure_mgmt_automation/models/runbook_draft.rb +2 -1
  76. data/lib/2015-10-31/generated/azure_mgmt_automation/models/runbook_list_result.rb +1 -1
  77. data/lib/2015-10-31/generated/azure_mgmt_automation/models/schedule.rb +12 -7
  78. data/lib/2015-10-31/generated/azure_mgmt_automation/models/schedule_association_property.rb +1 -1
  79. data/lib/2015-10-31/generated/azure_mgmt_automation/models/schedule_create_or_update_parameters.rb +3 -3
  80. data/lib/2015-10-31/generated/azure_mgmt_automation/models/schedule_list_result.rb +1 -1
  81. data/lib/2015-10-31/generated/azure_mgmt_automation/models/schedule_update_parameters.rb +2 -2
  82. data/lib/2015-10-31/generated/azure_mgmt_automation/models/test_job.rb +11 -0
  83. data/lib/2015-10-31/generated/azure_mgmt_automation/models/test_job_create_parameters.rb +0 -11
  84. data/lib/2015-10-31/generated/azure_mgmt_automation/models/tracked_resource.rb +92 -0
  85. data/lib/2015-10-31/generated/azure_mgmt_automation/models/variable.rb +12 -7
  86. data/lib/2015-10-31/generated/azure_mgmt_automation/models/variable_list_result.rb +1 -1
  87. data/lib/2015-10-31/generated/azure_mgmt_automation/models/variable_update_parameters.rb +1 -1
  88. data/lib/2015-10-31/generated/azure_mgmt_automation/models/webhook.rb +23 -7
  89. data/lib/2015-10-31/generated/azure_mgmt_automation/models/webhook_list_result.rb +1 -1
  90. data/lib/2015-10-31/generated/azure_mgmt_automation/models/webhook_update_parameters.rb +1 -1
  91. data/lib/2015-10-31/generated/azure_mgmt_automation/module_model_operations.rb +81 -69
  92. data/lib/2015-10-31/generated/azure_mgmt_automation/node_reports.rb +54 -61
  93. data/lib/2015-10-31/generated/azure_mgmt_automation/object_data_types.rb +28 -22
  94. data/lib/2015-10-31/generated/azure_mgmt_automation/operations.rb +6 -5
  95. data/lib/2015-10-31/generated/azure_mgmt_automation/runbook_draft_operations.rb +144 -118
  96. data/lib/2015-10-31/generated/azure_mgmt_automation/runbook_operations.rb +131 -95
  97. data/lib/2015-10-31/generated/azure_mgmt_automation/schedule_operations.rb +93 -71
  98. data/lib/2015-10-31/generated/azure_mgmt_automation/statistics_operations.rb +14 -11
  99. data/lib/2015-10-31/generated/azure_mgmt_automation/{test_jobs.rb → test_job_operations.rb} +82 -69
  100. data/lib/2015-10-31/generated/azure_mgmt_automation/test_job_streams.rb +49 -39
  101. data/lib/2015-10-31/generated/azure_mgmt_automation/usages.rb +14 -11
  102. data/lib/2015-10-31/generated/azure_mgmt_automation/variable_operations.rb +81 -69
  103. data/lib/2015-10-31/generated/azure_mgmt_automation/webhook_operations.rb +95 -80
  104. data/lib/profiles/latest/automation_latest_profile_client.rb +28 -9
  105. data/lib/profiles/latest/automation_module_definition.rb +0 -1
  106. data/lib/profiles/latest/modules/automation_profile_module.rb +585 -516
  107. data/lib/version.rb +1 -1
  108. metadata +21 -7
@@ -24,8 +24,8 @@ module Azure::Automation::Mgmt::V2015_10_31
24
24
  #
25
25
  # Retrieve a list of fields of a given type identified by module name.
26
26
  #
27
- # @param resource_group_name [String] The resource group name.
28
- # @param automation_account_name [String] The automation account name.
27
+ # @param resource_group_name [String] Name of an Azure Resource group.
28
+ # @param automation_account_name [String] The name of the automation account.
29
29
  # @param module_name [String] The name of module.
30
30
  # @param type_name [String] The name of type.
31
31
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -33,16 +33,16 @@ module Azure::Automation::Mgmt::V2015_10_31
33
33
  #
34
34
  # @return [TypeFieldListResult] operation results.
35
35
  #
36
- def list_fields_by_module_and_type(resource_group_name, automation_account_name, module_name, type_name, custom_headers = nil)
37
- response = list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers).value!
36
+ def list_fields_by_module_and_type(resource_group_name, automation_account_name, module_name, type_name, custom_headers:nil)
37
+ response = list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers:custom_headers).value!
38
38
  response.body unless response.nil?
39
39
  end
40
40
 
41
41
  #
42
42
  # Retrieve a list of fields of a given type identified by module name.
43
43
  #
44
- # @param resource_group_name [String] The resource group name.
45
- # @param automation_account_name [String] The automation account name.
44
+ # @param resource_group_name [String] Name of an Azure Resource group.
45
+ # @param automation_account_name [String] The name of the automation account.
46
46
  # @param module_name [String] The name of module.
47
47
  # @param type_name [String] The name of type.
48
48
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -50,15 +50,15 @@ module Azure::Automation::Mgmt::V2015_10_31
50
50
  #
51
51
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
52
  #
53
- def list_fields_by_module_and_type_with_http_info(resource_group_name, automation_account_name, module_name, type_name, custom_headers = nil)
54
- list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers).value!
53
+ def list_fields_by_module_and_type_with_http_info(resource_group_name, automation_account_name, module_name, type_name, custom_headers:nil)
54
+ list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers:custom_headers).value!
55
55
  end
56
56
 
57
57
  #
58
58
  # Retrieve a list of fields of a given type identified by module name.
59
59
  #
60
- # @param resource_group_name [String] The resource group name.
61
- # @param automation_account_name [String] The automation account name.
60
+ # @param resource_group_name [String] Name of an Azure Resource group.
61
+ # @param automation_account_name [String] The name of the automation account.
62
62
  # @param module_name [String] The name of module.
63
63
  # @param type_name [String] The name of type.
64
64
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -66,8 +66,10 @@ module Azure::Automation::Mgmt::V2015_10_31
66
66
  #
67
67
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
68
  #
69
- def list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers = nil)
69
+ def list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers:nil)
70
70
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
73
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
72
74
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
73
75
  fail ArgumentError, 'module_name is nil' if module_name.nil?
@@ -77,6 +79,7 @@ module Azure::Automation::Mgmt::V2015_10_31
77
79
 
78
80
 
79
81
  request_headers = {}
82
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
80
83
 
81
84
  # Set Headers
82
85
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -124,47 +127,49 @@ module Azure::Automation::Mgmt::V2015_10_31
124
127
  #
125
128
  # Retrieve a list of fields of a given type across all accessible modules.
126
129
  #
127
- # @param resource_group_name [String] The resource group name.
128
- # @param automation_account_name [String] The automation account name.
130
+ # @param resource_group_name [String] Name of an Azure Resource group.
131
+ # @param automation_account_name [String] The name of the automation account.
129
132
  # @param type_name [String] The name of type.
130
133
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
134
  # will be added to the HTTP request.
132
135
  #
133
136
  # @return [TypeFieldListResult] operation results.
134
137
  #
135
- def list_fields_by_type(resource_group_name, automation_account_name, type_name, custom_headers = nil)
136
- response = list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers).value!
138
+ def list_fields_by_type(resource_group_name, automation_account_name, type_name, custom_headers:nil)
139
+ response = list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers:custom_headers).value!
137
140
  response.body unless response.nil?
138
141
  end
139
142
 
140
143
  #
141
144
  # Retrieve a list of fields of a given type across all accessible modules.
142
145
  #
143
- # @param resource_group_name [String] The resource group name.
144
- # @param automation_account_name [String] The automation account name.
146
+ # @param resource_group_name [String] Name of an Azure Resource group.
147
+ # @param automation_account_name [String] The name of the automation account.
145
148
  # @param type_name [String] The name of type.
146
149
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
150
  # will be added to the HTTP request.
148
151
  #
149
152
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
153
  #
151
- def list_fields_by_type_with_http_info(resource_group_name, automation_account_name, type_name, custom_headers = nil)
152
- list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers).value!
154
+ def list_fields_by_type_with_http_info(resource_group_name, automation_account_name, type_name, custom_headers:nil)
155
+ list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers:custom_headers).value!
153
156
  end
154
157
 
155
158
  #
156
159
  # Retrieve a list of fields of a given type across all accessible modules.
157
160
  #
158
- # @param resource_group_name [String] The resource group name.
159
- # @param automation_account_name [String] The automation account name.
161
+ # @param resource_group_name [String] Name of an Azure Resource group.
162
+ # @param automation_account_name [String] The name of the automation account.
160
163
  # @param type_name [String] The name of type.
161
164
  # @param [Hash{String => String}] A hash of custom headers that will be added
162
165
  # to the HTTP request.
163
166
  #
164
167
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
165
168
  #
166
- def list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers = nil)
169
+ def list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers:nil)
167
170
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
172
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
168
173
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
169
174
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
170
175
  fail ArgumentError, 'type_name is nil' if type_name.nil?
@@ -173,6 +178,7 @@ module Azure::Automation::Mgmt::V2015_10_31
173
178
 
174
179
 
175
180
  request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
176
182
 
177
183
  # Set Headers
178
184
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -29,8 +29,8 @@ module Azure::Automation::Mgmt::V2015_10_31
29
29
  #
30
30
  # @return [OperationListResult] operation results.
31
31
  #
32
- def list(custom_headers = nil)
33
- response = list_async(custom_headers).value!
32
+ def list(custom_headers:nil)
33
+ response = list_async(custom_headers:custom_headers).value!
34
34
  response.body unless response.nil?
35
35
  end
36
36
 
@@ -42,8 +42,8 @@ module Azure::Automation::Mgmt::V2015_10_31
42
42
  #
43
43
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
44
  #
45
- def list_with_http_info(custom_headers = nil)
46
- list_async(custom_headers).value!
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
47
  end
48
48
 
49
49
  #
@@ -54,11 +54,12 @@ module Azure::Automation::Mgmt::V2015_10_31
54
54
  #
55
55
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
56
  #
57
- def list_async(custom_headers = nil)
57
+ def list_async(custom_headers:nil)
58
58
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
59
 
60
60
 
61
61
  request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
62
63
 
63
64
  # Set Headers
64
65
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -24,55 +24,58 @@ module Azure::Automation::Mgmt::V2015_10_31
24
24
  #
25
25
  # Retrieve the content of runbook draft identified by runbook name.
26
26
  #
27
- # @param resource_group_name [String] The resource group name.
28
- # @param automation_account_name [String] The automation account name.
27
+ # @param resource_group_name [String] Name of an Azure Resource group.
28
+ # @param automation_account_name [String] The name of the automation account.
29
29
  # @param runbook_name [String] The runbook name.
30
30
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
31
  # will be added to the HTTP request.
32
32
  #
33
33
  # @return [NOT_IMPLEMENTED] operation results.
34
34
  #
35
- def get_content(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
36
- response = get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
35
+ def get_content(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
36
+ response = get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
37
37
  response.body unless response.nil?
38
38
  end
39
39
 
40
40
  #
41
41
  # Retrieve the content of runbook draft identified by runbook name.
42
42
  #
43
- # @param resource_group_name [String] The resource group name.
44
- # @param automation_account_name [String] The automation account name.
43
+ # @param resource_group_name [String] Name of an Azure Resource group.
44
+ # @param automation_account_name [String] The name of the automation account.
45
45
  # @param runbook_name [String] The runbook name.
46
46
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
47
  # will be added to the HTTP request.
48
48
  #
49
49
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
50
  #
51
- def get_content_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
52
- get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
51
+ def get_content_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
52
+ get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
53
53
  end
54
54
 
55
55
  #
56
56
  # Retrieve the content of runbook draft identified by runbook name.
57
57
  #
58
- # @param resource_group_name [String] The resource group name.
59
- # @param automation_account_name [String] The automation account name.
58
+ # @param resource_group_name [String] Name of an Azure Resource group.
59
+ # @param automation_account_name [String] The name of the automation account.
60
60
  # @param runbook_name [String] The runbook name.
61
61
  # @param [Hash{String => String}] A hash of custom headers that will be added
62
62
  # to the HTTP request.
63
63
  #
64
64
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
65
  #
66
- def get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
66
+ def get_content_async(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
67
68
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
68
71
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
69
72
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
70
73
  fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
71
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
72
74
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
75
 
74
76
 
75
77
  request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
76
79
 
77
80
  # Set Headers
78
81
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -83,7 +86,7 @@ module Azure::Automation::Mgmt::V2015_10_31
83
86
 
84
87
  options = {
85
88
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
86
- path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
89
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name},
87
90
  query_params: {'api-version' => @client.api_version},
88
91
  headers: request_headers.merge(custom_headers || {}),
89
92
  base_url: request_url
@@ -96,7 +99,7 @@ module Azure::Automation::Mgmt::V2015_10_31
96
99
  response_content = http_response.body
97
100
  unless status_code == 200
98
101
  error_model = JSON.load(response_content)
99
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
102
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
100
103
  end
101
104
 
102
105
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -125,38 +128,49 @@ module Azure::Automation::Mgmt::V2015_10_31
125
128
  end
126
129
 
127
130
  #
128
- # Updates the runbook draft with runbookStream as its content.
131
+ # Replaces the runbook draft content.
129
132
  #
130
- # @param resource_group_name [String] The resource group name.
131
- # @param automation_account_name [String] The automation account name.
133
+ # @param resource_group_name [String] Name of an Azure Resource group.
134
+ # @param automation_account_name [String] The name of the automation account.
132
135
  # @param runbook_name [String] The runbook name.
133
- # @param runbook_content The runbook draft content.
136
+ # @param runbook_content The runbook draft content.
134
137
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
138
  # will be added to the HTTP request.
136
139
  #
137
- def create_or_update(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
138
- response = create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers).value!
139
- nil
140
+ # @return [NOT_IMPLEMENTED] operation results.
141
+ #
142
+ def replace_content(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:nil)
143
+ response = replace_content_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
140
145
  end
141
146
 
142
147
  #
143
- # @param resource_group_name [String] The resource group name.
144
- # @param automation_account_name [String] The automation account name.
148
+ # @param resource_group_name [String] Name of an Azure Resource group.
149
+ # @param automation_account_name [String] The name of the automation account.
145
150
  # @param runbook_name [String] The runbook name.
146
- # @param runbook_content The runbook draft content.
151
+ # @param runbook_content The runbook draft content.
147
152
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
148
153
  # will be added to the HTTP request.
149
154
  #
150
155
  # @return [Concurrent::Promise] promise which provides async access to http
151
156
  # response.
152
157
  #
153
- def create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
158
+ def replace_content_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:nil)
154
159
  # Send request
155
- promise = begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers)
160
+ promise = begin_replace_content_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:custom_headers)
156
161
 
157
162
  promise = promise.then do |response|
158
163
  # Defining deserialization method.
159
164
  deserialize_method = lambda do |parsed_response|
165
+ result_mapper = {
166
+ client_side_validation: true,
167
+ required: false,
168
+ serialized_name: 'parsed_response',
169
+ type: {
170
+ name: 'Stream'
171
+ }
172
+ }
173
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
160
174
  end
161
175
 
162
176
  # Waiting for response.
@@ -169,55 +183,58 @@ module Azure::Automation::Mgmt::V2015_10_31
169
183
  #
170
184
  # Retrieve the runbook draft identified by runbook name.
171
185
  #
172
- # @param resource_group_name [String] The resource group name.
173
- # @param automation_account_name [String] The automation account name.
186
+ # @param resource_group_name [String] Name of an Azure Resource group.
187
+ # @param automation_account_name [String] The name of the automation account.
174
188
  # @param runbook_name [String] The runbook name.
175
189
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
176
190
  # will be added to the HTTP request.
177
191
  #
178
192
  # @return [RunbookDraft] operation results.
179
193
  #
180
- def get(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
181
- response = get_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
194
+ def get(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
195
+ response = get_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
182
196
  response.body unless response.nil?
183
197
  end
184
198
 
185
199
  #
186
200
  # Retrieve the runbook draft identified by runbook name.
187
201
  #
188
- # @param resource_group_name [String] The resource group name.
189
- # @param automation_account_name [String] The automation account name.
202
+ # @param resource_group_name [String] Name of an Azure Resource group.
203
+ # @param automation_account_name [String] The name of the automation account.
190
204
  # @param runbook_name [String] The runbook name.
191
205
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
192
206
  # will be added to the HTTP request.
193
207
  #
194
208
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
195
209
  #
196
- def get_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
197
- get_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
210
+ def get_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
211
+ get_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
198
212
  end
199
213
 
200
214
  #
201
215
  # Retrieve the runbook draft identified by runbook name.
202
216
  #
203
- # @param resource_group_name [String] The resource group name.
204
- # @param automation_account_name [String] The automation account name.
217
+ # @param resource_group_name [String] Name of an Azure Resource group.
218
+ # @param automation_account_name [String] The name of the automation account.
205
219
  # @param runbook_name [String] The runbook name.
206
220
  # @param [Hash{String => String}] A hash of custom headers that will be added
207
221
  # to the HTTP request.
208
222
  #
209
223
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
210
224
  #
211
- def get_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
225
+ def get_async(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
226
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
212
227
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
228
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
229
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
213
230
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
214
231
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
215
232
  fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
216
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
217
233
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
218
234
 
219
235
 
220
236
  request_headers = {}
237
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
221
238
 
222
239
  # Set Headers
223
240
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -228,7 +245,7 @@ module Azure::Automation::Mgmt::V2015_10_31
228
245
 
229
246
  options = {
230
247
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
231
- path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
248
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name},
232
249
  query_params: {'api-version' => @client.api_version},
233
250
  headers: request_headers.merge(custom_headers || {}),
234
251
  base_url: request_url
@@ -265,23 +282,21 @@ module Azure::Automation::Mgmt::V2015_10_31
265
282
  #
266
283
  # Publish runbook draft.
267
284
  #
268
- # @param resource_group_name [String] The resource group name.
269
- # @param automation_account_name [String] The automation account name.
285
+ # @param resource_group_name [String] Name of an Azure Resource group.
286
+ # @param automation_account_name [String] The name of the automation account.
270
287
  # @param runbook_name [String] The parameters supplied to the publish runbook
271
288
  # operation.
272
289
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
273
290
  # will be added to the HTTP request.
274
291
  #
275
- # @return [Runbook] operation results.
276
- #
277
- def publish(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
278
- response = publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
279
- response.body unless response.nil?
292
+ def publish(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
293
+ response = publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
294
+ nil
280
295
  end
281
296
 
282
297
  #
283
- # @param resource_group_name [String] The resource group name.
284
- # @param automation_account_name [String] The automation account name.
298
+ # @param resource_group_name [String] Name of an Azure Resource group.
299
+ # @param automation_account_name [String] The name of the automation account.
285
300
  # @param runbook_name [String] The parameters supplied to the publish runbook
286
301
  # operation.
287
302
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -290,15 +305,13 @@ module Azure::Automation::Mgmt::V2015_10_31
290
305
  # @return [Concurrent::Promise] promise which provides async access to http
291
306
  # response.
292
307
  #
293
- def publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
308
+ def publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
294
309
  # Send request
295
- promise = begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers)
310
+ promise = begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers)
296
311
 
297
312
  promise = promise.then do |response|
298
313
  # Defining deserialization method.
299
314
  deserialize_method = lambda do |parsed_response|
300
- result_mapper = Azure::Automation::Mgmt::V2015_10_31::Models::Runbook.mapper()
301
- parsed_response = @client.deserialize(result_mapper, parsed_response)
302
315
  end
303
316
 
304
317
  # Waiting for response.
@@ -309,57 +322,60 @@ module Azure::Automation::Mgmt::V2015_10_31
309
322
  end
310
323
 
311
324
  #
312
- # Retrieve the runbook identified by runbook name.
325
+ # Undo draft edit to last known published state identified by runbook name.
313
326
  #
314
- # @param resource_group_name [String] The resource group name.
315
- # @param automation_account_name [String] The automation account name.
327
+ # @param resource_group_name [String] Name of an Azure Resource group.
328
+ # @param automation_account_name [String] The name of the automation account.
316
329
  # @param runbook_name [String] The runbook name.
317
330
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
331
  # will be added to the HTTP request.
319
332
  #
320
333
  # @return [RunbookDraftUndoEditResult] operation results.
321
334
  #
322
- def undo_edit(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
323
- response = undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
335
+ def undo_edit(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
336
+ response = undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
324
337
  response.body unless response.nil?
325
338
  end
326
339
 
327
340
  #
328
- # Retrieve the runbook identified by runbook name.
341
+ # Undo draft edit to last known published state identified by runbook name.
329
342
  #
330
- # @param resource_group_name [String] The resource group name.
331
- # @param automation_account_name [String] The automation account name.
343
+ # @param resource_group_name [String] Name of an Azure Resource group.
344
+ # @param automation_account_name [String] The name of the automation account.
332
345
  # @param runbook_name [String] The runbook name.
333
346
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
334
347
  # will be added to the HTTP request.
335
348
  #
336
349
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
337
350
  #
338
- def undo_edit_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
339
- undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
351
+ def undo_edit_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
352
+ undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
340
353
  end
341
354
 
342
355
  #
343
- # Retrieve the runbook identified by runbook name.
356
+ # Undo draft edit to last known published state identified by runbook name.
344
357
  #
345
- # @param resource_group_name [String] The resource group name.
346
- # @param automation_account_name [String] The automation account name.
358
+ # @param resource_group_name [String] Name of an Azure Resource group.
359
+ # @param automation_account_name [String] The name of the automation account.
347
360
  # @param runbook_name [String] The runbook name.
348
361
  # @param [Hash{String => String}] A hash of custom headers that will be added
349
362
  # to the HTTP request.
350
363
  #
351
364
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
352
365
  #
353
- def undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
366
+ def undo_edit_async(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
367
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
354
368
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
369
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
370
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
355
371
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
356
372
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
357
373
  fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
358
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
359
374
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
360
375
 
361
376
 
362
377
  request_headers = {}
378
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
363
379
 
364
380
  # Set Headers
365
381
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -370,7 +386,7 @@ module Azure::Automation::Mgmt::V2015_10_31
370
386
 
371
387
  options = {
372
388
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
373
- path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
389
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name},
374
390
  query_params: {'api-version' => @client.api_version},
375
391
  headers: request_headers.merge(custom_headers || {}),
376
392
  base_url: request_url
@@ -405,67 +421,69 @@ module Azure::Automation::Mgmt::V2015_10_31
405
421
  end
406
422
 
407
423
  #
408
- # Updates the runbook draft with runbookStream as its content.
424
+ # Replaces the runbook draft content.
409
425
  #
410
- # @param resource_group_name [String] The resource group name.
411
- # @param automation_account_name [String] The automation account name.
426
+ # @param resource_group_name [String] Name of an Azure Resource group.
427
+ # @param automation_account_name [String] The name of the automation account.
412
428
  # @param runbook_name [String] The runbook name.
413
- # @param runbook_content The runbook draft content.
429
+ # @param runbook_content The runbook draft content.
414
430
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
431
  # will be added to the HTTP request.
416
432
  #
433
+ # @return [NOT_IMPLEMENTED] operation results.
417
434
  #
418
- def begin_create_or_update(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
419
- response = begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers).value!
420
- nil
435
+ def begin_replace_content(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:nil)
436
+ response = begin_replace_content_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:custom_headers).value!
437
+ response.body unless response.nil?
421
438
  end
422
439
 
423
440
  #
424
- # Updates the runbook draft with runbookStream as its content.
441
+ # Replaces the runbook draft content.
425
442
  #
426
- # @param resource_group_name [String] The resource group name.
427
- # @param automation_account_name [String] The automation account name.
443
+ # @param resource_group_name [String] Name of an Azure Resource group.
444
+ # @param automation_account_name [String] The name of the automation account.
428
445
  # @param runbook_name [String] The runbook name.
429
- # @param runbook_content The runbook draft content.
446
+ # @param runbook_content The runbook draft content.
430
447
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
431
448
  # will be added to the HTTP request.
432
449
  #
433
450
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
434
451
  #
435
- def begin_create_or_update_with_http_info(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
436
- begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers).value!
452
+ def begin_replace_content_with_http_info(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:nil)
453
+ begin_replace_content_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:custom_headers).value!
437
454
  end
438
455
 
439
456
  #
440
- # Updates the runbook draft with runbookStream as its content.
457
+ # Replaces the runbook draft content.
441
458
  #
442
- # @param resource_group_name [String] The resource group name.
443
- # @param automation_account_name [String] The automation account name.
459
+ # @param resource_group_name [String] Name of an Azure Resource group.
460
+ # @param automation_account_name [String] The name of the automation account.
444
461
  # @param runbook_name [String] The runbook name.
445
- # @param runbook_content The runbook draft content.
462
+ # @param runbook_content The runbook draft content.
446
463
  # @param [Hash{String => String}] A hash of custom headers that will be added
447
464
  # to the HTTP request.
448
465
  #
449
466
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
450
467
  #
451
- def begin_create_or_update_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers = nil)
468
+ def begin_replace_content_async(resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers:nil)
469
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
452
470
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
471
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
472
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
453
473
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
454
474
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
455
475
  fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
456
476
  fail ArgumentError, 'runbook_content is nil' if runbook_content.nil?
457
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
458
477
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
459
478
 
460
479
 
461
480
  request_headers = {}
481
+ request_headers['Content-Type'] = 'text/powershell'
462
482
 
463
483
  # Set Headers
464
484
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
465
485
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
466
486
 
467
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
468
-
469
487
  # Serialize Request
470
488
  request_mapper = {
471
489
  client_side_validation: true,
@@ -476,7 +494,6 @@ module Azure::Automation::Mgmt::V2015_10_31
476
494
  }
477
495
  }
478
496
  request_content = @client.serialize(request_mapper, runbook_content)
479
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
480
497
 
481
498
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'
482
499
 
@@ -484,7 +501,7 @@ module Azure::Automation::Mgmt::V2015_10_31
484
501
 
485
502
  options = {
486
503
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
487
- path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
504
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name},
488
505
  query_params: {'api-version' => @client.api_version},
489
506
  body: request_content,
490
507
  headers: request_headers.merge(custom_headers || {}),
@@ -496,12 +513,29 @@ module Azure::Automation::Mgmt::V2015_10_31
496
513
  http_response = result.response
497
514
  status_code = http_response.status
498
515
  response_content = http_response.body
499
- unless status_code == 202 || status_code == 200
516
+ unless status_code == 200 || status_code == 202
500
517
  error_model = JSON.load(response_content)
501
518
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
502
519
  end
503
520
 
504
521
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
522
+ # Deserialize Response
523
+ if status_code == 200
524
+ begin
525
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
526
+ result_mapper = {
527
+ client_side_validation: true,
528
+ required: false,
529
+ serialized_name: 'parsed_response',
530
+ type: {
531
+ name: 'Stream'
532
+ }
533
+ }
534
+ result.body = @client.deserialize(result_mapper, parsed_response)
535
+ rescue Exception => e
536
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
537
+ end
538
+ end
505
539
 
506
540
  result
507
541
  end
@@ -512,25 +546,24 @@ module Azure::Automation::Mgmt::V2015_10_31
512
546
  #
513
547
  # Publish runbook draft.
514
548
  #
515
- # @param resource_group_name [String] The resource group name.
516
- # @param automation_account_name [String] The automation account name.
549
+ # @param resource_group_name [String] Name of an Azure Resource group.
550
+ # @param automation_account_name [String] The name of the automation account.
517
551
  # @param runbook_name [String] The parameters supplied to the publish runbook
518
552
  # operation.
519
553
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
520
554
  # will be added to the HTTP request.
521
555
  #
522
- # @return [Runbook] operation results.
523
556
  #
524
- def begin_publish(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
525
- response = begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
526
- response.body unless response.nil?
557
+ def begin_publish(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
558
+ response = begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
559
+ nil
527
560
  end
528
561
 
529
562
  #
530
563
  # Publish runbook draft.
531
564
  #
532
- # @param resource_group_name [String] The resource group name.
533
- # @param automation_account_name [String] The automation account name.
565
+ # @param resource_group_name [String] Name of an Azure Resource group.
566
+ # @param automation_account_name [String] The name of the automation account.
534
567
  # @param runbook_name [String] The parameters supplied to the publish runbook
535
568
  # operation.
536
569
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -538,15 +571,15 @@ module Azure::Automation::Mgmt::V2015_10_31
538
571
  #
539
572
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
540
573
  #
541
- def begin_publish_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
542
- begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers).value!
574
+ def begin_publish_with_http_info(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
575
+ begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers:custom_headers).value!
543
576
  end
544
577
 
545
578
  #
546
579
  # Publish runbook draft.
547
580
  #
548
- # @param resource_group_name [String] The resource group name.
549
- # @param automation_account_name [String] The automation account name.
581
+ # @param resource_group_name [String] Name of an Azure Resource group.
582
+ # @param automation_account_name [String] The name of the automation account.
550
583
  # @param runbook_name [String] The parameters supplied to the publish runbook
551
584
  # operation.
552
585
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -554,16 +587,19 @@ module Azure::Automation::Mgmt::V2015_10_31
554
587
  #
555
588
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
556
589
  #
557
- def begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers = nil)
590
+ def begin_publish_async(resource_group_name, automation_account_name, runbook_name, custom_headers:nil)
591
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
558
592
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
593
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
594
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
559
595
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil?
560
596
  fail ArgumentError, 'automation_account_name is nil' if automation_account_name.nil?
561
597
  fail ArgumentError, 'runbook_name is nil' if runbook_name.nil?
562
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
563
598
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
564
599
 
565
600
 
566
601
  request_headers = {}
602
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
567
603
 
568
604
  # Set Headers
569
605
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -574,7 +610,7 @@ module Azure::Automation::Mgmt::V2015_10_31
574
610
 
575
611
  options = {
576
612
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
577
- path_params: {'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name,'subscriptionId' => @client.subscription_id},
613
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'automationAccountName' => automation_account_name,'runbookName' => runbook_name},
578
614
  query_params: {'api-version' => @client.api_version},
579
615
  headers: request_headers.merge(custom_headers || {}),
580
616
  base_url: request_url
@@ -585,22 +621,12 @@ module Azure::Automation::Mgmt::V2015_10_31
585
621
  http_response = result.response
586
622
  status_code = http_response.status
587
623
  response_content = http_response.body
588
- unless status_code == 202 || status_code == 200
624
+ unless status_code == 202
589
625
  error_model = JSON.load(response_content)
590
626
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
591
627
  end
592
628
 
593
629
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
594
- # Deserialize Response
595
- if status_code == 200
596
- begin
597
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
598
- result_mapper = Azure::Automation::Mgmt::V2015_10_31::Models::Runbook.mapper()
599
- result.body = @client.deserialize(result_mapper, parsed_response)
600
- rescue Exception => e
601
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
602
- end
603
- end
604
630
 
605
631
  result
606
632
  end