azure_mgmt_cognitive_services 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_cognitive_services.rb +17 -8
  3. data/lib/generated/azure_mgmt_cognitive_services/accounts.rb +414 -0
  4. data/lib/generated/azure_mgmt_cognitive_services/check_sku_availability.rb +148 -0
  5. data/lib/generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb +61 -297
  6. data/lib/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +18 -3
  7. data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_parameter.rb +77 -0
  8. data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result.rb +102 -0
  9. data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result_list.rb +54 -0
  10. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb +14 -3
  11. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb +9 -7
  12. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_enumerate_skus_result.rb +2 -1
  13. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_keys.rb +2 -1
  14. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_list_result.rb +43 -1
  15. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_update_parameters.rb +3 -2
  16. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_resource_and_sku.rb +4 -4
  17. data/lib/generated/azure_mgmt_cognitive_services/models/error.rb +4 -4
  18. data/lib/generated/azure_mgmt_cognitive_services/models/error_body.rb +3 -3
  19. data/lib/generated/azure_mgmt_cognitive_services/models/key_name.rb +1 -1
  20. data/lib/generated/azure_mgmt_cognitive_services/models/kind.rb +2 -1
  21. data/lib/generated/azure_mgmt_cognitive_services/models/operation_display_info.rb +76 -0
  22. data/lib/generated/azure_mgmt_cognitive_services/models/operation_entity.rb +77 -0
  23. data/lib/generated/azure_mgmt_cognitive_services/models/operation_entity_list_result.rb +94 -0
  24. data/lib/generated/azure_mgmt_cognitive_services/models/provisioning_state.rb +1 -1
  25. data/lib/generated/azure_mgmt_cognitive_services/models/regenerate_key_parameters.rb +3 -2
  26. data/lib/generated/azure_mgmt_cognitive_services/models/sku.rb +2 -1
  27. data/lib/generated/azure_mgmt_cognitive_services/models/sku_name.rb +1 -1
  28. data/lib/generated/azure_mgmt_cognitive_services/models/sku_tier.rb +1 -1
  29. data/lib/generated/azure_mgmt_cognitive_services/module_definition.rb +1 -1
  30. data/lib/generated/azure_mgmt_cognitive_services/operations.rb +213 -0
  31. data/lib/generated/azure_mgmt_cognitive_services/version.rb +2 -2
  32. metadata +13 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bb2ab6a899008d19c89117bcbfca07cdc8bf0d6
4
- data.tar.gz: f022788998e261da7ddab1d6d1f27f8b31611b3a
3
+ metadata.gz: 24dc8726c25fa19148400fdcb18ff18a204e9700
4
+ data.tar.gz: e0c6e815aaf3ec042426a78c3a319acbf197da74
5
5
  SHA512:
6
- metadata.gz: 93e5a61b00817285522056ce9d36362cce0b7403051f9e6290c8367a49094b692a075694bfaea57e2d9befd267493918d2e0586c1b5b0c1a9aa6c697bf9a3281
7
- data.tar.gz: 48c256ea8b0147443a336ddd39fac533bfcb9d70ac79dafea5a786868edefaa16ad2b26c4f4eb7a4d42f69c5de3e46e76af0e9525e478064b50be3cabd934601
6
+ metadata.gz: 27e9d3373e8dafa245a0aa65195e9188f4baabbf090e1ca39d7eaddb48b72862ad0b8b7dc27dec96def7ec619156f0647087155a9b722b46de1ea90b52e09ca6
7
+ data.tar.gz: d8e916227ada9fc97374864a4d034258a345afaaa75578d5df73a271a162fc046c47d1c650b3dec9cee73e34e4fc69d2a303083422324ecb84cafcffb4ef0c8f
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -21,20 +21,29 @@ require 'ms_rest_azure'
21
21
 
22
22
  module Azure::ARM::CognitiveServices
23
23
  autoload :CognitiveServicesAccounts, 'generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb'
24
+ autoload :Accounts, 'generated/azure_mgmt_cognitive_services/accounts.rb'
25
+ autoload :Operations, 'generated/azure_mgmt_cognitive_services/operations.rb'
26
+ autoload :CheckSkuAvailability, 'generated/azure_mgmt_cognitive_services/check_sku_availability.rb'
24
27
  autoload :CognitiveServicesManagementClient, 'generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb'
