azure_mgmt_resources 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_resources.gemspec +4 -4
  3. data/lib/azure_mgmt_resources.rb +3 -73
  4. data/lib/generated/azure_mgmt_resources.rb +77 -0
  5. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/deployment_operations.rb +39 -15
  6. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/deployments.rb +113 -60
  7. data/lib/generated/azure_mgmt_resources/models/alias_path_type.rb +61 -0
  8. data/lib/generated/azure_mgmt_resources/models/alias_type.rb +62 -0
  9. data/lib/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
  10. data/lib/generated/azure_mgmt_resources/models/debug_setting.rb +44 -0
  11. data/lib/generated/azure_mgmt_resources/models/dependency.rb +82 -0
  12. data/lib/generated/azure_mgmt_resources/models/deployment.rb +45 -0
  13. data/lib/generated/azure_mgmt_resources/models/deployment_export_result.rb +44 -0
  14. data/lib/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
  15. data/lib/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
  16. data/lib/generated/azure_mgmt_resources/models/deployment_list_result.rb +93 -0
  17. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/models/deployment_mode.rb +0 -0
  18. data/lib/generated/azure_mgmt_resources/models/deployment_operation.rb +65 -0
  19. data/lib/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +117 -0
  20. data/lib/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +93 -0
  21. data/lib/generated/azure_mgmt_resources/models/deployment_properties.rb +103 -0
  22. data/lib/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +179 -0
  23. data/lib/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
  24. data/lib/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
  25. data/lib/generated/azure_mgmt_resources/models/generic_resource.rb +142 -0
  26. data/lib/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
  27. data/lib/generated/azure_mgmt_resources/models/http_message.rb +44 -0
  28. data/lib/generated/azure_mgmt_resources/models/identity.rb +68 -0
  29. data/lib/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
  30. data/lib/generated/azure_mgmt_resources/models/plan.rb +74 -0
  31. data/lib/generated/azure_mgmt_resources/models/provider.rb +83 -0
  32. data/lib/generated/azure_mgmt_resources/models/provider_list_result.rb +93 -0
  33. data/lib/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
  34. data/lib/generated/azure_mgmt_resources/models/resource_group.rb +97 -0
  35. data/lib/generated/azure_mgmt_resources/models/resource_group_export_result.rb +55 -0
  36. data/lib/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
  37. data/lib/generated/azure_mgmt_resources/models/resource_group_list_result.rb +93 -0
  38. data/lib/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
  39. data/lib/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
  40. data/lib/generated/azure_mgmt_resources/models/resource_list_result.rb +93 -0
  41. data/lib/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +82 -0
  42. data/lib/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
  43. data/lib/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
  44. data/lib/generated/azure_mgmt_resources/models/sku.rb +94 -0
  45. data/lib/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
  46. data/lib/generated/azure_mgmt_resources/models/tag_details.rb +83 -0
  47. data/lib/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
  48. data/lib/generated/azure_mgmt_resources/models/tags_list_result.rb +93 -0
  49. data/lib/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
  50. data/lib/generated/azure_mgmt_resources/models/template_link.rb +55 -0
  51. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/module_definition.rb +0 -0
  52. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/providers.rb +70 -34
  53. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/resource_groups.rb +136 -68
  54. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/resource_management_client.rb +8 -12
  55. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/resources.rb +88 -43
  56. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/tags.rb +46 -27
  57. data/lib/{azure_mgmt_resources → generated/azure_mgmt_resources}/version.rb +1 -1
  58. metadata +76 -78
  59. data/lib/azure_mgmt_resources/models/basic_dependency.rb +0 -74
  60. data/lib/azure_mgmt_resources/models/debug_setting.rb +0 -56
  61. data/lib/azure_mgmt_resources/models/dependency.rb +0 -103
  62. data/lib/azure_mgmt_resources/models/deployment.rb +0 -62
  63. data/lib/azure_mgmt_resources/models/deployment_export_result.rb +0 -56
  64. data/lib/azure_mgmt_resources/models/deployment_extended.rb +0 -82
  65. data/lib/azure_mgmt_resources/models/deployment_extended_filter.rb +0 -56
  66. data/lib/azure_mgmt_resources/models/deployment_list_result.rb +0 -86
  67. data/lib/azure_mgmt_resources/models/deployment_operation.rb +0 -81
  68. data/lib/azure_mgmt_resources/models/deployment_operation_properties.rb +0 -141
  69. data/lib/azure_mgmt_resources/models/deployment_operations_list_result.rb +0 -86
  70. data/lib/azure_mgmt_resources/models/deployment_properties.rb +0 -131
  71. data/lib/azure_mgmt_resources/models/deployment_properties_extended.rb +0 -231
  72. data/lib/azure_mgmt_resources/models/deployment_validate_result.rb +0 -80
  73. data/lib/azure_mgmt_resources/models/export_template_request.rb +0 -69
  74. data/lib/azure_mgmt_resources/models/generic_resource.rb +0 -101
  75. data/lib/azure_mgmt_resources/models/generic_resource_filter.rb +0 -74
  76. data/lib/azure_mgmt_resources/models/http_message.rb +0 -56
  77. data/lib/azure_mgmt_resources/models/parameters_link.rb +0 -66
  78. data/lib/azure_mgmt_resources/models/plan.rb +0 -83
  79. data/lib/azure_mgmt_resources/models/provider.rb +0 -104
  80. data/lib/azure_mgmt_resources/models/provider_list_result.rb +0 -85
  81. data/lib/azure_mgmt_resources/models/provider_resource_type.rb +0 -86
  82. data/lib/azure_mgmt_resources/models/resource_group.rb +0 -104
  83. data/lib/azure_mgmt_resources/models/resource_group_export_result.rb +0 -71
  84. data/lib/azure_mgmt_resources/models/resource_group_filter.rb +0 -65
  85. data/lib/azure_mgmt_resources/models/resource_group_list_result.rb +0 -87
  86. data/lib/azure_mgmt_resources/models/resource_group_properties.rb +0 -56
  87. data/lib/azure_mgmt_resources/models/resource_list_result.rb +0 -87
  88. data/lib/azure_mgmt_resources/models/resource_management_error_with_details.rb +0 -107
  89. data/lib/azure_mgmt_resources/models/resource_provider_operation_definition.rb +0 -72
  90. data/lib/azure_mgmt_resources/models/resource_provider_operation_detail_list_result.rb +0 -78
  91. data/lib/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +0 -93
  92. data/lib/azure_mgmt_resources/models/resources_move_info.rb +0 -65
  93. data/lib/azure_mgmt_resources/models/tag_count.rb +0 -65
  94. data/lib/azure_mgmt_resources/models/tag_details.rb +0 -110
  95. data/lib/azure_mgmt_resources/models/tag_value.rb +0 -80
  96. data/lib/azure_mgmt_resources/models/tags_list_result.rb +0 -86
  97. data/lib/azure_mgmt_resources/models/target_resource.rb +0 -74
  98. data/lib/azure_mgmt_resources/models/template_link.rb +0 -66
  99. data/lib/azure_mgmt_resources/resource_provider_operation_details.rb +0 -233
