azure_mgmt_resources 0.18.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  3. data/lib/2016-06-01/generated/azure_mgmt_resources/subscription_client.rb +1 -1
  4. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  5. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  6. data/lib/2017-05-10/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  7. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  8. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  9. data/lib/2018-06-01/generated/azure_mgmt_resources/application_client.rb +1 -1
  10. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  11. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  12. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  13. data/lib/2019-07-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  14. data/lib/2019-10-01/generated/azure_mgmt_resources.rb +111 -0
  15. data/lib/2019-10-01/generated/azure_mgmt_resources/deployment_operations.rb +1590 -0
  16. data/lib/2019-10-01/generated/azure_mgmt_resources/deployments.rb +6276 -0
  17. data/lib/2019-10-01/generated/azure_mgmt_resources/models/alias_model.rb +102 -0
  18. data/lib/2019-10-01/generated/azure_mgmt_resources/models/alias_path.rb +77 -0
  19. data/lib/2019-10-01/generated/azure_mgmt_resources/models/alias_pattern.rb +70 -0
  20. data/lib/2019-10-01/generated/azure_mgmt_resources/models/alias_pattern_type.rb +16 -0
  21. data/lib/2019-10-01/generated/azure_mgmt_resources/models/alias_type.rb +17 -0
  22. data/lib/2019-10-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  23. data/lib/2019-10-01/generated/azure_mgmt_resources/models/change_type.rb +20 -0
  24. data/lib/2019-10-01/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  25. data/lib/2019-10-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  26. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment.rb +77 -0
  27. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  28. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_extended.rb +113 -0
  29. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  30. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  31. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  32. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  33. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +162 -0
  34. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  35. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  36. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +284 -0
  37. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +61 -0
  38. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_what_if.rb +58 -0
  39. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_what_if_properties.rb +108 -0
  40. data/lib/2019-10-01/generated/azure_mgmt_resources/models/deployment_what_if_settings.rb +48 -0
  41. data/lib/2019-10-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  42. data/lib/2019-10-01/generated/azure_mgmt_resources/models/error_response.rb +117 -0
  43. data/lib/2019-10-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  44. data/lib/2019-10-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  45. data/lib/2019-10-01/generated/azure_mgmt_resources/models/generic_resource_expanded.rb +179 -0
  46. data/lib/2019-10-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  47. data/lib/2019-10-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  48. data/lib/2019-10-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  49. data/lib/2019-10-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  50. data/lib/2019-10-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  51. data/lib/2019-10-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  52. data/lib/2019-10-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  53. data/lib/2019-10-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  54. data/lib/2019-10-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  55. data/lib/2019-10-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  56. data/lib/2019-10-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  57. data/lib/2019-10-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  58. data/lib/2019-10-01/generated/azure_mgmt_resources/models/property_change_type.rb +18 -0
  59. data/lib/2019-10-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  60. data/lib/2019-10-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  61. data/lib/2019-10-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  62. data/lib/2019-10-01/generated/azure_mgmt_resources/models/provisioning_operation.rb +24 -0
  63. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  64. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  65. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  66. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  67. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  68. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  69. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  70. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  71. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  72. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  73. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resource_reference.rb +47 -0
  74. data/lib/2019-10-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  75. data/lib/2019-10-01/generated/azure_mgmt_resources/models/scoped_deployment.rb +77 -0
  76. data/lib/2019-10-01/generated/azure_mgmt_resources/models/scoped_deployment_what_if.rb +58 -0
  77. data/lib/2019-10-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  78. data/lib/2019-10-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  79. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  80. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  81. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  82. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tags.rb +54 -0
  83. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  84. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tags_patch_operation.rb +17 -0
  85. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tags_patch_resource.rb +59 -0
  86. data/lib/2019-10-01/generated/azure_mgmt_resources/models/tags_resource.rb +83 -0
  87. data/lib/2019-10-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  88. data/lib/2019-10-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  89. data/lib/2019-10-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  90. data/lib/2019-10-01/generated/azure_mgmt_resources/models/what_if_change.rb +105 -0
  91. data/lib/2019-10-01/generated/azure_mgmt_resources/models/what_if_operation_result.rb +80 -0
  92. data/lib/2019-10-01/generated/azure_mgmt_resources/models/what_if_property_change.rb +101 -0
  93. data/lib/2019-10-01/generated/azure_mgmt_resources/models/what_if_result_format.rb +16 -0
  94. data/lib/2019-10-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  95. data/lib/2019-10-01/generated/azure_mgmt_resources/operations.rb +219 -0
  96. data/lib/2019-10-01/generated/azure_mgmt_resources/providers.rb +846 -0
  97. data/lib/2019-10-01/generated/azure_mgmt_resources/resource_groups.rb +964 -0
  98. data/lib/2019-10-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  99. data/lib/2019-10-01/generated/azure_mgmt_resources/resources.rb +2354 -0
  100. data/lib/2019-10-01/generated/azure_mgmt_resources/tags_operations.rb +1078 -0
  101. data/lib/2020-06-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  102. data/lib/azure_mgmt_resources.rb +10 -9
  103. data/lib/version.rb +1 -1
  104. metadata +90 -3