25
28
 
26
29
  module Models
27
- autoload :CognitiveServicesAccountKeys, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_keys.rb'
28
- autoload :RegenerateKeyParameters, 'generated/azure_mgmt_cognitive_services/models/regenerate_key_parameters.rb'
29
- autoload :CognitiveServicesAccountCreateParameters, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb'
30
- autoload :CognitiveServicesResourceAndSku, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_resource_and_sku.rb'
31
- autoload :CognitiveServicesAccount, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb'
32
30
  autoload :CognitiveServicesAccountEnumerateSkusResult, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_enumerate_skus_result.rb'
33
- autoload :Sku, 'generated/azure_mgmt_cognitive_services/models/sku.rb'
34
31
  autoload :ErrorBody, 'generated/azure_mgmt_cognitive_services/models/error_body.rb'
35
- autoload :CognitiveServicesAccountListResult, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_list_result.rb'
32
+ autoload :CognitiveServicesAccountCreateParameters, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb'
36
33
  autoload :Error, 'generated/azure_mgmt_cognitive_services/models/error.rb'
34
+ autoload :CognitiveServicesAccount, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb'
35
+ autoload :OperationDisplayInfo, 'generated/azure_mgmt_cognitive_services/models/operation_display_info.rb'
36
+ autoload :CognitiveServicesAccountKeys, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_keys.rb'
37
+ autoload :OperationEntity, 'generated/azure_mgmt_cognitive_services/models/operation_entity.rb'
38
+ autoload :CognitiveServicesResourceAndSku, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_resource_and_sku.rb'
39
+ autoload :OperationEntityListResult, 'generated/azure_mgmt_cognitive_services/models/operation_entity_list_result.rb'
37
40
  autoload :CognitiveServicesAccountUpdateParameters, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_update_parameters.rb'
41
+ autoload :CheckSkuAvailabilityParameter, 'generated/azure_mgmt_cognitive_services/models/check_sku_availability_parameter.rb'
42
+ autoload :RegenerateKeyParameters, 'generated/azure_mgmt_cognitive_services/models/regenerate_key_parameters.rb'
43
+ autoload :CheckSkuAvailabilityResult, 'generated/azure_mgmt_cognitive_services/models/check_sku_availability_result.rb'
44
+ autoload :CognitiveServicesAccountListResult, 'generated/azure_mgmt_cognitive_services/models/cognitive_services_account_list_result.rb'
45
+ autoload :CheckSkuAvailabilityResultList, 'generated/azure_mgmt_cognitive_services/models/check_sku_availability_result_list.rb'
46
+ autoload :Sku, 'generated/azure_mgmt_cognitive_services/models/sku.rb'
38
47
  autoload :SkuName, 'generated/azure_mgmt_cognitive_services/models/sku_name.rb'
39
48
  autoload :SkuTier, 'generated/azure_mgmt_cognitive_services/models/sku_tier.rb'
40
49
  autoload :Kind, 'generated/azure_mgmt_cognitive_services/models/kind.rb'