@@ -28,16 +28,43 @@ module Azure::ARM::Resources
28
28
  # @param resource_group_name [String] Query parameters. If null is passed
29
29
  # returns all resource groups.
30
30
  # @param filter [String] The filter to apply on the operation.
31
+ # @param expand [String] The $expand query parameter
31
32
  # @param top [Integer] Query parameters. If null is passed returns all
32
33
  # resource groups.
33
34
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
35
  # will be added to the HTTP request.
35
36
  #
36
- # @return [ResourceListResult] operation results.
37
+ # @return [ResourceListResult] which provide lazy access to pages of the
38
+ # response.
37
39
  #
38
- def list_resources(resource_group_name, filter = nil, top = nil, custom_headers = nil)
39
- response = list_resources_async(resource_group_name, filter, top, custom_headers).value!
40
- response.body unless response.nil?
40
+ def list_resources_as_lazy(resource_group_name, filter = nil, expand = nil, top = nil, custom_headers = nil)
41
+ response = list_resources_async(resource_group_name, filter, expand, top, custom_headers).value!
42
+ unless response.nil?
43
+ page = response.body
44
+ page.next_method = Proc.new do |next_link|
45
+ list_resources_next_async(next_link, custom_headers)
46
+ end
47
+ page
48
+ end
49
+ end
50
+
51
+ #
52
+ # Get all of the resources under a subscription.
53
+ #
54
+ # @param resource_group_name [String] Query parameters. If null is passed
55
+ # returns all resource groups.
56
+ # @param filter [String] The filter to apply on the operation.
57
+ # @param expand [String] The $expand query parameter
58
+ # @param top [Integer] Query parameters. If null is passed returns all
59
+ # resource groups.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [Array<GenericResource>] operation results.
64
+ #
65
+ def list_resources(resource_group_name, filter = nil, expand = nil, top = nil, custom_headers = nil)
66
+ first_page = list_resources_as_lazy(resource_group_name, filter, expand, top, custom_headers)
67
+ first_page.get_all_items
41
68
  end
