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,509 @@
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 MaintenanceConfigurations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the MaintenanceConfigurations 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
+ # Get Configuration record
26
+ #
27
+ # @param resource_group_name [String] Resource Group Name
28
+ # @param resource_name [String] Resource Identifier
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [MaintenanceConfiguration] operation results.
33
+ #
34
+ def get(resource_group_name, resource_name, custom_headers:nil)
35
+ response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Get Configuration record
41
+ #
42
+ # @param resource_group_name [String] Resource Group Name
43
+ # @param resource_name [String] Resource Identifier
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
50
+ get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Get Configuration record
55
+ #
56
+ # @param resource_group_name [String] Resource Group Name
57
+ # @param resource_name [String] Resource Identifier
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def get_async(resource_group_name, resource_name, custom_headers:nil)
64
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
65
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
66
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+
69
+
70
+ request_headers = {}
71
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
72
+
73
+ # Set Headers
74
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}'
77
+
78
+ request_url = @base_url || @client.base_url
79
+
80
+ options = {
81
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
82
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
83
+ query_params: {'api-version' => @client.api_version},
84
+ headers: request_headers.merge(custom_headers || {}),
85
+ base_url: request_url
86
+ }
87
+ promise = @client.make_request_async(:get, path_template, options)
88
+
89
+ promise = promise.then do |result|
90
+ http_response = result.response
91
+ status_code = http_response.status
92
+ response_content = http_response.body
93
+ unless status_code == 200
94
+ error_model = JSON.load(response_content)
95
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
96
+ end
97
+
98
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
99
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
100
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
101
+ # Deserialize Response
102
+ if status_code == 200
103
+ begin
104
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::MaintenanceConfiguration.mapper()
106
+ result.body = @client.deserialize(result_mapper, parsed_response)
107
+ rescue Exception => e
108
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
+ end
110
+ end
111
+
112
+ result
113
+ end
114
+
115
+ promise.execute
116
+ end
117
+
118
+ #
119
+ # Create or Update configuration record
120
+ #
121
+ # @param resource_group_name [String] Resource Group Name
122
+ # @param resource_name [String] Resource Identifier
123
+ # @param configuration [MaintenanceConfiguration] The configuration
124
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
125
+ # will be added to the HTTP request.
126
+ #
127
+ # @return [MaintenanceConfiguration] operation results.
128
+ #
129
+ def create_or_update(resource_group_name, resource_name, configuration, custom_headers:nil)
130
+ response = create_or_update_async(resource_group_name, resource_name, configuration, custom_headers:custom_headers).value!
131
+ response.body unless response.nil?
132
+ end
133
+
134
+ #
135
+ # Create or Update configuration record
136
+ #
137
+ # @param resource_group_name [String] Resource Group Name
138
+ # @param resource_name [String] Resource Identifier
139
+ # @param configuration [MaintenanceConfiguration] The configuration
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
144
+ #
145
+ def create_or_update_with_http_info(resource_group_name, resource_name, configuration, custom_headers:nil)
146
+ create_or_update_async(resource_group_name, resource_name, configuration, custom_headers:custom_headers).value!
147
+ end
148
+
149
+ #
150
+ # Create or Update configuration record
151
+ #
152
+ # @param resource_group_name [String] Resource Group Name
153
+ # @param resource_name [String] Resource Identifier
154
+ # @param configuration [MaintenanceConfiguration] The configuration
155
+ # @param [Hash{String => String}] A hash of custom headers that will be added
156
+ # to the HTTP request.
157
+ #
158
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
159
+ #
160
+ def create_or_update_async(resource_group_name, resource_name, configuration, custom_headers:nil)
161
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
162
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
163
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
164
+ fail ArgumentError, 'configuration is nil' if configuration.nil?
165
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
166
+
167
+
168
+ request_headers = {}
169
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
170
+
171
+ # Set Headers
172
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
173
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
174
+
175
+ # Serialize Request
176
+ request_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::MaintenanceConfiguration.mapper()
177
+ request_content = @client.serialize(request_mapper, configuration)
178
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
179
+
180
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}'
181
+
182
+ request_url = @base_url || @client.base_url
183
+
184
+ options = {
185
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
186
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
187
+ query_params: {'api-version' => @client.api_version},
188
+ body: request_content,
189
+ headers: request_headers.merge(custom_headers || {}),
190
+ base_url: request_url
191
+ }
192
+ promise = @client.make_request_async(:put, path_template, options)
193
+
194
+ promise = promise.then do |result|
195
+ http_response = result.response
196
+ status_code = http_response.status
197
+ response_content = http_response.body
198
+ unless status_code == 200
199
+ error_model = JSON.load(response_content)
200
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
201
+ end
202
+
203
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
204
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
205
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
206
+ # Deserialize Response
207
+ if status_code == 200
208
+ begin
209
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
210
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::MaintenanceConfiguration.mapper()
211
+ result.body = @client.deserialize(result_mapper, parsed_response)
212
+ rescue Exception => e
213
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
214
+ end
215
+ end
216
+
217
+ result
218
+ end
219
+
220
+ promise.execute
221
+ end
222
+
223
+ #
224
+ # Delete Configuration record
225
+ #
226
+ # @param resource_group_name [String] Resource Group Name
227
+ # @param resource_name [String] Resource Identifier
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [MaintenanceConfiguration] operation results.
232
+ #
233
+ def delete(resource_group_name, resource_name, custom_headers:nil)
234
+ response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
235
+ response.body unless response.nil?
236
+ end
237
+
238
+ #
239
+ # Delete Configuration record
240
+ #
241
+ # @param resource_group_name [String] Resource Group Name
242
+ # @param resource_name [String] Resource Identifier
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
247
+ #
248
+ def delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
249
+ delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
250
+ end
251
+
252
+ #
253
+ # Delete Configuration record
254
+ #
255
+ # @param resource_group_name [String] Resource Group Name
256
+ # @param resource_name [String] Resource Identifier
257
+ # @param [Hash{String => String}] A hash of custom headers that will be added
258
+ # to the HTTP request.
259
+ #
260
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
261
+ #
262
+ def delete_async(resource_group_name, resource_name, custom_headers:nil)
263
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
264
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
265
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
266
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
267
+
268
+
269
+ request_headers = {}
270
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
271
+
272
+ # Set Headers
273
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
274
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
275
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}'
276
+
277
+ request_url = @base_url || @client.base_url
278
+
279
+ options = {
280
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
281
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
282
+ query_params: {'api-version' => @client.api_version},
283
+ headers: request_headers.merge(custom_headers || {}),
284
+ base_url: request_url
285
+ }
286
+ promise = @client.make_request_async(:delete, path_template, options)
287
+
288
+ promise = promise.then do |result|
289
+ http_response = result.response
290
+ status_code = http_response.status
291
+ response_content = http_response.body
292
+ unless status_code == 200
293
+ error_model = JSON.load(response_content)
294
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
295
+ end
296
+
297
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
298
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
299
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
300
+ # Deserialize Response
301
+ if status_code == 200
302
+ begin
303
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
304
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::MaintenanceConfiguration.mapper()
305
+ result.body = @client.deserialize(result_mapper, parsed_response)
306
+ rescue Exception => e
307
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
308
+ end
309
+ end
310
+
311
+ result
312
+ end
313
+
314
+ promise.execute
315
+ end
316
+
317
+ #
318
+ # Patch configuration record
319
+ #
320
+ # @param resource_group_name [String] Resource Group Name
321
+ # @param resource_name [String] Resource Identifier
322
+ # @param configuration [MaintenanceConfiguration] The configuration
323
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
324
+ # will be added to the HTTP request.
325
+ #
326
+ # @return [MaintenanceConfiguration] operation results.
327
+ #
328
+ def update_method(resource_group_name, resource_name, configuration, custom_headers:nil)
329
+ response = update_method_async(resource_group_name, resource_name, configuration, custom_headers:custom_headers).value!
330
+ response.body unless response.nil?
331
+ end
332
+
333
+ #
334
+ # Patch configuration record
335
+ #
336
+ # @param resource_group_name [String] Resource Group Name
337
+ # @param resource_name [String] Resource Identifier
338
+ # @param configuration [MaintenanceConfiguration] The configuration
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
343
+ #
344
+ def update_method_with_http_info(resource_group_name, resource_name, configuration, custom_headers:nil)
345
+ update_method_async(resource_group_name, resource_name, configuration, custom_headers:custom_headers).value!
346
+ end
347
+
348
+ #
349
+ # Patch configuration record
350
+ #
351
+ # @param resource_group_name [String] Resource Group Name
352
+ # @param resource_name [String] Resource Identifier
353
+ # @param configuration [MaintenanceConfiguration] The configuration
354
+ # @param [Hash{String => String}] A hash of custom headers that will be added
355
+ # to the HTTP request.
356
+ #
357
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
358
+ #
359
+ def update_method_async(resource_group_name, resource_name, configuration, custom_headers:nil)
360
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
361
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
362
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
363
+ fail ArgumentError, 'configuration is nil' if configuration.nil?
364
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
365
+
366
+
367
+ request_headers = {}
368
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
369
+
370
+ # Set Headers
371
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
372
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
373
+
374
+ # Serialize Request
375
+ request_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::MaintenanceConfiguration.mapper()
376
+ request_content = @client.serialize(request_mapper, configuration)
377
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
378
+
379
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}'
380
+
381
+ request_url = @base_url || @client.base_url
382
+
383
+ options = {
384
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
385
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
386
+ query_params: {'api-version' => @client.api_version},
387
+ body: request_content,
388
+ headers: request_headers.merge(custom_headers || {}),
389
+ base_url: request_url
390
+ }
391
+ promise = @client.make_request_async(:patch, path_template, options)
392
+
393
+ promise = promise.then do |result|
394
+ http_response = result.response
395
+ status_code = http_response.status
396
+ response_content = http_response.body
397
+ unless status_code == 200
398
+ error_model = JSON.load(response_content)
399
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
400
+ end
401
+
402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
403
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
404
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
405
+ # Deserialize Response
406
+ if status_code == 200
407
+ begin
408
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
409
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::MaintenanceConfiguration.mapper()
410
+ result.body = @client.deserialize(result_mapper, parsed_response)
411
+ rescue Exception => e
412
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
413
+ end
414
+ end
415
+
416
+ result
417
+ end
418
+
419
+ promise.execute
420
+ end
421
+
422
+ #
423
+ # Get Configuration records within a subscription
424
+ #
425
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
426
+ # will be added to the HTTP request.
427
+ #
428
+ # @return [ListMaintenanceConfigurationsResult] operation results.
429
+ #
430
+ def list(custom_headers:nil)
431
+ response = list_async(custom_headers:custom_headers).value!
432
+ response.body unless response.nil?
433
+ end
434
+
435
+ #
436
+ # Get Configuration records within a subscription
437
+ #
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
442
+ #
443
+ def list_with_http_info(custom_headers:nil)
444
+ list_async(custom_headers:custom_headers).value!
445
+ end
446
+
447
+ #
448
+ # Get Configuration records within a subscription
449
+ #
450
+ # @param [Hash{String => String}] A hash of custom headers that will be added
451
+ # to the HTTP request.
452
+ #
453
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
454
+ #
455
+ def list_async(custom_headers:nil)
456
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
457
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
458
+
459
+
460
+ request_headers = {}
461
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
462
+
463
+ # Set Headers
464
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
465
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
466
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/maintenanceConfigurations'
467
+
468
+ request_url = @base_url || @client.base_url
469
+
470
+ options = {
471
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
472
+ path_params: {'subscriptionId' => @client.subscription_id},
473
+ query_params: {'api-version' => @client.api_version},
474
+ headers: request_headers.merge(custom_headers || {}),
475
+ base_url: request_url
476
+ }
477
+ promise = @client.make_request_async(:get, path_template, options)
478
+
479
+ promise = promise.then do |result|
480
+ http_response = result.response
481
+ status_code = http_response.status
482
+ response_content = http_response.body
483
+ unless status_code == 200
484
+ error_model = JSON.load(response_content)
485
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
486
+ end
487
+
488
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
489
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
490
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
491
+ # Deserialize Response
492
+ if status_code == 200
493
+ begin
494
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
495
+ result_mapper = Azure::Maintenance::Mgmt::V2018_06_01_preview::Models::ListMaintenanceConfigurationsResult.mapper()
496
+ result.body = @client.deserialize(result_mapper, parsed_response)
497
+ rescue Exception => e
498
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
499
+ end
500
+ end
501
+
502
+ result
503
+ end
504
+
505
+ promise.execute
506
+ end
507
+
508
+ end
509
+ end