@@ -0,0 +1,16 @@
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::Resources::Mgmt::V2019_10_01
7
+ module Models
8
+ #
9
+ # Defines values for WhatIfResultFormat
10
+ #
11
+ module WhatIfResultFormat
12
+ ResourceIdOnly = "ResourceIdOnly"
13
+ FullResourcePayloads = "FullResourcePayloads"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::Resources end
8
+ module Azure::Resources::Mgmt end
9
+ module Azure::Resources::Mgmt::V2019_10_01 end
@@ -0,0 +1,219 @@
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::Resources::Mgmt::V2019_10_01
7
+ #
8
+ # Provides operations for working with resources and resource groups.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceManagementClient] reference to the ResourceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the available Microsoft.Resources REST API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all of the available Microsoft.Resources REST API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available Microsoft.Resources REST API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.Resources/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::OperationListResult.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ #
109
+ # Lists all of the available Microsoft.Resources REST API operations.
110
+ #
111
+ # @param next_page_link [String] The NextLink from the previous successful call
112
+ # to List operation.
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ # @return [OperationListResult] operation results.
117
+ #
118
+ def list_next(next_page_link, custom_headers:nil)
119
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
120
+ response.body unless response.nil?
121
+ end
122
+
123
+ #
124
+ # Lists all of the available Microsoft.Resources REST API operations.
125
+ #
126
+ # @param next_page_link [String] The NextLink from the previous successful call
127
+ # to List operation.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
134
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Lists all of the available Microsoft.Resources REST API operations.
139
+ #
140
+ # @param next_page_link [String] The NextLink from the previous successful call
141
+ # to List operation.
142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
143
+ # to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def list_next_async(next_page_link, custom_headers:nil)
148
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
149
+
150
+
151
+ request_headers = {}
152
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
153
+
154
+ # Set Headers
155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
+ path_template = '{nextLink}'
158
+
159
+ request_url = @base_url || @client.base_url
160
+
161
+ options = {
162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
163
+ skip_encoding_path_params: {'nextLink' => next_page_link},
164
+ headers: request_headers.merge(custom_headers || {}),
165
+ base_url: request_url
166
+ }
167
+ promise = @client.make_request_async(:get, path_template, options)
168
+
169
+ promise = promise.then do |result|
170
+ http_response = result.response
171
+ status_code = http_response.status
172
+ response_content = http_response.body
173
+ unless status_code == 200
174
+ error_model = JSON.load(response_content)
175
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
176
+ end
177
+
178
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
179
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
180
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
181
+ # Deserialize Response
182
+ if status_code == 200
183
+ begin
184
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
185
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::OperationListResult.mapper()
186
+ result.body = @client.deserialize(result_mapper, parsed_response)
187
+ rescue Exception => e
188
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
189
+ end
190
+ end
191
+
192
+ result
193
+ end
194
+
195
+ promise.execute
196
+ end
197
+
198
+ #
199
+ # Lists all of the available Microsoft.Resources REST API operations.
200
+ #
201
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
202
+ # will be added to the HTTP request.
203
+ #
204
+ # @return [OperationListResult] which provide lazy access to pages of the
205
+ # response.
206
+ #
207
+ def list_as_lazy(custom_headers:nil)
208
+ response = list_async(custom_headers:custom_headers).value!
209
+ unless response.nil?
210
+ page = response.body
211
+ page.next_method = Proc.new do |next_page_link|
212
+ list_next_async(next_page_link, custom_headers:custom_headers)
213
+ end
214
+ page
215
+ end
216
+ end
217
+
218
+ end
219
+ end
@@ -0,0 +1,846 @@
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::Resources::Mgmt::V2019_10_01
7
+ #
8
+ # Provides operations for working with resources and resource groups.
9
+ #
10
+ class Providers
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Providers class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceManagementClient] reference to the ResourceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Unregisters a subscription from a resource provider.
26
+ #
27
+ # @param resource_provider_namespace [String] The namespace of the resource
28
+ # provider to unregister.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Provider] operation results.
33
+ #
34
+ def unregister(resource_provider_namespace, custom_headers:nil)
35
+ response = unregister_async(resource_provider_namespace, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Unregisters a subscription from a resource provider.
41
+ #
42
+ # @param resource_provider_namespace [String] The namespace of the resource
43
+ # provider to unregister.
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 unregister_with_http_info(resource_provider_namespace, custom_headers:nil)
50
+ unregister_async(resource_provider_namespace, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Unregisters a subscription from a resource provider.
55
+ #
56
+ # @param resource_provider_namespace [String] The namespace of the resource
57
+ # provider to unregister.
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 unregister_async(resource_provider_namespace, custom_headers:nil)
64
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
65
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
66
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
67
+
68
+
69
+ request_headers = {}
70
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:post, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
99
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Provider.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Registers a subscription with a resource provider.
119
+ #
120
+ # @param resource_provider_namespace [String] The namespace of the resource
121
+ # provider to register.
122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
123
+ # will be added to the HTTP request.
124
+ #
125
+ # @return [Provider] operation results.
126
+ #
127
+ def register(resource_provider_namespace, custom_headers:nil)
128
+ response = register_async(resource_provider_namespace, custom_headers:custom_headers).value!
129
+ response.body unless response.nil?
130
+ end
131
+
132
+ #
133
+ # Registers a subscription with a resource provider.
134
+ #
135
+ # @param resource_provider_namespace [String] The namespace of the resource
136
+ # provider to register.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
141
+ #
142
+ def register_with_http_info(resource_provider_namespace, custom_headers:nil)
143
+ register_async(resource_provider_namespace, custom_headers:custom_headers).value!
144
+ end
145
+
146
+ #
147
+ # Registers a subscription with a resource provider.
148
+ #
149
+ # @param resource_provider_namespace [String] The namespace of the resource
150
+ # provider to register.
151
+ # @param [Hash{String => String}] A hash of custom headers that will be added
152
+ # to the HTTP request.
153
+ #
154
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
155
+ #
156
+ def register_async(resource_provider_namespace, custom_headers:nil)
157
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
158
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
159
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
160
+
161
+
162
+ request_headers = {}
163
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
164
+
165
+ # Set Headers
166
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
167
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
168
+ path_template = 'subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register'
169
+
170
+ request_url = @base_url || @client.base_url
171
+
172
+ options = {
173
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
174
+ path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
175
+ query_params: {'api-version' => @client.api_version},
176
+ headers: request_headers.merge(custom_headers || {}),
177
+ base_url: request_url
178
+ }
179
+ promise = @client.make_request_async(:post, path_template, options)
180
+
181
+ promise = promise.then do |result|
182
+ http_response = result.response
183
+ status_code = http_response.status
184
+ response_content = http_response.body
185
+ unless status_code == 200
186
+ error_model = JSON.load(response_content)
187
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
188
+ end
189
+
190
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
191
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
192
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
193
+ # Deserialize Response
194
+ if status_code == 200
195
+ begin
196
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
197
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Provider.mapper()
198
+ result.body = @client.deserialize(result_mapper, parsed_response)
199
+ rescue Exception => e
200
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
201
+ end
202
+ end
203
+
204
+ result
205
+ end
206
+
207
+ promise.execute
208
+ end
209
+
210
+ #
211
+ # Gets all resource providers for a subscription.
212
+ #
213
+ # @param top [Integer] The number of results to return. If null is passed
214
+ # returns all deployments.
215
+ # @param expand [String] The properties to include in the results. For example,
216
+ # use &$expand=metadata in the query string to retrieve resource provider
217
+ # metadata. To include property aliases in response, use
218
+ # $expand=resourceTypes/aliases.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [Array<Provider>] operation results.
223
+ #
224
+ def list(top:nil, expand:nil, custom_headers:nil)
225
+ first_page = list_as_lazy(top:top, expand:expand, custom_headers:custom_headers)
226
+ first_page.get_all_items
227
+ end
228
+
229
+ #
230
+ # Gets all resource providers for a subscription.
231
+ #
232
+ # @param top [Integer] The number of results to return. If null is passed
233
+ # returns all deployments.
234
+ # @param expand [String] The properties to include in the results. For example,
235
+ # use &$expand=metadata in the query string to retrieve resource provider
236
+ # metadata. To include property aliases in response, use
237
+ # $expand=resourceTypes/aliases.
238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
239
+ # will be added to the HTTP request.
240
+ #
241
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
242
+ #
243
+ def list_with_http_info(top:nil, expand:nil, custom_headers:nil)
244
+ list_async(top:top, expand:expand, custom_headers:custom_headers).value!
245
+ end
246
+
247
+ #
248
+ # Gets all resource providers for a subscription.
249
+ #
250
+ # @param top [Integer] The number of results to return. If null is passed
251
+ # returns all deployments.
252
+ # @param expand [String] The properties to include in the results. For example,
253
+ # use &$expand=metadata in the query string to retrieve resource provider
254
+ # metadata. To include property aliases in response, use
255
+ # $expand=resourceTypes/aliases.
256
+ # @param [Hash{String => String}] A hash of custom headers that will be added
257
+ # to the HTTP request.
258
+ #
259
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
260
+ #
261
+ def list_async(top:nil, expand:nil, custom_headers:nil)
262
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
263
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
264
+
265
+
266
+ request_headers = {}
267
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
268
+
269
+ # Set Headers
270
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
271
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
272
+ path_template = 'subscriptions/{subscriptionId}/providers'
273
+
274
+ request_url = @base_url || @client.base_url
275
+
276
+ options = {
277
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
278
+ path_params: {'subscriptionId' => @client.subscription_id},
279
+ query_params: {'$top' => top,'$expand' => expand,'api-version' => @client.api_version},
280
+ headers: request_headers.merge(custom_headers || {}),
281
+ base_url: request_url
282
+ }
283
+ promise = @client.make_request_async(:get, path_template, options)
284
+
285
+ promise = promise.then do |result|
286
+ http_response = result.response
287
+ status_code = http_response.status
288
+ response_content = http_response.body
289
+ unless status_code == 200
290
+ error_model = JSON.load(response_content)
291
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
292
+ end
293
+
294
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
295
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
296
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
297
+ # Deserialize Response
298
+ if status_code == 200
299
+ begin
300
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
301
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ProviderListResult.mapper()
302
+ result.body = @client.deserialize(result_mapper, parsed_response)
303
+ rescue Exception => e
304
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
305
+ end
306
+ end
307
+
308
+ result
309
+ end
310
+
311
+ promise.execute
312
+ end
313
+
314
+ #
315
+ # Gets all resource providers for the tenant.
316
+ #
317
+ # @param top [Integer] The number of results to return. If null is passed
318
+ # returns all providers.
319
+ # @param expand [String] The properties to include in the results. For example,
320
+ # use &$expand=metadata in the query string to retrieve resource provider
321
+ # metadata. To include property aliases in response, use
322
+ # $expand=resourceTypes/aliases.
323
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
324
+ # will be added to the HTTP request.
325
+ #
326
+ # @return [Array<Provider>] operation results.
327
+ #
328
+ def list_at_tenant_scope(top:nil, expand:nil, custom_headers:nil)
329
+ first_page = list_at_tenant_scope_as_lazy(top:top, expand:expand, custom_headers:custom_headers)
330
+ first_page.get_all_items
331
+ end
332
+
333
+ #
334
+ # Gets all resource providers for the tenant.
335
+ #
336
+ # @param top [Integer] The number of results to return. If null is passed
337
+ # returns all providers.
338
+ # @param expand [String] The properties to include in the results. For example,
339
+ # use &$expand=metadata in the query string to retrieve resource provider
340
+ # metadata. To include property aliases in response, use
341
+ # $expand=resourceTypes/aliases.
342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
343
+ # will be added to the HTTP request.
344
+ #
345
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
346
+ #
347
+ def list_at_tenant_scope_with_http_info(top:nil, expand:nil, custom_headers:nil)
348
+ list_at_tenant_scope_async(top:top, expand:expand, custom_headers:custom_headers).value!
349
+ end
350
+
351
+ #
352
+ # Gets all resource providers for the tenant.
353
+ #
354
+ # @param top [Integer] The number of results to return. If null is passed
355
+ # returns all providers.
356
+ # @param expand [String] The properties to include in the results. For example,
357
+ # use &$expand=metadata in the query string to retrieve resource provider
358
+ # metadata. To include property aliases in response, use
359
+ # $expand=resourceTypes/aliases.
360
+ # @param [Hash{String => String}] A hash of custom headers that will be added
361
+ # to the HTTP request.
362
+ #
363
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
364
+ #
365
+ def list_at_tenant_scope_async(top:nil, expand:nil, custom_headers:nil)
366
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
367
+
368
+
369
+ request_headers = {}
370
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
371
+
372
+ # Set Headers
373
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
374
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
375
+ path_template = 'providers'
376
+
377
+ request_url = @base_url || @client.base_url
378
+
379
+ options = {
380
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
381
+ query_params: {'$top' => top,'$expand' => expand,'api-version' => @client.api_version},
382
+ headers: request_headers.merge(custom_headers || {}),
383
+ base_url: request_url
384
+ }
385
+ promise = @client.make_request_async(:get, path_template, options)
386
+
387
+ promise = promise.then do |result|
388
+ http_response = result.response
389
+ status_code = http_response.status
390
+ response_content = http_response.body
391
+ unless status_code == 200
392
+ error_model = JSON.load(response_content)
393
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
394
+ end
395
+
396
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
397
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
398
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
399
+ # Deserialize Response
400
+ if status_code == 200
401
+ begin
402
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
403
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ProviderListResult.mapper()
404
+ result.body = @client.deserialize(result_mapper, parsed_response)
405
+ rescue Exception => e
406
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
407
+ end
408
+ end
409
+
410
+ result
411
+ end
412
+
413
+ promise.execute
414
+ end
415
+
416
+ #
417
+ # Gets the specified resource provider.
418
+ #
419
+ # @param resource_provider_namespace [String] The namespace of the resource
420
+ # provider.
421
+ # @param expand [String] The $expand query parameter. For example, to include
422
+ # property aliases in response, use $expand=resourceTypes/aliases.
423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
424
+ # will be added to the HTTP request.
425
+ #
426
+ # @return [Provider] operation results.
427
+ #
428
+ def get(resource_provider_namespace, expand:nil, custom_headers:nil)
429
+ response = get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
430
+ response.body unless response.nil?
431
+ end
432
+
433
+ #
434
+ # Gets the specified resource provider.
435
+ #
436
+ # @param resource_provider_namespace [String] The namespace of the resource
437
+ # provider.
438
+ # @param expand [String] The $expand query parameter. For example, to include
439
+ # property aliases in response, use $expand=resourceTypes/aliases.
440
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
441
+ # will be added to the HTTP request.
442
+ #
443
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
444
+ #
445
+ def get_with_http_info(resource_provider_namespace, expand:nil, custom_headers:nil)
446
+ get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
447
+ end
448
+
449
+ #
450
+ # Gets the specified resource provider.
451
+ #
452
+ # @param resource_provider_namespace [String] The namespace of the resource
453
+ # provider.
454
+ # @param expand [String] The $expand query parameter. For example, to include
455
+ # property aliases in response, use $expand=resourceTypes/aliases.
456
+ # @param [Hash{String => String}] A hash of custom headers that will be added
457
+ # to the HTTP request.
458
+ #
459
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
460
+ #
461
+ def get_async(resource_provider_namespace, expand:nil, custom_headers:nil)
462
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
463
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
464
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
465
+
466
+
467
+ request_headers = {}
468
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
469
+
470
+ # Set Headers
471
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
472
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
473
+ path_template = 'subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}'
474
+
475
+ request_url = @base_url || @client.base_url
476
+
477
+ options = {
478
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
479
+ path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
480
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
481
+ headers: request_headers.merge(custom_headers || {}),
482
+ base_url: request_url
483
+ }
484
+ promise = @client.make_request_async(:get, path_template, options)
485
+
486
+ promise = promise.then do |result|
487
+ http_response = result.response
488
+ status_code = http_response.status
489
+ response_content = http_response.body
490
+ unless status_code == 200
491
+ error_model = JSON.load(response_content)
492
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
493
+ end
494
+
495
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
496
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
497
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
498
+ # Deserialize Response
499
+ if status_code == 200
500
+ begin
501
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
502
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Provider.mapper()
503
+ result.body = @client.deserialize(result_mapper, parsed_response)
504
+ rescue Exception => e
505
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
506
+ end
507
+ end
508
+
509
+ result
510
+ end
511
+
512
+ promise.execute
513
+ end
514
+
515
+ #
516
+ # Gets the specified resource provider at the tenant level.
517
+ #
518
+ # @param resource_provider_namespace [String] The namespace of the resource
519
+ # provider.
520
+ # @param expand [String] The $expand query parameter. For example, to include
521
+ # property aliases in response, use $expand=resourceTypes/aliases.
522
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
523
+ # will be added to the HTTP request.
524
+ #
525
+ # @return [Provider] operation results.
526
+ #
527
+ def get_at_tenant_scope(resource_provider_namespace, expand:nil, custom_headers:nil)
528
+ response = get_at_tenant_scope_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
529
+ response.body unless response.nil?
530
+ end
531
+
532
+ #
533
+ # Gets the specified resource provider at the tenant level.
534
+ #
535
+ # @param resource_provider_namespace [String] The namespace of the resource
536
+ # provider.
537
+ # @param expand [String] The $expand query parameter. For example, to include
538
+ # property aliases in response, use $expand=resourceTypes/aliases.
539
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
540
+ # will be added to the HTTP request.
541
+ #
542
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
543
+ #
544
+ def get_at_tenant_scope_with_http_info(resource_provider_namespace, expand:nil, custom_headers:nil)
545
+ get_at_tenant_scope_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
546
+ end
547
+
548
+ #
549
+ # Gets the specified resource provider at the tenant level.
550
+ #
551
+ # @param resource_provider_namespace [String] The namespace of the resource
552
+ # provider.
553
+ # @param expand [String] The $expand query parameter. For example, to include
554
+ # property aliases in response, use $expand=resourceTypes/aliases.
555
+ # @param [Hash{String => String}] A hash of custom headers that will be added
556
+ # to the HTTP request.
557
+ #
558
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
559
+ #
560
+ def get_at_tenant_scope_async(resource_provider_namespace, expand:nil, custom_headers:nil)
561
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
562
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
563
+
564
+
565
+ request_headers = {}
566
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
567
+
568
+ # Set Headers
569
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
570
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
571
+ path_template = 'providers/{resourceProviderNamespace}'
572
+
573
+ request_url = @base_url || @client.base_url
574
+
575
+ options = {
576
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
577
+ path_params: {'resourceProviderNamespace' => resource_provider_namespace},
578
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
579
+ headers: request_headers.merge(custom_headers || {}),
580
+ base_url: request_url
581
+ }
582
+ promise = @client.make_request_async(:get, path_template, options)
583
+
584
+ promise = promise.then do |result|
585
+ http_response = result.response
586
+ status_code = http_response.status
587
+ response_content = http_response.body
588
+ unless status_code == 200
589
+ error_model = JSON.load(response_content)
590
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
591
+ end
592
+
593
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
594
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
595
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
596
+ # Deserialize Response
597
+ if status_code == 200
598
+ begin
599
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
600
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::Provider.mapper()
601
+ result.body = @client.deserialize(result_mapper, parsed_response)
602
+ rescue Exception => e
603
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
604
+ end
605
+ end
606
+
607
+ result
608
+ end
609
+
610
+ promise.execute
611
+ end
612
+
613
+ #
614
+ # Gets all resource providers for a subscription.
615
+ #
616
+ # @param next_page_link [String] The NextLink from the previous successful call
617
+ # to List operation.
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [ProviderListResult] operation results.
622
+ #
623
+ def list_next(next_page_link, custom_headers:nil)
624
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
625
+ response.body unless response.nil?
626
+ end
627
+
628
+ #
629
+ # Gets all resource providers for a subscription.
630
+ #
631
+ # @param next_page_link [String] The NextLink from the previous successful call
632
+ # to List operation.
633
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
634
+ # will be added to the HTTP request.
635
+ #
636
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
637
+ #
638
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
639
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
640
+ end
641
+
642
+ #
643
+ # Gets all resource providers for a subscription.
644
+ #
645
+ # @param next_page_link [String] The NextLink from the previous successful call
646
+ # to List operation.
647
+ # @param [Hash{String => String}] A hash of custom headers that will be added
648
+ # to the HTTP request.
649
+ #
650
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
651
+ #
652
+ def list_next_async(next_page_link, custom_headers:nil)
653
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
654
+
655
+
656
+ request_headers = {}
657
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
658
+
659
+ # Set Headers
660
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
661
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
662
+ path_template = '{nextLink}'
663
+
664
+ request_url = @base_url || @client.base_url
665
+
666
+ options = {
667
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
668
+ skip_encoding_path_params: {'nextLink' => next_page_link},
669
+ headers: request_headers.merge(custom_headers || {}),
670
+ base_url: request_url
671
+ }
672
+ promise = @client.make_request_async(:get, path_template, options)
673
+
674
+ promise = promise.then do |result|
675
+ http_response = result.response
676
+ status_code = http_response.status
677
+ response_content = http_response.body
678
+ unless status_code == 200
679
+ error_model = JSON.load(response_content)
680
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
681
+ end
682
+
683
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
684
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
685
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
686
+ # Deserialize Response
687
+ if status_code == 200
688
+ begin
689
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
690
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ProviderListResult.mapper()
691
+ result.body = @client.deserialize(result_mapper, parsed_response)
692
+ rescue Exception => e
693
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
694
+ end
695
+ end
696
+
697
+ result
698
+ end
699
+
700
+ promise.execute
701
+ end
702
+
703
+ #
704
+ # Gets all resource providers for the tenant.
705
+ #
706
+ # @param next_page_link [String] The NextLink from the previous successful call
707
+ # to List operation.
708
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
709
+ # will be added to the HTTP request.
710
+ #
711
+ # @return [ProviderListResult] operation results.
712
+ #
713
+ def list_at_tenant_scope_next(next_page_link, custom_headers:nil)
714
+ response = list_at_tenant_scope_next_async(next_page_link, custom_headers:custom_headers).value!
715
+ response.body unless response.nil?
716
+ end
717
+
718
+ #
719
+ # Gets all resource providers for the tenant.
720
+ #
721
+ # @param next_page_link [String] The NextLink from the previous successful call
722
+ # to List operation.
723
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
724
+ # will be added to the HTTP request.
725
+ #
726
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
727
+ #
728
+ def list_at_tenant_scope_next_with_http_info(next_page_link, custom_headers:nil)
729
+ list_at_tenant_scope_next_async(next_page_link, custom_headers:custom_headers).value!
730
+ end
731
+
732
+ #
733
+ # Gets all resource providers for the tenant.
734
+ #
735
+ # @param next_page_link [String] The NextLink from the previous successful call
736
+ # to List operation.
737
+ # @param [Hash{String => String}] A hash of custom headers that will be added
738
+ # to the HTTP request.
739
+ #
740
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
741
+ #
742
+ def list_at_tenant_scope_next_async(next_page_link, custom_headers:nil)
743
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
744
+
745
+
746
+ request_headers = {}
747
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
748
+
749
+ # Set Headers
750
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
751
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
752
+ path_template = '{nextLink}'
753
+
754
+ request_url = @base_url || @client.base_url
755
+
756
+ options = {
757
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
758
+ skip_encoding_path_params: {'nextLink' => next_page_link},
759
+ headers: request_headers.merge(custom_headers || {}),
760
+ base_url: request_url
761
+ }
762
+ promise = @client.make_request_async(:get, path_template, options)
763
+
764
+ promise = promise.then do |result|
765
+ http_response = result.response
766
+ status_code = http_response.status
767
+ response_content = http_response.body
768
+ unless status_code == 200
769
+ error_model = JSON.load(response_content)
770
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
771
+ end
772
+
773
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
774
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
775
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
776
+ # Deserialize Response
777
+ if status_code == 200
778
+ begin
779
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
780
+ result_mapper = Azure::Resources::Mgmt::V2019_10_01::Models::ProviderListResult.mapper()
781
+ result.body = @client.deserialize(result_mapper, parsed_response)
782
+ rescue Exception => e
783
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
784
+ end
785
+ end
786
+
787
+ result
788
+ end
789
+
790
+ promise.execute
791
+ end
792
+
793
+ #
794
+ # Gets all resource providers for a subscription.
795
+ #
796
+ # @param top [Integer] The number of results to return. If null is passed
797
+ # returns all deployments.
798
+ # @param expand [String] The properties to include in the results. For example,
799
+ # use &$expand=metadata in the query string to retrieve resource provider
800
+ # metadata. To include property aliases in response, use
801
+ # $expand=resourceTypes/aliases.
802
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
803
+ # will be added to the HTTP request.
804
+ #
805
+ # @return [ProviderListResult] which provide lazy access to pages of the
806
+ # response.
807
+ #
808
+ def list_as_lazy(top:nil, expand:nil, custom_headers:nil)
809
+ response = list_async(top:top, expand:expand, custom_headers:custom_headers).value!
810
+ unless response.nil?
811
+ page = response.body
812
+ page.next_method = Proc.new do |next_page_link|
813
+ list_next_async(next_page_link, custom_headers:custom_headers)
814
+ end
815
+ page
816
+ end
817
+ end
818
+
819
+ #
820
+ # Gets all resource providers for the tenant.
821
+ #
822
+ # @param top [Integer] The number of results to return. If null is passed
823
+ # returns all providers.
824
+ # @param expand [String] The properties to include in the results. For example,
825
+ # use &$expand=metadata in the query string to retrieve resource provider
826
+ # metadata. To include property aliases in response, use
827
+ # $expand=resourceTypes/aliases.
828
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
829
+ # will be added to the HTTP request.
830
+ #
831
+ # @return [ProviderListResult] which provide lazy access to pages of the
832
+ # response.
833
+ #
834
+ def list_at_tenant_scope_as_lazy(top:nil, expand:nil, custom_headers:nil)
835
+ response = list_at_tenant_scope_async(top:top, expand:expand, custom_headers:custom_headers).value!
836
+ unless response.nil?
837
+ page = response.body
838
+ page.next_method = Proc.new do |next_page_link|
839
+ list_at_tenant_scope_next_async(next_page_link, custom_headers:custom_headers)
840
+ end
841
+ page
842
+ end
843
+ end
844
+
845
+ end
846
+ end