42
69
 
43
70
  #
@@ -46,6 +73,7 @@ module Azure::ARM::Resources
46
73
  # @param resource_group_name [String] Query parameters. If null is passed
47
74
  # returns all resource groups.
48
75
  # @param filter [String] The filter to apply on the operation.
76
+ # @param expand [String] The $expand query parameter
49
77
  # @param top [Integer] Query parameters. If null is passed returns all
50
78
  # resource groups.
51
79
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -53,8 +81,8 @@ module Azure::ARM::Resources
53
81
  #
54
82
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
83
  #
56
- def list_resources_with_http_info(resource_group_name, filter = nil, top = nil, custom_headers = nil)
57
- list_resources_async(resource_group_name, filter, top, custom_headers).value!
84
+ def list_resources_with_http_info(resource_group_name, filter = nil, expand = nil, top = nil, custom_headers = nil)
85
+ list_resources_async(resource_group_name, filter, expand, top, custom_headers).value!
58
86
  end
59
87
 
60
88
  #
@@ -63,6 +91,7 @@ module Azure::ARM::Resources
63
91
  # @param resource_group_name [String] Query parameters. If null is passed
64
92
  # returns all resource groups.
65
93
  # @param filter [String] The filter to apply on the operation.
94
+ # @param expand [String] The $expand query parameter
66
95
  # @param top [Integer] Query parameters. If null is passed returns all
67
96
  # resource groups.
68
97
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -70,10 +99,12 @@ module Azure::ARM::Resources
70
99
  #
71
100
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
72
101
  #
73
- def list_resources_async(resource_group_name, filter = nil, top = nil, custom_headers = nil)
102
+ def list_resources_async(resource_group_name, filter = nil, expand = nil, top = nil, custom_headers = nil)
74
103
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
104
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
76
105
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
106
+
107
+
77
108
  request_headers = {}
78
109
 
79
110
  # Set Headers
@@ -83,7 +114,7 @@ module Azure::ARM::Resources
83
114
  options = {
84
115
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
116
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
86
- query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
117
+ query_params: {'$filter' => filter,'$expand' => expand,'$top' => top,'api-version' => @client.api_version},
87
118
  headers: request_headers.merge(custom_headers || {})
88
119
  }
89
120
 
@@ -109,10 +140,8 @@ module Azure::ARM::Resources
109
140
  if status_code == 200
110
141
  begin
111
142
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
- unless parsed_response.nil?
113
- parsed_response = ResourceListResult.deserialize_object(parsed_response)
114
- end
115
- result.body = parsed_response
143
+ result_mapper = ResourceListResult.mapper()
144
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
116
145
  rescue Exception => e
117
146
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
147
  end
@@ -167,6 +196,8 @@ module Azure::ARM::Resources
167
196
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
168
197
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
169
198
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
199
+
200
+
170
201
  request_headers = {}
171
202
 
172
203
  # Set Headers
@@ -254,21 +285,23 @@ module Azure::ARM::Resources
254
285
  def create_or_update_async(resource_group_name, parameters, custom_headers = nil)
