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
@@ -0,0 +1,148 @@
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 CheckSkuAvailability
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the CheckSkuAvailability 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
+ # Check available SKUs.
26
+ #
27
+ # @param skus [Array<SkuName>] The SKU of the resource.
28
+ # @param kind [Kind] The Kind of the resource. Possible values include:
29
+ # 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
30
+ # 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
31
+ # 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition', 'Speech',
32
+ # 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
33
+ # @param type [String] The Type of the resource.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [CheckSkuAvailabilityResultList] operation results.
38
+ #
39
+ def list(skus, kind, type, custom_headers = nil)
40
+ response = list_async(skus, kind, type, custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Check available SKUs.
46
+ #
47
+ # @param skus [Array<SkuName>] The SKU of the resource.
48
+ # @param kind [Kind] The Kind of the resource. Possible values include:
49
+ # 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
50
+ # 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
51
+ # 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition', 'Speech',
52
+ # 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
53
+ # @param type [String] The Type of the resource.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def list_with_http_info(skus, kind, type, custom_headers = nil)
60
+ list_async(skus, kind, type, custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Check available SKUs.
65
+ #
66
+ # @param skus [Array<SkuName>] The SKU of the resource.
67
+ # @param kind [Kind] The Kind of the resource. Possible values include:
68
+ # 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
69
+ # 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
70
+ # 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition', 'Speech',
71
+ # 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
72
+ # @param type [String] The Type of the resource.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def list_async(skus, kind, type, custom_headers = nil)
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+ fail ArgumentError, '@client.location is nil' if @client.location.nil?
82
+ fail ArgumentError, 'skus is nil' if skus.nil?
83
+ fail ArgumentError, 'kind is nil' if kind.nil?
84
+ fail ArgumentError, 'type is nil' if type.nil?
85
+
86
+ parameters = CheckSkuAvailabilityParameter.new
87
+ unless skus.nil? && kind.nil? && type.nil?
88
+ parameters.skus = skus
89
+ parameters.kind = kind
90
+ parameters.type = type
91
+ end
92
+
93
+ request_headers = {}
94
+
95
+ # Set Headers
96
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
97
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
98
+
99
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
100
+
101
+ # Serialize Request
102
+ request_mapper = Azure::ARM::CognitiveServices::Models::CheckSkuAvailabilityParameter.mapper()
103
+ request_content = @client.serialize(request_mapper, parameters)
104
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
105
+
106
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability'
107
+
108
+ request_url = @base_url || @client.base_url
109
+
110
+ options = {
111
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
112
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => @client.location},
113
+ query_params: {'api-version' => @client.api_version},
114
+ body: request_content,
115
+ headers: request_headers.merge(custom_headers || {}),
116
+ base_url: request_url
117
+ }
118
+ promise = @client.make_request_async(:post, path_template, options)
119
+
120
+ promise = promise.then do |result|
121
+ http_response = result.response
122
+ status_code = http_response.status
123
+ response_content = http_response.body
124
+ unless status_code == 200
125
+ error_model = JSON.load(response_content)
126
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
127
+ end
128
+
129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
130
+ # Deserialize Response
131
+ if status_code == 200
132
+ begin
133
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
134
+ result_mapper = Azure::ARM::CognitiveServices::Models::CheckSkuAvailabilityResultList.mapper()
135
+ result.body = @client.deserialize(result_mapper, parsed_response)
136
+ rescue Exception => e
137
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
138
+ end
139
+ end
140
+
141
+ result
142
+ end
143
+
144
+ promise.execute
145
+ end
146
+
147
+ end
148
+ end
@@ -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
 
@@ -8,7 +8,6 @@ module Azure::ARM::CognitiveServices
8
8
  # Cognitive Services Management Client
9
9
  #
10
10
  class CognitiveServicesAccounts
11
- include Azure::ARM::CognitiveServices::Models
12
11
  include MsRestAzure
13
12
 
14
13
  #
@@ -29,10 +28,7 @@ module Azure::ARM::CognitiveServices
29
28
  #
30
29
  # @param resource_group_name [String] The name of the resource group within the
31
30
  # user's subscription.
32
- # @param account_name [String] The name of the cognitive services account
33
- # within the specified resource group. Cognitive Services account names must be
34
- # between 3 and 24 characters in length and use numbers and lower-case letters
35
- # only.
31
+ # @param account_name [String] The name of Cognitive Services account.
36
32
  # @param parameters [CognitiveServicesAccountCreateParameters] The parameters
37
33
  # to provide for the created account.
38
34
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -52,10 +48,7 @@ module Azure::ARM::CognitiveServices
52
48
  #
53
49
  # @param resource_group_name [String] The name of the resource group within the
54
50
  # user's subscription.
55
- # @param account_name [String] The name of the cognitive services account
56
- # within the specified resource group. Cognitive Services account names must be
57
- # between 3 and 24 characters in length and use numbers and lower-case letters
58
- # only.
51
+ # @param account_name [String] The name of Cognitive Services account.
59
52
  # @param parameters [CognitiveServicesAccountCreateParameters] The parameters
60
53
  # to provide for the created account.
61
54
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -74,10 +67,7 @@ module Azure::ARM::CognitiveServices
74
67
  #
75
68
  # @param resource_group_name [String] The name of the resource group within the
76
69
  # user's subscription.
77
- # @param account_name [String] The name of the cognitive services account
78
- # within the specified resource group. Cognitive Services account names must be
79
- # between 3 and 24 characters in length and use numbers and lower-case letters
80
- # only.
70
+ # @param account_name [String] The name of Cognitive Services account.
81
71
  # @param parameters [CognitiveServicesAccountCreateParameters] The parameters
82
72
  # to provide for the created account.
83
73
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -102,11 +92,11 @@ module Azure::ARM::CognitiveServices
102
92
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
103
93
 
104
94
  # Serialize Request
105
- request_mapper = CognitiveServicesAccountCreateParameters.mapper()
106
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
95
+ request_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountCreateParameters.mapper()
96
+ request_content = @client.serialize(request_mapper, parameters)
107
97
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
108
98
 
109
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
99
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
110
100
 
111
101
  request_url = @base_url || @client.base_url
112
102
 
@@ -134,8 +124,8 @@ module Azure::ARM::CognitiveServices
134
124
  if status_code == 200
135
125
  begin
136
126
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
137
- result_mapper = CognitiveServicesAccount.mapper()
138
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
127
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
128
+ result.body = @client.deserialize(result_mapper, parsed_response)
139
129
  rescue Exception => e
140
130
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
141
131
  end
@@ -144,8 +134,8 @@ module Azure::ARM::CognitiveServices
144
134
  if status_code == 201
145
135
  begin
146
136
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
147
- result_mapper = CognitiveServicesAccount.mapper()
148
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
137
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
138
+ result.body = @client.deserialize(result_mapper, parsed_response)
149
139
  rescue Exception => e
150
140
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
151
141
  end
@@ -162,11 +152,8 @@ module Azure::ARM::CognitiveServices
162
152
  #
163
153
  # @param resource_group_name [String] The name of the resource group within the
164
154
  # user's subscription.
165
- # @param account_name [String] The name of the cognitive services account
166
- # within the specified resource group. Cognitive Services account names must be
167
- # between 3 and 24 characters in length and use numbers and lower-case letters
168
- # only.
169
- # @param sku [Sku]
155
+ # @param account_name [String] The name of Cognitive Services account.
156
+ # @param sku [Sku] Gets or sets the SKU of the resource.
170
157
  # @param tags [Hash{String => String}] Gets or sets a list of key value pairs
171
158
  # that describe the resource. These tags can be used in viewing and grouping
172
159
  # this resource (across resource groups). A maximum of 15 tags can be provided
@@ -187,11 +174,8 @@ module Azure::ARM::CognitiveServices
187
174
  #
188
175
  # @param resource_group_name [String] The name of the resource group within the
189
176
  # user's subscription.
190
- # @param account_name [String] The name of the cognitive services account
191
- # within the specified resource group. Cognitive Services account names must be
192
- # between 3 and 24 characters in length and use numbers and lower-case letters
193
- # only.
194
- # @param sku [Sku]
177
+ # @param account_name [String] The name of Cognitive Services account.
178
+ # @param sku [Sku] Gets or sets the SKU of the resource.
195
179
  # @param tags [Hash{String => String}] Gets or sets a list of key value pairs
196
180
  # that describe the resource. These tags can be used in viewing and grouping
197
181
  # this resource (across resource groups). A maximum of 15 tags can be provided
@@ -211,11 +195,8 @@ module Azure::ARM::CognitiveServices
211
195
  #
212
196
  # @param resource_group_name [String] The name of the resource group within the
213
197
  # user's subscription.
214
- # @param account_name [String] The name of the cognitive services account
215
- # within the specified resource group. Cognitive Services account names must be
216
- # between 3 and 24 characters in length and use numbers and lower-case letters
217
- # only.
218
- # @param sku [Sku]
198
+ # @param account_name [String] The name of Cognitive Services account.
199
+ # @param sku [Sku] Gets or sets the SKU of the resource.
219
200
  # @param tags [Hash{String => String}] Gets or sets a list of key value pairs
220
201
  # that describe the resource. These tags can be used in viewing and grouping
221
202
  # this resource (across resource groups). A maximum of 15 tags can be provided
@@ -232,10 +213,10 @@ module Azure::ARM::CognitiveServices
232
213
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
233
214
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
234
215
 
235
- body = CognitiveServicesAccountUpdateParameters.new
216
+ parameters = CognitiveServicesAccountUpdateParameters.new
236
217
  unless sku.nil? && tags.nil?
237
- body.sku = sku
238
- body.tags = tags
218
+ parameters.sku = sku
219
+ parameters.tags = tags
239
220
  end
240
221
 
241
222
  request_headers = {}
@@ -247,11 +228,11 @@ module Azure::ARM::CognitiveServices
247
228
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
248
229
 
249
230
  # Serialize Request
250
- request_mapper = CognitiveServicesAccountUpdateParameters.mapper()
251
- request_content = @client.serialize(request_mapper, body, 'body')
231
+ request_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountUpdateParameters.mapper()
232
+ request_content = @client.serialize(request_mapper, parameters)
252
233
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
253
234
 
254
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
235
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
255
236
 
256
237
  request_url = @base_url || @client.base_url
257
238
 
@@ -279,8 +260,8 @@ module Azure::ARM::CognitiveServices
279
260
  if status_code == 200
280
261
  begin
281
262
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
282
- result_mapper = CognitiveServicesAccount.mapper()
283
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
263
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
264
+ result.body = @client.deserialize(result_mapper, parsed_response)
284
265
  rescue Exception => e
285
266
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
286
267
  end
@@ -297,10 +278,7 @@ module Azure::ARM::CognitiveServices
297
278
  #
298
279
  # @param resource_group_name [String] The name of the resource group within the
299
280
  # user's subscription.
300
- # @param account_name [String] The name of the cognitive services account
301
- # within the specified resource group. Cognitive Services account names must be
302
- # between 3 and 24 characters in length and use numbers and lower-case letters
303
- # only.
281
+ # @param account_name [String] The name of Cognitive Services account.
304
282
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
283
  # will be added to the HTTP request.
306
284
  #
@@ -315,10 +293,7 @@ module Azure::ARM::CognitiveServices
315
293
  #
316
294
  # @param resource_group_name [String] The name of the resource group within the
317
295
  # user's subscription.
318
- # @param account_name [String] The name of the cognitive services account
319
- # within the specified resource group. Cognitive Services account names must be
320
- # between 3 and 24 characters in length and use numbers and lower-case letters
321
- # only.
296
+ # @param account_name [String] The name of Cognitive Services account.
322
297
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
323
298
  # will be added to the HTTP request.
324
299
  #
@@ -333,10 +308,7 @@ module Azure::ARM::CognitiveServices
333
308
  #
334
309
  # @param resource_group_name [String] The name of the resource group within the
335
310
  # user's subscription.
336
- # @param account_name [String] The name of the cognitive services account
337
- # within the specified resource group. Cognitive Services account names must be
338
- # between 3 and 24 characters in length and use numbers and lower-case letters
339
- # only.
311
+ # @param account_name [String] The name of Cognitive Services account.
340
312
  # @param [Hash{String => String}] A hash of custom headers that will be added
341
313
  # to the HTTP request.
342
314
  #
@@ -354,7 +326,7 @@ module Azure::ARM::CognitiveServices
354
326
  # Set Headers
355
327
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
356
328
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
357
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
329
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
358
330
 
359
331
  request_url = @base_url || @client.base_url
360
332
 
@@ -389,10 +361,7 @@ module Azure::ARM::CognitiveServices
389
361
  #
390
362
  # @param resource_group_name [String] The name of the resource group within the
391
363
  # user's subscription.
392
- # @param account_name [String] The name of the cognitive services account
393
- # within the specified resource group. Cognitive Services account names must be
394
- # between 3 and 24 characters in length and use numbers and lower-case letters
395
- # only.
364
+ # @param account_name [String] The name of Cognitive Services account.
396
365
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
397
366
  # will be added to the HTTP request.
398
367
  #
@@ -408,10 +377,7 @@ module Azure::ARM::CognitiveServices
408
377
  #
409
378
  # @param resource_group_name [String] The name of the resource group within the
410
379
  # user's subscription.
411
- # @param account_name [String] The name of the cognitive services account
412
- # within the specified resource group. Cognitive Services account names must be
413
- # between 3 and 24 characters in length and use numbers and lower-case letters
414
- # only.
380
+ # @param account_name [String] The name of Cognitive Services account.
415
381
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
416
382
  # will be added to the HTTP request.
417
383
  #
@@ -426,10 +392,7 @@ module Azure::ARM::CognitiveServices
426
392
  #
427
393
  # @param resource_group_name [String] The name of the resource group within the
428
394
  # user's subscription.
429
- # @param account_name [String] The name of the cognitive services account
430
- # within the specified resource group. Cognitive Services account names must be
431
- # between 3 and 24 characters in length and use numbers and lower-case letters
432
- # only.
395
+ # @param account_name [String] The name of Cognitive Services account.
433
396
  # @param [Hash{String => String}] A hash of custom headers that will be added
434
397
  # to the HTTP request.
435
398
  #
@@ -447,7 +410,7 @@ module Azure::ARM::CognitiveServices
447
410
  # Set Headers
448
411
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
449
412
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
450
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
413
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
451
414
 
452
415
  request_url = @base_url || @client.base_url
453
416
 
@@ -474,181 +437,8 @@ module Azure::ARM::CognitiveServices
474
437
  if status_code == 200
475
438
  begin
476
439
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
477
- result_mapper = CognitiveServicesAccount.mapper()
478
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
479
- rescue Exception => e
480
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
481
- end
482
- end
483
-
484
- result
485
- end
486
-
487
- promise.execute
488
- end
489
-
490
- #
491
- # Returns all the resources of a particular type belonging to a resource group
492
- #
493
- # @param resource_group_name [String] The name of the resource group within the
494
- # user's subscription.
495
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
496
- # will be added to the HTTP request.
497
- #
498
- # @return [CognitiveServicesAccountListResult] operation results.
499
- #
500
- def list_by_resource_group(resource_group_name, custom_headers = nil)
501
- response = list_by_resource_group_async(resource_group_name, custom_headers).value!
502
- response.body unless response.nil?
503
- end
504
-
505
- #
506
- # Returns all the resources of a particular type belonging to a resource group
507
- #
508
- # @param resource_group_name [String] The name of the resource group within the
509
- # user's subscription.
510
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
511
- # will be added to the HTTP request.
512
- #
513
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
514
- #
515
- def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
516
- list_by_resource_group_async(resource_group_name, custom_headers).value!
517
- end
518
-
519
- #
520
- # Returns all the resources of a particular type belonging to a resource group
521
- #
522
- # @param resource_group_name [String] The name of the resource group within the
523
- # user's subscription.
524
- # @param [Hash{String => String}] A hash of custom headers that will be added
525
- # to the HTTP request.
526
- #
527
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
528
- #
529
- def list_by_resource_group_async(resource_group_name, custom_headers = nil)
530
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
531
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
532
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
-
534
-
535
- request_headers = {}
536
-
537
- # Set Headers
538
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
539
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
540
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts'
541
-
542
- request_url = @base_url || @client.base_url
543
-
544
- options = {
545
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
546
- path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
547
- query_params: {'api-version' => @client.api_version},
548
- headers: request_headers.merge(custom_headers || {}),
549
- base_url: request_url
550
- }
551
- promise = @client.make_request_async(:get, path_template, options)
552
-
553
- promise = promise.then do |result|
554
- http_response = result.response
555
- status_code = http_response.status
556
- response_content = http_response.body
557
- unless status_code == 200
558
- error_model = JSON.load(response_content)
559
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
560
- end
561
-
562
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
563
- # Deserialize Response
564
- if status_code == 200
565
- begin
566
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
567
- result_mapper = CognitiveServicesAccountListResult.mapper()
568
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
569
- rescue Exception => e
570
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
571
- end
572
- end
573
-
574
- result
575
- end
576
-
577
- promise.execute
578
- end
579
-
580
- #
581
- # Returns all the resources of a particular type belonging to a subscription.
582
- #
583
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
584
- # will be added to the HTTP request.
585
- #
586
- # @return [CognitiveServicesAccountListResult] operation results.
587
- #
588
- def list(custom_headers = nil)
589
- response = list_async(custom_headers).value!
590
- response.body unless response.nil?
591
- end
592
-
593
- #
594
- # Returns all the resources of a particular type belonging to a subscription.
595
- #
596
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
597
- # will be added to the HTTP request.
598
- #
599
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
600
- #
601
- def list_with_http_info(custom_headers = nil)
602
- list_async(custom_headers).value!
603
- end
604
-
605
- #
606
- # Returns all the resources of a particular type belonging to a subscription.
607
- #
608
- # @param [Hash{String => String}] A hash of custom headers that will be added
609
- # to the HTTP request.
610
- #
611
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
612
- #
613
- def list_async(custom_headers = nil)
614
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
615
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
616
-
617
-
618
- request_headers = {}
619
-
620
- # Set Headers
621
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
622
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
623
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts'
624
-
625
- request_url = @base_url || @client.base_url
626
-
627
- options = {
628
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
629
- path_params: {'subscriptionId' => @client.subscription_id},
630
- query_params: {'api-version' => @client.api_version},
631
- headers: request_headers.merge(custom_headers || {}),
632
- base_url: request_url
633
- }
634
- promise = @client.make_request_async(:get, path_template, options)
635
-
636
- promise = promise.then do |result|
637
- http_response = result.response
638
- status_code = http_response.status
639
- response_content = http_response.body
640
- unless status_code == 200
641
- error_model = JSON.load(response_content)
642
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
643
- end
644
-
645
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
646
- # Deserialize Response
647
- if status_code == 200
648
- begin
649
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
650
- result_mapper = CognitiveServicesAccountListResult.mapper()
651
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
440
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
441
+ result.body = @client.deserialize(result_mapper, parsed_response)
652
442
  rescue Exception => e
653
443
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
654
444
  end
@@ -665,10 +455,7 @@ module Azure::ARM::CognitiveServices
665
455
  #
666
456
  # @param resource_group_name [String] The name of the resource group within the
667
457
  # user's subscription.
668
- # @param account_name [String] The name of the cognitive services account
669
- # within the specified resource group. Congitive Services account names must be
670
- # between 3 and 24 characters in length and use numbers and lower-case letters
671
- # only.
458
+ # @param account_name [String] The name of Cognitive Services account.
672
459
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
673
460
  # will be added to the HTTP request.
674
461
  #
@@ -684,10 +471,7 @@ module Azure::ARM::CognitiveServices
684
471
  #
685
472
  # @param resource_group_name [String] The name of the resource group within the
686
473
  # user's subscription.
687
- # @param account_name [String] The name of the cognitive services account
688
- # within the specified resource group. Congitive Services account names must be
689
- # between 3 and 24 characters in length and use numbers and lower-case letters
690
- # only.
474
+ # @param account_name [String] The name of Cognitive Services account.
691
475
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
692
476
  # will be added to the HTTP request.
693
477
  #
@@ -702,10 +486,7 @@ module Azure::ARM::CognitiveServices
702
486
  #
703
487
  # @param resource_group_name [String] The name of the resource group within the
704
488
  # user's subscription.
705
- # @param account_name [String] The name of the cognitive services account
706
- # within the specified resource group. Congitive Services account names must be
707
- # between 3 and 24 characters in length and use numbers and lower-case letters
708
- # only.
489
+ # @param account_name [String] The name of Cognitive Services account.
709
490
  # @param [Hash{String => String}] A hash of custom headers that will be added
710
491
  # to the HTTP request.
711
492
  #
@@ -723,7 +504,7 @@ module Azure::ARM::CognitiveServices
723
504
  # Set Headers
724
505
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
725
506
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
726
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys'
507
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys'
727
508
 
728
509
  request_url = @base_url || @client.base_url
729
510
 
@@ -750,8 +531,8 @@ module Azure::ARM::CognitiveServices
750
531
  if status_code == 200
751
532
  begin
752
533
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
753
- result_mapper = CognitiveServicesAccountKeys.mapper()
754
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
534
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountKeys.mapper()
535
+ result.body = @client.deserialize(result_mapper, parsed_response)
755
536
  rescue Exception => e
756
537
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
757
538
  end
@@ -769,10 +550,7 @@ module Azure::ARM::CognitiveServices
769
550
  #
770
551
  # @param resource_group_name [String] The name of the resource group within the
771
552
  # user's subscription.
772
- # @param account_name [String] The name of the cognitive services account
773
- # within the specified resource group. Cognitive Services account names must be
774
- # between 3 and 24 characters in length and use numbers and lower-case letters
775
- # only.
553
+ # @param account_name [String] The name of Cognitive Services account.
776
554
  # @param key_name [KeyName] key name to generate (Key1|Key2). Possible values
777
555
  # include: 'Key1', 'Key2'
778
556
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -780,7 +558,7 @@ module Azure::ARM::CognitiveServices
780
558
  #
781
559
  # @return [CognitiveServicesAccountKeys] operation results.
782
560
  #
783
- def regenerate_key(resource_group_name, account_name, key_name = nil, custom_headers = nil)
561
+ def regenerate_key(resource_group_name, account_name, key_name, custom_headers = nil)
784
562
  response = regenerate_key_async(resource_group_name, account_name, key_name, custom_headers).value!
785
563
  response.body unless response.nil?
786
564
  end
@@ -791,10 +569,7 @@ module Azure::ARM::CognitiveServices
791
569
  #
792
570
  # @param resource_group_name [String] The name of the resource group within the
793
571
  # user's subscription.
794
- # @param account_name [String] The name of the cognitive services account
795
- # within the specified resource group. Cognitive Services account names must be
796
- # between 3 and 24 characters in length and use numbers and lower-case letters
797
- # only.
572
+ # @param account_name [String] The name of Cognitive Services account.
798
573
  # @param key_name [KeyName] key name to generate (Key1|Key2). Possible values
799
574
  # include: 'Key1', 'Key2'
800
575
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -802,7 +577,7 @@ module Azure::ARM::CognitiveServices
802
577
  #
803
578
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
804
579
  #
805
- def regenerate_key_with_http_info(resource_group_name, account_name, key_name = nil, custom_headers = nil)
580
+ def regenerate_key_with_http_info(resource_group_name, account_name, key_name, custom_headers = nil)
806
581
  regenerate_key_async(resource_group_name, account_name, key_name, custom_headers).value!
807
582
  end
808
583
 
@@ -812,10 +587,7 @@ module Azure::ARM::CognitiveServices
812
587
  #
813
588
  # @param resource_group_name [String] The name of the resource group within the
814
589
  # user's subscription.
815
- # @param account_name [String] The name of the cognitive services account
816
- # within the specified resource group. Cognitive Services account names must be
817
- # between 3 and 24 characters in length and use numbers and lower-case letters
818
- # only.
590
+ # @param account_name [String] The name of Cognitive Services account.
819
591
  # @param key_name [KeyName] key name to generate (Key1|Key2). Possible values
820
592
  # include: 'Key1', 'Key2'
821
593
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -823,15 +595,16 @@ module Azure::ARM::CognitiveServices
823
595
  #
824
596
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
825
597
  #
826
- def regenerate_key_async(resource_group_name, account_name, key_name = nil, custom_headers = nil)
598
+ def regenerate_key_async(resource_group_name, account_name, key_name, custom_headers = nil)
827
599
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
828
600
  fail ArgumentError, 'account_name is nil' if account_name.nil?
829
601
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
830
602
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
603
+ fail ArgumentError, 'key_name is nil' if key_name.nil?
831
604
 
832
- body = RegenerateKeyParameters.new
605
+ parameters = RegenerateKeyParameters.new
833
606
  unless key_name.nil?
834
- body.key_name = key_name
607
+ parameters.key_name = key_name
835
608
  end
836
609
 
837
610
  request_headers = {}
@@ -843,11 +616,11 @@ module Azure::ARM::CognitiveServices
843
616
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
844
617
 
845
618
  # Serialize Request
846
- request_mapper = RegenerateKeyParameters.mapper()
847
- request_content = @client.serialize(request_mapper, body, 'body')
619
+ request_mapper = Azure::ARM::CognitiveServices::Models::RegenerateKeyParameters.mapper()
620
+ request_content = @client.serialize(request_mapper, parameters)
848
621
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
849
622
 
850
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey'
623
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey'
851
624
 
852
625
  request_url = @base_url || @client.base_url
853
626
 
@@ -875,8 +648,8 @@ module Azure::ARM::CognitiveServices
875
648
  if status_code == 200
876
649
  begin
877
650
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
878
- result_mapper = CognitiveServicesAccountKeys.mapper()
879
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
651
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountKeys.mapper()
652
+ result.body = @client.deserialize(result_mapper, parsed_response)
880
653
  rescue Exception => e
881
654
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
882
655
  end
@@ -893,10 +666,7 @@ module Azure::ARM::CognitiveServices
893
666
  #
894
667
  # @param resource_group_name [String] The name of the resource group within the
895
668
  # user's subscription.
896
- # @param account_name [String] The name of the cognitive services account
897
- # within the specified resource group. Cognitive Services account names must be
898
- # between 3 and 24 characters in length and use numbers and lower-case letters
899
- # only.
669
+ # @param account_name [String] The name of Cognitive Services account.
900
670
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
901
671
  # will be added to the HTTP request.
902
672
  #
@@ -912,10 +682,7 @@ module Azure::ARM::CognitiveServices
912
682
  #
913
683
  # @param resource_group_name [String] The name of the resource group within the
914
684
  # user's subscription.
915
- # @param account_name [String] The name of the cognitive services account
916
- # within the specified resource group. Cognitive Services account names must be
917
- # between 3 and 24 characters in length and use numbers and lower-case letters
918
- # only.
685
+ # @param account_name [String] The name of Cognitive Services account.
919
686
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
920
687
  # will be added to the HTTP request.
921
688
  #
@@ -930,10 +697,7 @@ module Azure::ARM::CognitiveServices
930
697
  #
931
698
  # @param resource_group_name [String] The name of the resource group within the
932
699
  # user's subscription.
933
- # @param account_name [String] The name of the cognitive services account
934
- # within the specified resource group. Cognitive Services account names must be
935
- # between 3 and 24 characters in length and use numbers and lower-case letters
936
- # only.
700
+ # @param account_name [String] The name of Cognitive Services account.
937
701
  # @param [Hash{String => String}] A hash of custom headers that will be added
938
702
  # to the HTTP request.
939
703
  #
@@ -951,7 +715,7 @@ module Azure::ARM::CognitiveServices
951
715
  # Set Headers
952
716
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
953
717
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
954
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus'
718
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus'
955
719
 
956
720
  request_url = @base_url || @client.base_url
957
721
 
@@ -978,8 +742,8 @@ module Azure::ARM::CognitiveServices
978
742
  if status_code == 200
979
743
  begin
980
744
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
981
- result_mapper = CognitiveServicesAccountEnumerateSkusResult.mapper()
982
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
745
+ result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountEnumerateSkusResult.mapper()
746
+ result.body = @client.deserialize(result_mapper, parsed_response)
983
747
  rescue Exception => e
984
748
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
985
749
  end