azure_mgmt_maintenance 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance.rb +48 -0
  4. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/apply_updates.rb +481 -0
  5. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/configuration_assignments.rb +747 -0
  6. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/maintenance_configurations.rb +509 -0
  7. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/maintenance_management_client.rb +149 -0
  8. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/apply_update.rb +96 -0
  9. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/configuration_assignment.rb +95 -0
  10. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/error_details.rb +58 -0
  11. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/impact_type.rb +18 -0
  12. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_configuration_assignments_result.rb +56 -0
  13. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_maintenance_configurations_result.rb +56 -0
  14. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_updates_result.rb +55 -0
  15. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_configuration.rb +136 -0
  16. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_error.rb +47 -0
  17. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_scope.rb +18 -0
  18. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/operation.rb +80 -0
  19. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/operation_info.rb +79 -0
  20. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/operations_list_result.rb +55 -0
  21. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/resource.rb +80 -0
  22. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/update.rb +105 -0
  23. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/models/update_status.rb +19 -0
  24. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/module_definition.rb +9 -0
  25. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/operations.rb +118 -0
  26. data/lib/2018-06-01-preview/generated/azure_mgmt_maintenance/updates.rb +249 -0
  27. data/lib/azure_mgmt_maintenance.rb +6 -0
  28. data/lib/module_definition.rb +7 -0
  29. data/lib/profiles/latest/maintenance_latest_profile_client.rb +40 -0
  30. data/lib/profiles/latest/maintenance_module_definition.rb +8 -0
  31. data/lib/profiles/latest/modules/maintenance_profile_module.rb +133 -0
  32. data/lib/version.rb +7 -0
  33. metadata +148 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cd00c8e152f5cf8fc838246098d54b964f937391940f6ee2d5a52478d7dcfcd3