255
286
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
256
287
  fail ArgumentError, 'parameters is nil' if parameters.nil?
257
- parameters.validate unless parameters.nil?
258
288
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
259
289
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
290
+
291
+
260
292
  request_headers = {}
261
293
 
262
294
  # Set Headers
263
295
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
264
296
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
265
297
 
266
- # Serialize Request
267
298
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
268
- unless parameters.nil?
269
- parameters = ResourceGroup.serialize_object(parameters)
270
- end
271
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
299
+
300
+ # Serialize Request
301
+ request_mapper = ResourceGroup.mapper()
302
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
303
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
304
+
272
305
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
273
306
  options = {
274
307
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -300,10 +333,8 @@ module Azure::ARM::Resources
300
333
  if status_code == 201
301
334
  begin
302
335
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
303
- unless parsed_response.nil?
304
- parsed_response = ResourceGroup.deserialize_object(parsed_response)
305
- end
306
- result.body = parsed_response
336
+ result_mapper = ResourceGroup.mapper()
337
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
307
338
  rescue Exception => e
308
339
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
309
340
  end
@@ -312,10 +343,8 @@ module Azure::ARM::Resources
312
343
  if status_code == 200
313
344
  begin
314
345
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
315
- unless parsed_response.nil?
316
- parsed_response = ResourceGroup.deserialize_object(parsed_response)
317
- end
318
- result.body = parsed_response
346
+ result_mapper = ResourceGroup.mapper()
347
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
319
348
  rescue Exception => e
320
349
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
321
350
  end
@@ -332,10 +361,24 @@ module Azure::ARM::Resources
332
361
  #
333
362
  # @param resource_group_name [String] The name of the resource group to be
334
363
  # deleted. The name is case insensitive.
364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
365
+ # will be added to the HTTP request.
366
+ #
367
+ def delete(resource_group_name, custom_headers = nil)
368
+ response = delete_async(resource_group_name, custom_headers).value!
369
+ nil
370
+ end
371
+
372
+ #
373
+ # @param resource_group_name [String] The name of the resource group to be
374
+ # deleted. The name is case insensitive.
375
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
376
+ # will be added to the HTTP request.
377
+ #
335
378
  # @return [Concurrent::Promise] promise which provides async access to http
336
379
  # response.
337
380
  #
338
- def delete(resource_group_name, custom_headers = nil)
381
+ def delete_async(resource_group_name, custom_headers = nil)
339
382
  # Send request
340
383
  promise = begin_delete_async(resource_group_name, custom_headers)
341
384
 
@@ -344,8 +387,8 @@ module Azure::ARM::Resources
344
387
  deserialize_method = lambda do |parsed_response|
345
388
  end
346
389
 
347
- # Waiting for response.
348
- @client.get_long_running_operation_result(response, deserialize_method)
390
+ # Waiting for response.
391
+ @client.get_long_running_operation_result(response, deserialize_method)
349
392
  end
350
393
 
351
394
  promise
@@ -393,6 +436,8 @@ module Azure::ARM::Resources
393
436
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
394
437
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
395
438
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
439
+
440
+
396
441
  request_headers = {}
397
442
 
398
443
  # Set Headers
@@ -474,6 +519,8 @@ module Azure::ARM::Resources
474
519
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
475
520
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
476
521
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
522
+
523
+
477
524
  request_headers = {}
478
525
 
479
526
  # Set Headers
@@ -509,10 +556,8 @@ module Azure::ARM::Resources
509
556
  if status_code == 200
510
557
  begin
511
558
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
512
- unless parsed_response.nil?
513
- parsed_response = ResourceGroup.deserialize_object(parsed_response)
514
- end
515
- result.body = parsed_response
559
+ result_mapper = ResourceGroup.mapper()
560
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
516
561
  rescue Exception => e
517
562
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
518
563
  end
@@ -581,21 +626,23 @@ module Azure::ARM::Resources
581
626
  def patch_async(resource_group_name, parameters, custom_headers = nil)
582
627
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
583
628
  fail ArgumentError, 'parameters is nil' if parameters.nil?
584
- parameters.validate unless parameters.nil?
585
629
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
586
630
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
631
+
632
+
587
633
  request_headers = {}
588
634
 
589
635
  # Set Headers
590
636
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
591
637
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
592
638
 
593
- # Serialize Request
594
639
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
595
- unless parameters.nil?
596
- parameters = ResourceGroup.serialize_object(parameters)
597
- end
598
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
640
+
641
+ # Serialize Request
642
+ request_mapper = ResourceGroup.mapper()
643
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
644
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
645
+
599
646
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
600
647
  options = {
601
648
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -627,10 +674,8 @@ module Azure::ARM::Resources
627
674
  if status_code == 200
628
675
  begin
629
676
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
630
- unless parsed_response.nil?
631
- parsed_response = ResourceGroup.deserialize_object(parsed_response)
632
- end
633
- result.body = parsed_response
677
+ result_mapper = ResourceGroup.mapper()
678
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
634
679
  rescue Exception => e
635
680
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
636
681
  end
@@ -690,21 +735,23 @@ module Azure::ARM::Resources
690
735
  def export_template_async(resource_group_name, parameters, custom_headers = nil)
691
736
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
692
737
  fail ArgumentError, 'parameters is nil' if parameters.nil?
693
- parameters.validate unless parameters.nil?
694
738
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
695
739
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
740
+
741
+
696
742
  request_headers = {}
697
743
 
698
744
  # Set Headers
699
745
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
700
746
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
701
747
 
702
- # Serialize Request
703
748
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
704
- unless parameters.nil?
705
- parameters = ExportTemplateRequest.serialize_object(parameters)
706
- end
707
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
749
+
750
+ # Serialize Request
751
+ request_mapper = ExportTemplateRequest.mapper()
752
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
753
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
754
+
708
755
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate'
709
756
  options = {
710
757
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -736,10 +783,8 @@ module Azure::ARM::Resources
736
783
  if status_code == 200
737
784
  begin
738
785
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
739
- unless parsed_response.nil?
740
- parsed_response = ResourceGroupExportResult.deserialize_object(parsed_response)
741
- end
742
- result.body = parsed_response
786
+ result_mapper = ResourceGroupExportResult.mapper()
787
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
743
788
  rescue Exception => e
744
789
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
745
790
  end
@@ -760,11 +805,34 @@ module Azure::ARM::Resources
760
805
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
761
806
  # will be added to the HTTP request.
762
807
  #
763
- # @return [ResourceGroupListResult] operation results.
808
+ # @return [ResourceGroupListResult] which provide lazy access to pages of the
809
+ # response.
764
810
  #
765
- def list(filter = nil, top = nil, custom_headers = nil)
811
+ def list_as_lazy(filter = nil, top = nil, custom_headers = nil)
766
812
  response = list_async(filter, top, custom_headers).value!
767
- response.body unless response.nil?
813
+ unless response.nil?
814
+ page = response.body
815
+ page.next_method = Proc.new do |next_link|
816
+ list_next_async(next_link, custom_headers)
817
+ end
818
+ page
819
+ end
820
+ end
821
+
822
+ #
823
+ # Gets a collection of resource groups.
824
+ #
825
+ # @param filter [String] The filter to apply on the operation.
826
+ # @param top [Integer] Query parameters. If null is passed returns all
827
+ # resource groups.
828
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
829
+ # will be added to the HTTP request.
830
+ #
831
+ # @return [Array<ResourceGroup>] operation results.
832
+ #
833
+ def list(filter = nil, top = nil, custom_headers = nil)
834
+ first_page = list_as_lazy(filter, top, custom_headers)
835
+ first_page.get_all_items
768
836
  end
769
837
 
770
838
  #
@@ -796,6 +864,8 @@ module Azure::ARM::Resources
796
864
  def list_async(filter = nil, top = nil, custom_headers = nil)
797
865
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
798
866
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
867
+
868
+
799
869
  request_headers = {}
800
870
 
801
871
  # Set Headers
@@ -831,10 +901,8 @@ module Azure::ARM::Resources
831
901
  if status_code == 200
832
902
  begin
833
903
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
834
- unless parsed_response.nil?
835
- parsed_response = ResourceGroupListResult.deserialize_object(parsed_response)
836
- end
837
- result.body = parsed_response
904
+ result_mapper = ResourceGroupListResult.mapper()
905
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
838
906
  rescue Exception => e
839
907
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
840
908
  end
@@ -887,6 +955,8 @@ module Azure::ARM::Resources
887
955
  #
888
956
  def list_resources_next_async(next_page_link, custom_headers = nil)
889
957
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
958
+
959
+
890
960
  request_headers = {}
891
961
 
892
962
  # Set Headers
@@ -921,10 +991,8 @@ module Azure::ARM::Resources
921
991
  if status_code == 200
922
992
  begin
923
993
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
924
- unless parsed_response.nil?
925
- parsed_response = ResourceListResult.deserialize_object(parsed_response)
926
- end
927
- result.body = parsed_response
994
+ result_mapper = ResourceListResult.mapper()
995
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
928
996
  rescue Exception => e
929
997
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
930
998
  end
@@ -977,6 +1045,8 @@ module Azure::ARM::Resources
977
1045
  #
978
1046
  def list_next_async(next_page_link, custom_headers = nil)
979
1047
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1048
+
1049
+
980
1050
  request_headers = {}
981
1051
 
982
1052
  # Set Headers
@@ -1011,10 +1081,8 @@ module Azure::ARM::Resources
1011
1081
  if status_code == 200
1012
1082
  begin
1013
1083
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1014
- unless parsed_response.nil?
1015
- parsed_response = ResourceGroupListResult.deserialize_object(parsed_response)
1016
- end
1017
- result.body = parsed_response
1084
+ result_mapper = ResourceGroupListResult.mapper()
1085
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1018
1086
  rescue Exception => e
1019
1087
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1020
1088
  end
@@ -8,13 +8,13 @@ module Azure::ARM::Resources
8
8
  # A service client - single point of access to the REST API.
9
9
  #
10
10
  class ResourceManagementClient < MsRestAzure::AzureServiceClient
11
- include Azure::ARM::Resources::Models
11
+ include MsRest::Serialization
12
12
  include MsRestAzure
13
13
 
14
14
  # @return [String] the base URI of the service.
15
15
  attr_accessor :base_url
16
16
 
17
- # @return Gets Azure subscription credentials.
17
+ # @return Credentials needed for the client to connect to Azure.
18
18
  attr_reader :credentials
19
19
 
20
20
  # @return [String] Gets subscription credentials which uniquely identify
@@ -40,27 +40,24 @@ module Azure::ARM::Resources
40
40
  # subscription.
41
41
  attr_accessor :credentials
42
42
 
43
- # @return deployments
43
+ # @return [Deployments] deployments
44
44
  attr_reader :deployments
45
45
 
46
- # @return providers
46
+ # @return [Providers] providers
47
47
  attr_reader :providers
48
48
 
49
- # @return resource_groups
49
+ # @return [ResourceGroups] resource_groups
50
50
  attr_reader :resource_groups
51
51
 
52
- # @return resources
52
+ # @return [Resources] resources
53
53
  attr_reader :resources
54
54
 
55
- # @return tags
55
+ # @return [Tags] tags
56
56
  attr_reader :tags
57
57
 
58
- # @return deployment_operations
58
+ # @return [DeploymentOperations] deployment_operations
59
59
  attr_reader :deployment_operations
60
60
 
61
- # @return resource_provider_operation_details
62
- attr_reader :resource_provider_operation_details
63
-
64
61
  #
65
62
  # Creates initializes a new instance of the ResourceManagementClient class.
66
63
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
@@ -81,7 +78,6 @@ module Azure::ARM::Resources
81
78
  @resources = Resources.new(self)
82
79
  @tags = Tags.new(self)
83
80
  @deployment_operations = DeploymentOperations.new(self)
84
- @resource_provider_operation_details = ResourceProviderOperationDetails.new(self)
85
81
  @api_version = '2016-02-01'
86
82
  @accept_language = 'en-US'
87
83
  @long_running_operation_retry_timeout = 30