@@ -0,0 +1,414 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CognitiveServices
7
+ #
8
+ # Cognitive Services Management Client
9
+ #
10
+ class Accounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Accounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CognitiveServicesManagementClient] reference to the CognitiveServicesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Returns all the resources of a particular type belonging to a resource group
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group within the
28
+ # user's subscription.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<CognitiveServicesAccount>] operation results.
33
+ #
34
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
35
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Returns all the resources of a particular type belonging to a resource group
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group within the
43
+ # user's subscription.
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 list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
50
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Returns all the resources of a particular type belonging to a resource group
55
+ #
56
+ # @param resource_group_name [String] The name of the resource group within the
57
+ # user's subscription.
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 list_by_resource_group_async(resource_group_name, custom_headers = nil)
64
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
67
+
68
+
69
+ request_headers = {}
70
+
71
+ # Set Headers
72
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
73
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
74
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts'
75
+
76
+ request_url = @base_url || @client.base_url
77
+
78
+ options = {
79
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
80
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
81
+ query_params: {'api-version' => @client.api_version},
82
+ headers: request_headers.merge(custom_headers || {}),
83
+ base_url: request_url
84
+ }
85
+ promise = @client.make_request_async(:get, path_template, options)
86
+
87
+ promise = promise.then do |result|
88
+ http_response = result.response
89
+ status_code = http_response.status
90
+ response_content = http_response.body
91
+ unless status_code == 200
92
+ error_model = JSON.load(response_content)
93
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
94
+ end
95
+
96
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
97
+ # Deserialize Response
98
+ if status_code == 200
99
+ begin
100
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
101
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountListResult.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response)
103
+ rescue Exception => e
104
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
+ end
106
+ end
107
+
108
+ result
109
+ end
110
+
111
+ promise.execute
112
+ end
113
+
114
+ #
115
+ # Returns all the resources of a particular type belonging to a subscription.
116
+ #
117
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
118
+ # will be added to the HTTP request.
119
+ #
120
+ # @return [Array<CognitiveServicesAccount>] operation results.
121
+ #
122
+ def list(custom_headers = nil)
123
+ first_page = list_as_lazy(custom_headers)
124
+ first_page.get_all_items
125
+ end
126
+
127
+ #
128
+ # Returns all the resources of a particular type belonging to a subscription.
129
+ #
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
134
+ #
135
+ def list_with_http_info(custom_headers = nil)
136
+ list_async(custom_headers).value!
137
+ end
138
+
139
+ #
140
+ # Returns all the resources of a particular type belonging to a subscription.
141
+ #
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_async(custom_headers = nil)
148
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
149
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
150
+
151
+
152
+ request_headers = {}
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 = 'subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts'
158
+
159
+ request_url = @base_url || @client.base_url
160
+
161
+ options = {
162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
163
+ path_params: {'subscriptionId' => @client.subscription_id},
164
+ query_params: {'api-version' => @client.api_version},
165
+ headers: request_headers.merge(custom_headers || {}),
166
+ base_url: request_url
167
+ }
168
+ promise = @client.make_request_async(:get, path_template, options)
169
+
170
+ promise = promise.then do |result|
171
+ http_response = result.response
172
+ status_code = http_response.status
173
+ response_content = http_response.body
174
+ unless status_code == 200
175
+ error_model = JSON.load(response_content)
176
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
177
+ end
178
+
179
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
180
+ # Deserialize Response
181
+ if status_code == 200
182
+ begin
183
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
184
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountListResult.mapper()
185
+ result.body = @client.deserialize(result_mapper, parsed_response)
186
+ rescue Exception => e
187
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
188
+ end
189
+ end
190
+
191
+ result
192
+ end
193
+
194
+ promise.execute
195
+ end
196
+
197
+ #
198
+ # Returns all the resources of a particular type belonging to a resource group
199
+ #
200
+ # @param next_page_link [String] The NextLink from the previous successful call
201
+ # to List operation.
202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
203
+ # will be added to the HTTP request.
204
+ #
205
+ # @return [CognitiveServicesAccountListResult] operation results.
206
+ #
207
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
208
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
209
+ response.body unless response.nil?
210
+ end
211
+
212
+ #
213
+ # Returns all the resources of a particular type belonging to a resource group
214
+ #
215
+ # @param next_page_link [String] The NextLink from the previous successful call
216
+ # to List operation.
217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
218
+ # will be added to the HTTP request.
219
+ #
220
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
221
+ #
222
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
223
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
224
+ end
225
+
226
+ #
227
+ # Returns all the resources of a particular type belonging to a resource group
228
+ #
229
+ # @param next_page_link [String] The NextLink from the previous successful call
230
+ # to List operation.
231
+ # @param [Hash{String => String}] A hash of custom headers that will be added
232
+ # to the HTTP request.
233
+ #
234
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
235
+ #
236
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
237
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
238
+
239
+
240
+ request_headers = {}
241
+
242
+ # Set Headers
243
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
244
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
245
+ path_template = '{nextLink}'
246
+
247
+ request_url = @base_url || @client.base_url
248
+
249
+ options = {
250
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
251
+ skip_encoding_path_params: {'nextLink' => next_page_link},
252
+ headers: request_headers.merge(custom_headers || {}),
253
+ base_url: request_url
254
+ }
255
+ promise = @client.make_request_async(:get, path_template, options)
256
+
257
+ promise = promise.then do |result|
258
+ http_response = result.response
259
+ status_code = http_response.status
260
+ response_content = http_response.body
261
+ unless status_code == 200
262
+ error_model = JSON.load(response_content)
263
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
264
+ end
265
+
266
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
267
+ # Deserialize Response
268
+ if status_code == 200
269
+ begin
270
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
271
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountListResult.mapper()
272
+ result.body = @client.deserialize(result_mapper, parsed_response)
273
+ rescue Exception => e
274
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
275
+ end
276
+ end
277
+
278
+ result
279
+ end
280
+
281
+ promise.execute
282
+ end
283
+
284
+ #
285
+ # Returns all the resources of a particular type belonging to a subscription.
286
+ #
287
+ # @param next_page_link [String] The NextLink from the previous successful call
288
+ # to List operation.
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ # @return [CognitiveServicesAccountListResult] operation results.
293
+ #
294
+ def list_next(next_page_link, custom_headers = nil)
295
+ response = list_next_async(next_page_link, custom_headers).value!
296
+ response.body unless response.nil?
297
+ end
298
+
299
+ #
300
+ # Returns all the resources of a particular type belonging to a subscription.
301
+ #
302
+ # @param next_page_link [String] The NextLink from the previous successful call
303
+ # to List operation.
304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
+ # will be added to the HTTP request.
306
+ #
307
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
308
+ #
309
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
310
+ list_next_async(next_page_link, custom_headers).value!
311
+ end
312
+
313
+ #
314
+ # Returns all the resources of a particular type belonging to a subscription.
315
+ #
316
+ # @param next_page_link [String] The NextLink from the previous successful call
317
+ # to List operation.
318
+ # @param [Hash{String => String}] A hash of custom headers that will be added
319
+ # to the HTTP request.
320
+ #
321
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
322
+ #
323
+ def list_next_async(next_page_link, custom_headers = nil)
324
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
325
+
326
+
327
+ request_headers = {}
328
+
329
+ # Set Headers
330
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
331
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
332
+ path_template = '{nextLink}'
333
+
334
+ request_url = @base_url || @client.base_url
335
+
336
+ options = {
337
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
338
+ skip_encoding_path_params: {'nextLink' => next_page_link},
339
+ headers: request_headers.merge(custom_headers || {}),
340
+ base_url: request_url
341
+ }
342
+ promise = @client.make_request_async(:get, path_template, options)
343
+
344
+ promise = promise.then do |result|
345
+ http_response = result.response
346
+ status_code = http_response.status
347
+ response_content = http_response.body
348
+ unless status_code == 200
349
+ error_model = JSON.load(response_content)
350
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
351
+ end
352
+
353
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
354
+ # Deserialize Response
355
+ if status_code == 200
356
+ begin
357
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
358
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountListResult.mapper()
359
+ result.body = @client.deserialize(result_mapper, parsed_response)
360
+ rescue Exception => e
361
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
362
+ end
363
+ end
364
+
365
+ result
366
+ end
367
+
368
+ promise.execute
369
+ end
370
+
371
+ #
372
+ # Returns all the resources of a particular type belonging to a resource group
373
+ #
374
+ # @param resource_group_name [String] The name of the resource group within the
375
+ # user's subscription.
376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
377
+ # will be added to the HTTP request.
378
+ #
379
+ # @return [CognitiveServicesAccountListResult] which provide lazy access to
380
+ # pages of the response.
381
+ #
382
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
383
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
384
+ unless response.nil?
385
+ page = response.body
386
+ page.next_method = Proc.new do |next_page_link|
387
+ list_by_resource_group_next_async(next_page_link, custom_headers)
388
+ end
389
+ page
390
+ end
391
+ end
392
+
393
+ #
394
+ # Returns all the resources of a particular type belonging to a subscription.
395
+ #
396
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
397
+ # will be added to the HTTP request.
398
+ #
399
+ # @return [CognitiveServicesAccountListResult] which provide lazy access to
400
+ # pages of the response.
401
+ #
402
+ def list_as_lazy(custom_headers = nil)
403
+ response = list_async(custom_headers).value!
404
+ unless response.nil?
405
+ page = response.body
406
+ page.next_method = Proc.new do |next_page_link|
407
+ list_next_async(next_page_link, custom_headers)
408
+ end
409
+ page
410
+ end
411
+ end
412
+
413
+ end
414
+ end