4
+ data.tar.gz: 4ede00b421143e4fd38c9d9079a250c41aeab7e2d857f441d6b0394ab5bf8f5f
5
+ SHA512:
6
+ metadata.gz: 7515f687feeeb2516048362ac333cdfe96eb9703c0201b975571e16fa1f4215df2c730c6727709f13a0a7b9110375d46ee883de0f88c75a47c4cffb205634d5f
7
+ data.tar.gz: f7051081a2f670acbdd3d5eb3d63debf8bc220f4970b771336c8d284fe67ca4cb485b089660e43fc24bc6ae4cda6bd98e9261c4b06b81c0976583c55b56fd080
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2018-06-01-preview/generated/azure_mgmt_maintenance/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Maintenance::Mgmt::V2018_06_01_preview
23
+ autoload :ApplyUpdates, '2018-06-01-preview/generated/azure_mgmt_maintenance/apply_updates.rb'
24
+ autoload :ConfigurationAssignments, '2018-06-01-preview/generated/azure_mgmt_maintenance/configuration_assignments.rb'
25
+ autoload :MaintenanceConfigurations, '2018-06-01-preview/generated/azure_mgmt_maintenance/maintenance_configurations.rb'
26
+ autoload :Operations, '2018-06-01-preview/generated/azure_mgmt_maintenance/operations.rb'
27
+ autoload :Updates, '2018-06-01-preview/generated/azure_mgmt_maintenance/updates.rb'
28
+ autoload :MaintenanceManagementClient, '2018-06-01-preview/generated/azure_mgmt_maintenance/maintenance_management_client.rb'
29
+
30
+ module Models
31
+ autoload :MaintenanceError, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_error.rb'
32
+ autoload :ListMaintenanceConfigurationsResult, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_maintenance_configurations_result.rb'
33
+ autoload :Resource, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/resource.rb'
34
+ autoload :Update, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/update.rb'
35
+ autoload :ListUpdatesResult, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_updates_result.rb'
36
+ autoload :OperationInfo, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/operation_info.rb'
37
+ autoload :ListConfigurationAssignmentsResult, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/list_configuration_assignments_result.rb'
38
+ autoload :Operation, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/operation.rb'
39
+ autoload :ErrorDetails, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/error_details.rb'
40
+ autoload :OperationsListResult, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/operations_list_result.rb'
41
+ autoload :ApplyUpdate, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/apply_update.rb'
42
+ autoload :ConfigurationAssignment, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/configuration_assignment.rb'
43
+ autoload :MaintenanceConfiguration, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_configuration.rb'
44
+ autoload :UpdateStatus, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/update_status.rb'
45
+ autoload :MaintenanceScope, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/maintenance_scope.rb'
46
+ autoload :ImpactType, '2018-06-01-preview/generated/azure_mgmt_maintenance/models/impact_type.rb'
47
+ end
48
+ end
@@ -0,0 +1,481 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Maintenance::Mgmt::V2018_06_01_preview
7
+ #
8
+ # Azure Maintenance Management Client
9
+ #
10
+ class ApplyUpdates
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ApplyUpdates class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [MaintenanceManagementClient] reference to the MaintenanceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Track Updates to resource with parent
26
+ #
27
+ # Track maintenance updates to resource with parent
28
+ #
29
+ # @param resource_group_name [String] Resource group name
30
+ # @param resource_parent_type [String] Resource parent type
31
+ # @param resource_parent_name [String] Resource parent identifier
32
+ # @param provider_name [String] Resource provider name
33
+ # @param resource_type [String] Resource type
34
+ # @param resource_name [String] Resource identifier
35
+ # @param apply_update_name [String] applyUpdate Id
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [ApplyUpdate] operation results.
40
+ #
41
+ def get_parent(resource_group_name, resource_parent_type, resource_parent_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:nil)
42
+ response = get_parent_async(resource_group_name, resource_parent_type, resource_parent_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Track Updates to resource with parent
48
+ #
49
+ # Track maintenance updates to resource with parent
50
+ #
51
+ # @param resource_group_name [String] Resource group name
52
+ # @param resource_parent_type [String] Resource parent type
53
+ # @param resource_parent_name [String] Resource parent identifier
54
+ # @param provider_name [String] Resource provider name
55
+ # @param resource_type [String] Resource type
56
+ # @param resource_name [String] Resource identifier
57
+ # @param apply_update_name [String] applyUpdate Id
58
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
59
+ # will be added to the HTTP request.
60
+ #
61
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
+ #
63
+ def get_parent_with_http_info(resource_group_name, resource_parent_type, resource_parent_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:nil)
64
+ get_parent_async(resource_group_name, resource_parent_type, resource_parent_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:custom_headers).value!
65
+ end
66
+
67
+ #
68
+ # Track Updates to resource with parent
69
+ #
70
+ # Track maintenance updates to resource with parent
71
+ #
72
+ # @param resource_group_name [String] Resource group name
73
+ # @param resource_parent_type [String] Resource parent type
74
+ # @param resource_parent_name [String] Resource parent identifier
75
+ # @param provider_name [String] Resource provider name
76
+ # @param resource_type [String] Resource type
77
+ # @param resource_name [String] Resource identifier
78
+ # @param apply_update_name [String] applyUpdate Id
79
+ # @param [Hash{String => String}] A hash of custom headers that will be added
80
+ # to the HTTP request.
81
+ #
82
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
83
+ #
84
+ def get_parent_async(resource_group_name, resource_parent_type, resource_parent_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:nil)
85
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
87
+ fail ArgumentError, 'resource_parent_type is nil' if resource_parent_type.nil?
88
+ fail ArgumentError, 'resource_parent_name is nil' if resource_parent_name.nil?
89
+ fail ArgumentError, 'provider_name is nil' if provider_name.nil?
90
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
91
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
92
+ fail ArgumentError, 'apply_update_name is nil' if apply_update_name.nil?
93
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
94
+
95
+
96
+ request_headers = {}
97
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
98
+
99
+ # Set Headers
100
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
101
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
102
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}'
103
+
104
+ request_url = @base_url || @client.base_url
105
+
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceParentType' => resource_parent_type,'resourceParentName' => resource_parent_name,'providerName' => provider_name,'resourceType' => resource_type,'resourceName' => resource_name,'applyUpdateName' => apply_update_name},
109
+ query_params: {'api-version' => @client.api_version},
110
+ headers: request_headers.merge(custom_headers || {}),
111
+ base_url: request_url
112
+ }
113
+ promise = @client.make_request_async(:get, path_template, options)
114
+
115
+ promise = promise.then do |result|
116
+ http_response = result.response
117
+ status_code = http_response.status
118
+ response_content = http_response.body
119
+ unless status_code == 200
120
+ error_model = JSON.load(response_content)
121
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
122
+ end
123
+
124
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
125
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
126
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
127
+ # Deserialize Response
128
+ if status_code == 200
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ApplyUpdate.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+
138
+ result
139
+ end
140
+
141
+ promise.execute
142
+ end
143
+
144
+ #
145
+ # Track Updates to resource
146
+ #
147
+ # Track maintenance updates to resource
148
+ #
149
+ # @param resource_group_name [String] Resource group name
150
+ # @param provider_name [String] Resource provider name
151
+ # @param resource_type [String] Resource type
152
+ # @param resource_name [String] Resource identifier
153
+ # @param apply_update_name [String] applyUpdate Id
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [ApplyUpdate] operation results.
158
+ #
159
+ def get(resource_group_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:nil)
160
+ response = get_async(resource_group_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:custom_headers).value!
161
+ response.body unless response.nil?
162
+ end
163
+
164
+ #
165
+ # Track Updates to resource
166
+ #
167
+ # Track maintenance updates to resource
168
+ #
169
+ # @param resource_group_name [String] Resource group name
170
+ # @param provider_name [String] Resource provider name
171
+ # @param resource_type [String] Resource type
172
+ # @param resource_name [String] Resource identifier
173
+ # @param apply_update_name [String] applyUpdate Id
174
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
175
+ # will be added to the HTTP request.
176
+ #
177
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
178
+ #
179
+ def get_with_http_info(resource_group_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:nil)
180
+ get_async(resource_group_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:custom_headers).value!
181
+ end
182
+
183
+ #
184
+ # Track Updates to resource
185
+ #
186
+ # Track maintenance updates to resource
187
+ #
188
+ # @param resource_group_name [String] Resource group name
189
+ # @param provider_name [String] Resource provider name
190
+ # @param resource_type [String] Resource type
191
+ # @param resource_name [String] Resource identifier
192
+ # @param apply_update_name [String] applyUpdate Id
193
+ # @param [Hash{String => String}] A hash of custom headers that will be added
194
+ # to the HTTP request.
195
+ #
196
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
197
+ #
198
+ def get_async(resource_group_name, provider_name, resource_type, resource_name, apply_update_name, custom_headers:nil)
199
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
200
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
201
+ fail ArgumentError, 'provider_name is nil' if provider_name.nil?
202
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
203
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
204
+ fail ArgumentError, 'apply_update_name is nil' if apply_update_name.nil?
205
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
206
+
207
+
208
+ request_headers = {}
209
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
210
+
211
+ # Set Headers
212
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
213
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
214
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}'
215
+
216
+ request_url = @base_url || @client.base_url
217
+
218
+ options = {
219
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
220
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => provider_name,'resourceType' => resource_type,'resourceName' => resource_name,'applyUpdateName' => apply_update_name},
221
+ query_params: {'api-version' => @client.api_version},
222
+ headers: request_headers.merge(custom_headers || {}),
223
+ base_url: request_url
224
+ }
225
+ promise = @client.make_request_async(:get, path_template, options)
226
+
227
+ promise = promise.then do |result|
228
+ http_response = result.response
229
+ status_code = http_response.status
230
+ response_content = http_response.body
231
+ unless status_code == 200
232
+ error_model = JSON.load(response_content)
233
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
234
+ end
235
+
236
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
237
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
238
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
239
+ # Deserialize Response
240
+ if status_code == 200
241
+ begin
242
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
243
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ApplyUpdate.mapper()
244
+ result.body = @client.deserialize(result_mapper, parsed_response)
245
+ rescue Exception => e
246
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
247
+ end
248
+ end
249
+
250
+ result
251
+ end
252
+
253
+ promise.execute
254
+ end
255
+
256
+ #
257
+ # Apply Updates to resource with parent
258
+ #
259
+ # Apply maintenance updates to resource with parent
260
+ #
261
+ # @param resource_group_name [String] Resource group name
262
+ # @param provider_name [String] Resource provider name
263
+ # @param resource_parent_type [String] Resource parent type
264
+ # @param resource_parent_name [String] Resource parent identifier
265
+ # @param resource_type [String] Resource type
266
+ # @param resource_name [String] Resource identifier
267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
268
+ # will be added to the HTTP request.
269
+ #
270
+ # @return [ApplyUpdate] operation results.
271
+ #
272
+ def create_or_update_parent(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:nil)
273
+ response = create_or_update_parent_async(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:custom_headers).value!
274
+ response.body unless response.nil?
275
+ end
276
+
277
+ #
278
+ # Apply Updates to resource with parent
279
+ #
280
+ # Apply maintenance updates to resource with parent
281
+ #
282
+ # @param resource_group_name [String] Resource group name
283
+ # @param provider_name [String] Resource provider name
284
+ # @param resource_parent_type [String] Resource parent type
285
+ # @param resource_parent_name [String] Resource parent identifier
286
+ # @param resource_type [String] Resource type
287
+ # @param resource_name [String] Resource identifier
288
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
289
+ # will be added to the HTTP request.
290
+ #
291
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
292
+ #
293
+ def create_or_update_parent_with_http_info(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:nil)
294
+ create_or_update_parent_async(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:custom_headers).value!
295
+ end
296
+
297
+ #
298
+ # Apply Updates to resource with parent
299
+ #
300
+ # Apply maintenance updates to resource with parent
301
+ #
302
+ # @param resource_group_name [String] Resource group name
303
+ # @param provider_name [String] Resource provider name
304
+ # @param resource_parent_type [String] Resource parent type
305
+ # @param resource_parent_name [String] Resource parent identifier
306
+ # @param resource_type [String] Resource type
307
+ # @param resource_name [String] Resource identifier
308
+ # @param [Hash{String => String}] A hash of custom headers that will be added
309
+ # to the HTTP request.
310
+ #
311
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
312
+ #
313
+ def create_or_update_parent_async(resource_group_name, provider_name, resource_parent_type, resource_parent_name, resource_type, resource_name, custom_headers:nil)
314
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
315
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
316
+ fail ArgumentError, 'provider_name is nil' if provider_name.nil?
317
+ fail ArgumentError, 'resource_parent_type is nil' if resource_parent_type.nil?
318
+ fail ArgumentError, 'resource_parent_name is nil' if resource_parent_name.nil?
319
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
320
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
321
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
322
+
323
+
324
+ request_headers = {}
325
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
326
+
327
+ # Set Headers
328
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
329
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
330
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default'
331
+
332
+ request_url = @base_url || @client.base_url
333
+
334
+ options = {
335
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
336
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => provider_name,'resourceParentType' => resource_parent_type,'resourceParentName' => resource_parent_name,'resourceType' => resource_type,'resourceName' => resource_name},
337
+ query_params: {'api-version' => @client.api_version},
338
+ headers: request_headers.merge(custom_headers || {}),
339
+ base_url: request_url
340
+ }
341
+ promise = @client.make_request_async(:put, path_template, options)
342
+
343
+ promise = promise.then do |result|
344
+ http_response = result.response
345
+ status_code = http_response.status
346
+ response_content = http_response.body
347
+ unless status_code == 200
348
+ error_model = JSON.load(response_content)
349
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
350
+ end
351
+
352
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
353
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
354
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
355
+ # Deserialize Response
356
+ if status_code == 200
357
+ begin
358
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
359
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ApplyUpdate.mapper()
360
+ result.body = @client.deserialize(result_mapper, parsed_response)
361
+ rescue Exception => e
362
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
363
+ end
364
+ end
365
+
366
+ result
367
+ end
368
+
369
+ promise.execute
370
+ end
371
+
372
+ #
373
+ # Apply Updates to resource
374
+ #
375
+ # Apply maintenance updates to resource
376
+ #
377
+ # @param resource_group_name [String] Resource group name
378
+ # @param provider_name [String] Resource provider name
379
+ # @param resource_type [String] Resource type
380
+ # @param resource_name [String] Resource identifier
381
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
382
+ # will be added to the HTTP request.
383
+ #
384
+ # @return [ApplyUpdate] operation results.
385
+ #
386
+ def create_or_update(resource_group_name, provider_name, resource_type, resource_name, custom_headers:nil)
387
+ response = create_or_update_async(resource_group_name, provider_name, resource_type, resource_name, custom_headers:custom_headers).value!
388
+ response.body unless response.nil?
389
+ end
390
+
391
+ #
392
+ # Apply Updates to resource
393
+ #
394
+ # Apply maintenance updates to resource
395
+ #
396
+ # @param resource_group_name [String] Resource group name
397
+ # @param provider_name [String] Resource provider name
398
+ # @param resource_type [String] Resource type
399
+ # @param resource_name [String] Resource identifier
400
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
401
+ # will be added to the HTTP request.
402
+ #
403
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
404
+ #
405
+ def create_or_update_with_http_info(resource_group_name, provider_name, resource_type, resource_name, custom_headers:nil)
406
+ create_or_update_async(resource_group_name, provider_name, resource_type, resource_name, custom_headers:custom_headers).value!
407
+ end
408
+
409
+ #
410
+ # Apply Updates to resource
411
+ #
412
+ # Apply maintenance updates to resource
413
+ #
414
+ # @param resource_group_name [String] Resource group name
415
+ # @param provider_name [String] Resource provider name
416
+ # @param resource_type [String] Resource type
417
+ # @param resource_name [String] Resource identifier
418
+ # @param [Hash{String => String}] A hash of custom headers that will be added
419
+ # to the HTTP request.
420
+ #
421
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
422
+ #
423
+ def create_or_update_async(resource_group_name, provider_name, resource_type, resource_name, custom_headers:nil)
424
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
425
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
426
+ fail ArgumentError, 'provider_name is nil' if provider_name.nil?
427
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
428
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
429
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
430
+
431
+
432
+ request_headers = {}
433
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
434
+
435
+ # Set Headers
436
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
437
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
438
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default'
439
+
440
+ request_url = @base_url || @client.base_url
441
+
442
+ options = {
443
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
444
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => provider_name,'resourceType' => resource_type,'resourceName' => resource_name},
445
+ query_params: {'api-version' => @client.api_version},
446
+ headers: request_headers.merge(custom_headers || {}),
447
+ base_url: request_url
448
+ }
449
+ promise = @client.make_request_async(:put, path_template, options)
450
+
451
+ promise = promise.then do |result|
452
+ http_response = result.response
453
+ status_code = http_response.status
454
+ response_content = http_response.body
455
+ unless status_code == 200
456
+ error_model = JSON.load(response_content)
457
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
458
+ end
459
+
460
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
461
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
462
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
463
+ # Deserialize Response
464
+ if status_code == 200
465
+ begin
466
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
467
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ApplyUpdate.mapper()
468
+ result.body = @client.deserialize(result_mapper, parsed_response)
469
+ rescue Exception => e
470
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
471
+ end
472
+ end
473
+
474
+ result
475
+ end
476
+
477
+ promise.execute
478
+ end
479
+
480
+ end
481
+ end