azure_mgmt_cognitive_services 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_cognitive_services.rb +1 -2
- data/lib/generated/azure_mgmt_cognitive_services/accounts.rb +735 -1
- data/lib/generated/azure_mgmt_cognitive_services/check_sku_availability.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +1 -5
- data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_parameter.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result_list.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_enumerate_skus_result.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_keys.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_update_parameters.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_resource_and_sku.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/error.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/error_body.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/key_name.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/kind.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/operation_display_info.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/operation_entity.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/operation_entity_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/provisioning_state.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/regenerate_key_parameters.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/sku.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/sku_name.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/models/sku_tier.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/module_definition.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/operations.rb +1 -1
- data/lib/generated/azure_mgmt_cognitive_services/version.rb +2 -2
- metadata +2 -3
- data/lib/generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb +0 -759
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
@@ -35,9 +35,6 @@ module Azure::ARM::CognitiveServices
|
|
35
35
|
# is generated and included in each request. Default is true.
|
36
36
|
attr_accessor :generate_client_request_id
|
37
37
|
|
38
|
-
# @return [CognitiveServicesAccounts] cognitive_services_accounts
|
39
|
-
attr_reader :cognitive_services_accounts
|
40
|
-
|
41
38
|
# @return [Accounts] accounts
|
42
39
|
attr_reader :accounts
|
43
40
|
|
@@ -60,7 +57,6 @@ module Azure::ARM::CognitiveServices
|
|
60
57
|
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
61
58
|
@credentials = credentials
|
62
59
|
|
63
|
-
@cognitive_services_accounts = CognitiveServicesAccounts.new(self)
|
64
60
|
@accounts = Accounts.new(self)
|
65
61
|
@operations = Operations.new(self)
|
66
62
|
@check_sku_availability = CheckSkuAvailability.new(self)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
6
|
module Azure::ARM::CognitiveServices
|
7
|
-
VERSION = '0.
|
7
|
+
VERSION = '0.13.0'
|
8
8
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure_mgmt_cognitive_services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,7 +91,6 @@ files:
|
|
91
91
|
- lib/generated/azure_mgmt_cognitive_services.rb
|
92
92
|
- lib/generated/azure_mgmt_cognitive_services/accounts.rb
|
93
93
|
- lib/generated/azure_mgmt_cognitive_services/check_sku_availability.rb
|
94
|
-
- lib/generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb
|
95
94
|
- lib/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb
|
96
95
|
- lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_parameter.rb
|
97
96
|
- lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result.rb
|
@@ -1,759 +0,0 @@
|
|
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 CognitiveServicesAccounts
|
11
|
-
include MsRestAzure
|
12
|
-
|
13
|
-
#
|
14
|
-
# Creates and initializes a new instance of the CognitiveServicesAccounts 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
|
-
# Create Cognitive Services Account. Accounts is a resource group wide resource
|
26
|
-
# type. It holds the keys for developer to access intelligent APIs. It's also
|
27
|
-
# the resource type for billing.
|
28
|
-
#
|
29
|
-
# @param resource_group_name [String] The name of the resource group within the
|
30
|
-
# user's subscription.
|
31
|
-
# @param account_name [String] The name of Cognitive Services account.
|
32
|
-
# @param parameters [CognitiveServicesAccountCreateParameters] The parameters
|
33
|
-
# to provide for the created account.
|
34
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
-
# will be added to the HTTP request.
|
36
|
-
#
|
37
|
-
# @return [CognitiveServicesAccount] operation results.
|
38
|
-
#
|
39
|
-
def create(resource_group_name, account_name, parameters, custom_headers = nil)
|
40
|
-
response = create_async(resource_group_name, account_name, parameters, custom_headers).value!
|
41
|
-
response.body unless response.nil?
|
42
|
-
end
|
43
|
-
|
44
|
-
#
|
45
|
-
# Create Cognitive Services Account. Accounts is a resource group wide resource
|
46
|
-
# type. It holds the keys for developer to access intelligent APIs. It's also
|
47
|
-
# the resource type for billing.
|
48
|
-
#
|
49
|
-
# @param resource_group_name [String] The name of the resource group within the
|
50
|
-
# user's subscription.
|
51
|
-
# @param account_name [String] The name of Cognitive Services account.
|
52
|
-
# @param parameters [CognitiveServicesAccountCreateParameters] The parameters
|
53
|
-
# to provide for the created account.
|
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 create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
|
60
|
-
create_async(resource_group_name, account_name, parameters, custom_headers).value!
|
61
|
-
end
|
62
|
-
|
63
|
-
#
|
64
|
-
# Create Cognitive Services Account. Accounts is a resource group wide resource
|
65
|
-
# type. It holds the keys for developer to access intelligent APIs. It's also
|
66
|
-
# the resource type for billing.
|
67
|
-
#
|
68
|
-
# @param resource_group_name [String] The name of the resource group within the
|
69
|
-
# user's subscription.
|
70
|
-
# @param account_name [String] The name of Cognitive Services account.
|
71
|
-
# @param parameters [CognitiveServicesAccountCreateParameters] The parameters
|
72
|
-
# to provide for the created account.
|
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 create_async(resource_group_name, account_name, parameters, custom_headers = nil)
|
79
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
80
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
81
|
-
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
82
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
83
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
84
|
-
|
85
|
-
|
86
|
-
request_headers = {}
|
87
|
-
|
88
|
-
# Set Headers
|
89
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
90
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
91
|
-
|
92
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
93
|
-
|
94
|
-
# Serialize Request
|
95
|
-
request_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountCreateParameters.mapper()
|
96
|
-
request_content = @client.serialize(request_mapper, parameters)
|
97
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
98
|
-
|
99
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
|
100
|
-
|
101
|
-
request_url = @base_url || @client.base_url
|
102
|
-
|
103
|
-
options = {
|
104
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
105
|
-
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
106
|
-
query_params: {'api-version' => @client.api_version},
|
107
|
-
body: request_content,
|
108
|
-
headers: request_headers.merge(custom_headers || {}),
|
109
|
-
base_url: request_url
|
110
|
-
}
|
111
|
-
promise = @client.make_request_async(:put, path_template, options)
|
112
|
-
|
113
|
-
promise = promise.then do |result|
|
114
|
-
http_response = result.response
|
115
|
-
status_code = http_response.status
|
116
|
-
response_content = http_response.body
|
117
|
-
unless status_code == 200 || status_code == 201
|
118
|
-
error_model = JSON.load(response_content)
|
119
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
120
|
-
end
|
121
|
-
|
122
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
123
|
-
# Deserialize Response
|
124
|
-
if status_code == 200
|
125
|
-
begin
|
126
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
127
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
|
128
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
129
|
-
rescue Exception => e
|
130
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
# Deserialize Response
|
134
|
-
if status_code == 201
|
135
|
-
begin
|
136
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
137
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
|
138
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
139
|
-
rescue Exception => e
|
140
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
result
|
145
|
-
end
|
146
|
-
|
147
|
-
promise.execute
|
148
|
-
end
|
149
|
-
|
150
|
-
#
|
151
|
-
# Updates a Cognitive Services account
|
152
|
-
#
|
153
|
-
# @param resource_group_name [String] The name of the resource group within the
|
154
|
-
# user's subscription.
|
155
|
-
# @param account_name [String] The name of Cognitive Services account.
|
156
|
-
# @param sku [Sku] Gets or sets the SKU of the resource.
|
157
|
-
# @param tags [Hash{String => String}] Gets or sets a list of key value pairs
|
158
|
-
# that describe the resource. These tags can be used in viewing and grouping
|
159
|
-
# this resource (across resource groups). A maximum of 15 tags can be provided
|
160
|
-
# for a resource. Each tag must have a key no greater than 128 characters and
|
161
|
-
# value no greater than 256 characters.
|
162
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
163
|
-
# will be added to the HTTP request.
|
164
|
-
#
|
165
|
-
# @return [CognitiveServicesAccount] operation results.
|
166
|
-
#
|
167
|
-
def update(resource_group_name, account_name, sku = nil, tags = nil, custom_headers = nil)
|
168
|
-
response = update_async(resource_group_name, account_name, sku, tags, custom_headers).value!
|
169
|
-
response.body unless response.nil?
|
170
|
-
end
|
171
|
-
|
172
|
-
#
|
173
|
-
# Updates a Cognitive Services account
|
174
|
-
#
|
175
|
-
# @param resource_group_name [String] The name of the resource group within the
|
176
|
-
# user's subscription.
|
177
|
-
# @param account_name [String] The name of Cognitive Services account.
|
178
|
-
# @param sku [Sku] Gets or sets the SKU of the resource.
|
179
|
-
# @param tags [Hash{String => String}] Gets or sets a list of key value pairs
|
180
|
-
# that describe the resource. These tags can be used in viewing and grouping
|
181
|
-
# this resource (across resource groups). A maximum of 15 tags can be provided
|
182
|
-
# for a resource. Each tag must have a key no greater than 128 characters and
|
183
|
-
# value no greater than 256 characters.
|
184
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
185
|
-
# will be added to the HTTP request.
|
186
|
-
#
|
187
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
188
|
-
#
|
189
|
-
def update_with_http_info(resource_group_name, account_name, sku = nil, tags = nil, custom_headers = nil)
|
190
|
-
update_async(resource_group_name, account_name, sku, tags, custom_headers).value!
|
191
|
-
end
|
192
|
-
|
193
|
-
#
|
194
|
-
# Updates a Cognitive Services account
|
195
|
-
#
|
196
|
-
# @param resource_group_name [String] The name of the resource group within the
|
197
|
-
# user's subscription.
|
198
|
-
# @param account_name [String] The name of Cognitive Services account.
|
199
|
-
# @param sku [Sku] Gets or sets the SKU of the resource.
|
200
|
-
# @param tags [Hash{String => String}] Gets or sets a list of key value pairs
|
201
|
-
# that describe the resource. These tags can be used in viewing and grouping
|
202
|
-
# this resource (across resource groups). A maximum of 15 tags can be provided
|
203
|
-
# for a resource. Each tag must have a key no greater than 128 characters and
|
204
|
-
# value no greater than 256 characters.
|
205
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
206
|
-
# to the HTTP request.
|
207
|
-
#
|
208
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
209
|
-
#
|
210
|
-
def update_async(resource_group_name, account_name, sku = nil, tags = nil, custom_headers = nil)
|
211
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
212
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
213
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
214
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
215
|
-
|
216
|
-
parameters = CognitiveServicesAccountUpdateParameters.new
|
217
|
-
unless sku.nil? && tags.nil?
|
218
|
-
parameters.sku = sku
|
219
|
-
parameters.tags = tags
|
220
|
-
end
|
221
|
-
|
222
|
-
request_headers = {}
|
223
|
-
|
224
|
-
# Set Headers
|
225
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
226
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
227
|
-
|
228
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
229
|
-
|
230
|
-
# Serialize Request
|
231
|
-
request_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountUpdateParameters.mapper()
|
232
|
-
request_content = @client.serialize(request_mapper, parameters)
|
233
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
234
|
-
|
235
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
|
236
|
-
|
237
|
-
request_url = @base_url || @client.base_url
|
238
|
-
|
239
|
-
options = {
|
240
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
241
|
-
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
242
|
-
query_params: {'api-version' => @client.api_version},
|
243
|
-
body: request_content,
|
244
|
-
headers: request_headers.merge(custom_headers || {}),
|
245
|
-
base_url: request_url
|
246
|
-
}
|
247
|
-
promise = @client.make_request_async(:patch, path_template, options)
|
248
|
-
|
249
|
-
promise = promise.then do |result|
|
250
|
-
http_response = result.response
|
251
|
-
status_code = http_response.status
|
252
|
-
response_content = http_response.body
|
253
|
-
unless status_code == 200
|
254
|
-
error_model = JSON.load(response_content)
|
255
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
256
|
-
end
|
257
|
-
|
258
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
259
|
-
# Deserialize Response
|
260
|
-
if status_code == 200
|
261
|
-
begin
|
262
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
263
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
|
264
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
265
|
-
rescue Exception => e
|
266
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
267
|
-
end
|
268
|
-
end
|
269
|
-
|
270
|
-
result
|
271
|
-
end
|
272
|
-
|
273
|
-
promise.execute
|
274
|
-
end
|
275
|
-
|
276
|
-
#
|
277
|
-
# Deletes a Cognitive Services account from the resource group.
|
278
|
-
#
|
279
|
-
# @param resource_group_name [String] The name of the resource group within the
|
280
|
-
# user's subscription.
|
281
|
-
# @param account_name [String] The name of Cognitive Services account.
|
282
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
283
|
-
# will be added to the HTTP request.
|
284
|
-
#
|
285
|
-
#
|
286
|
-
def delete(resource_group_name, account_name, custom_headers = nil)
|
287
|
-
response = delete_async(resource_group_name, account_name, custom_headers).value!
|
288
|
-
nil
|
289
|
-
end
|
290
|
-
|
291
|
-
#
|
292
|
-
# Deletes a Cognitive Services account from the resource group.
|
293
|
-
#
|
294
|
-
# @param resource_group_name [String] The name of the resource group within the
|
295
|
-
# user's subscription.
|
296
|
-
# @param account_name [String] The name of Cognitive Services account.
|
297
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
298
|
-
# will be added to the HTTP request.
|
299
|
-
#
|
300
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
301
|
-
#
|
302
|
-
def delete_with_http_info(resource_group_name, account_name, custom_headers = nil)
|
303
|
-
delete_async(resource_group_name, account_name, custom_headers).value!
|
304
|
-
end
|
305
|
-
|
306
|
-
#
|
307
|
-
# Deletes a Cognitive Services account from the resource group.
|
308
|
-
#
|
309
|
-
# @param resource_group_name [String] The name of the resource group within the
|
310
|
-
# user's subscription.
|
311
|
-
# @param account_name [String] The name of Cognitive Services account.
|
312
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
313
|
-
# to the HTTP request.
|
314
|
-
#
|
315
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
316
|
-
#
|
317
|
-
def delete_async(resource_group_name, account_name, custom_headers = nil)
|
318
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
319
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
320
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
321
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
322
|
-
|
323
|
-
|
324
|
-
request_headers = {}
|
325
|
-
|
326
|
-
# Set Headers
|
327
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
328
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
329
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
|
330
|
-
|
331
|
-
request_url = @base_url || @client.base_url
|
332
|
-
|
333
|
-
options = {
|
334
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
335
|
-
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
336
|
-
query_params: {'api-version' => @client.api_version},
|
337
|
-
headers: request_headers.merge(custom_headers || {}),
|
338
|
-
base_url: request_url
|
339
|
-
}
|
340
|
-
promise = @client.make_request_async(:delete, path_template, options)
|
341
|
-
|
342
|
-
promise = promise.then do |result|
|
343
|
-
http_response = result.response
|
344
|
-
status_code = http_response.status
|
345
|
-
response_content = http_response.body
|
346
|
-
unless status_code == 200 || status_code == 204
|
347
|
-
error_model = JSON.load(response_content)
|
348
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
349
|
-
end
|
350
|
-
|
351
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
352
|
-
|
353
|
-
result
|
354
|
-
end
|
355
|
-
|
356
|
-
promise.execute
|
357
|
-
end
|
358
|
-
|
359
|
-
#
|
360
|
-
# Returns a Cognitive Services account specified by the parameters.
|
361
|
-
#
|
362
|
-
# @param resource_group_name [String] The name of the resource group within the
|
363
|
-
# user's subscription.
|
364
|
-
# @param account_name [String] The name of Cognitive Services account.
|
365
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
366
|
-
# will be added to the HTTP request.
|
367
|
-
#
|
368
|
-
# @return [CognitiveServicesAccount] operation results.
|
369
|
-
#
|
370
|
-
def get_properties(resource_group_name, account_name, custom_headers = nil)
|
371
|
-
response = get_properties_async(resource_group_name, account_name, custom_headers).value!
|
372
|
-
response.body unless response.nil?
|
373
|
-
end
|
374
|
-
|
375
|
-
#
|
376
|
-
# Returns a Cognitive Services account specified by the parameters.
|
377
|
-
#
|
378
|
-
# @param resource_group_name [String] The name of the resource group within the
|
379
|
-
# user's subscription.
|
380
|
-
# @param account_name [String] The name of Cognitive Services account.
|
381
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
382
|
-
# will be added to the HTTP request.
|
383
|
-
#
|
384
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
385
|
-
#
|
386
|
-
def get_properties_with_http_info(resource_group_name, account_name, custom_headers = nil)
|
387
|
-
get_properties_async(resource_group_name, account_name, custom_headers).value!
|
388
|
-
end
|
389
|
-
|
390
|
-
#
|
391
|
-
# Returns a Cognitive Services account specified by the parameters.
|
392
|
-
#
|
393
|
-
# @param resource_group_name [String] The name of the resource group within the
|
394
|
-
# user's subscription.
|
395
|
-
# @param account_name [String] The name of Cognitive Services account.
|
396
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
397
|
-
# to the HTTP request.
|
398
|
-
#
|
399
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
400
|
-
#
|
401
|
-
def get_properties_async(resource_group_name, account_name, custom_headers = nil)
|
402
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
403
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
404
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
405
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
406
|
-
|
407
|
-
|
408
|
-
request_headers = {}
|
409
|
-
|
410
|
-
# Set Headers
|
411
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
412
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
413
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'
|
414
|
-
|
415
|
-
request_url = @base_url || @client.base_url
|
416
|
-
|
417
|
-
options = {
|
418
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
419
|
-
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
420
|
-
query_params: {'api-version' => @client.api_version},
|
421
|
-
headers: request_headers.merge(custom_headers || {}),
|
422
|
-
base_url: request_url
|
423
|
-
}
|
424
|
-
promise = @client.make_request_async(:get, path_template, options)
|
425
|
-
|
426
|
-
promise = promise.then do |result|
|
427
|
-
http_response = result.response
|
428
|
-
status_code = http_response.status
|
429
|
-
response_content = http_response.body
|
430
|
-
unless status_code == 200
|
431
|
-
error_model = JSON.load(response_content)
|
432
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
433
|
-
end
|
434
|
-
|
435
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
436
|
-
# Deserialize Response
|
437
|
-
if status_code == 200
|
438
|
-
begin
|
439
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
440
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccount.mapper()
|
441
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
442
|
-
rescue Exception => e
|
443
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
444
|
-
end
|
445
|
-
end
|
446
|
-
|
447
|
-
result
|
448
|
-
end
|
449
|
-
|
450
|
-
promise.execute
|
451
|
-
end
|
452
|
-
|
453
|
-
#
|
454
|
-
# Lists the account keys for the specified Cognitive Services account.
|
455
|
-
#
|
456
|
-
# @param resource_group_name [String] The name of the resource group within the
|
457
|
-
# user's subscription.
|
458
|
-
# @param account_name [String] The name of Cognitive Services account.
|
459
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
460
|
-
# will be added to the HTTP request.
|
461
|
-
#
|
462
|
-
# @return [CognitiveServicesAccountKeys] operation results.
|
463
|
-
#
|
464
|
-
def list_keys(resource_group_name, account_name, custom_headers = nil)
|
465
|
-
response = list_keys_async(resource_group_name, account_name, custom_headers).value!
|
466
|
-
response.body unless response.nil?
|
467
|
-
end
|
468
|
-
|
469
|
-
#
|
470
|
-
# Lists the account keys for the specified Cognitive Services account.
|
471
|
-
#
|
472
|
-
# @param resource_group_name [String] The name of the resource group within the
|
473
|
-
# user's subscription.
|
474
|
-
# @param account_name [String] The name of Cognitive Services account.
|
475
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
476
|
-
# will be added to the HTTP request.
|
477
|
-
#
|
478
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
479
|
-
#
|
480
|
-
def list_keys_with_http_info(resource_group_name, account_name, custom_headers = nil)
|
481
|
-
list_keys_async(resource_group_name, account_name, custom_headers).value!
|
482
|
-
end
|
483
|
-
|
484
|
-
#
|
485
|
-
# Lists the account keys for the specified Cognitive Services account.
|
486
|
-
#
|
487
|
-
# @param resource_group_name [String] The name of the resource group within the
|
488
|
-
# user's subscription.
|
489
|
-
# @param account_name [String] The name of Cognitive Services account.
|
490
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
491
|
-
# to the HTTP request.
|
492
|
-
#
|
493
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
494
|
-
#
|
495
|
-
def list_keys_async(resource_group_name, account_name, custom_headers = nil)
|
496
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
497
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
498
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
499
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
500
|
-
|
501
|
-
|
502
|
-
request_headers = {}
|
503
|
-
|
504
|
-
# Set Headers
|
505
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
506
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
507
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys'
|
508
|
-
|
509
|
-
request_url = @base_url || @client.base_url
|
510
|
-
|
511
|
-
options = {
|
512
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
513
|
-
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
514
|
-
query_params: {'api-version' => @client.api_version},
|
515
|
-
headers: request_headers.merge(custom_headers || {}),
|
516
|
-
base_url: request_url
|
517
|
-
}
|
518
|
-
promise = @client.make_request_async(:post, path_template, options)
|
519
|
-
|
520
|
-
promise = promise.then do |result|
|
521
|
-
http_response = result.response
|
522
|
-
status_code = http_response.status
|
523
|
-
response_content = http_response.body
|
524
|
-
unless status_code == 200
|
525
|
-
error_model = JSON.load(response_content)
|
526
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
527
|
-
end
|
528
|
-
|
529
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
530
|
-
# Deserialize Response
|
531
|
-
if status_code == 200
|
532
|
-
begin
|
533
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
534
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountKeys.mapper()
|
535
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
536
|
-
rescue Exception => e
|
537
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
538
|
-
end
|
539
|
-
end
|
540
|
-
|
541
|
-
result
|
542
|
-
end
|
543
|
-
|
544
|
-
promise.execute
|
545
|
-
end
|
546
|
-
|
547
|
-
#
|
548
|
-
# Regenerates the specified account key for the specified Cognitive Services
|
549
|
-
# account.
|
550
|
-
#
|
551
|
-
# @param resource_group_name [String] The name of the resource group within the
|
552
|
-
# user's subscription.
|
553
|
-
# @param account_name [String] The name of Cognitive Services account.
|
554
|
-
# @param key_name [KeyName] key name to generate (Key1|Key2). Possible values
|
555
|
-
# include: 'Key1', 'Key2'
|
556
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
557
|
-
# will be added to the HTTP request.
|
558
|
-
#
|
559
|
-
# @return [CognitiveServicesAccountKeys] operation results.
|
560
|
-
#
|
561
|
-
def regenerate_key(resource_group_name, account_name, key_name, custom_headers = nil)
|
562
|
-
response = regenerate_key_async(resource_group_name, account_name, key_name, custom_headers).value!
|
563
|
-
response.body unless response.nil?
|
564
|
-
end
|
565
|
-
|
566
|
-
#
|
567
|
-
# Regenerates the specified account key for the specified Cognitive Services
|
568
|
-
# account.
|
569
|
-
#
|
570
|
-
# @param resource_group_name [String] The name of the resource group within the
|
571
|
-
# user's subscription.
|
572
|
-
# @param account_name [String] The name of Cognitive Services account.
|
573
|
-
# @param key_name [KeyName] key name to generate (Key1|Key2). Possible values
|
574
|
-
# include: 'Key1', 'Key2'
|
575
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
576
|
-
# will be added to the HTTP request.
|
577
|
-
#
|
578
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
579
|
-
#
|
580
|
-
def regenerate_key_with_http_info(resource_group_name, account_name, key_name, custom_headers = nil)
|
581
|
-
regenerate_key_async(resource_group_name, account_name, key_name, custom_headers).value!
|
582
|
-
end
|
583
|
-
|
584
|
-
#
|
585
|
-
# Regenerates the specified account key for the specified Cognitive Services
|
586
|
-
# account.
|
587
|
-
#
|
588
|
-
# @param resource_group_name [String] The name of the resource group within the
|
589
|
-
# user's subscription.
|
590
|
-
# @param account_name [String] The name of Cognitive Services account.
|
591
|
-
# @param key_name [KeyName] key name to generate (Key1|Key2). Possible values
|
592
|
-
# include: 'Key1', 'Key2'
|
593
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
594
|
-
# to the HTTP request.
|
595
|
-
#
|
596
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
597
|
-
#
|
598
|
-
def regenerate_key_async(resource_group_name, account_name, key_name, custom_headers = nil)
|
599
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
600
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
601
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
602
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
603
|
-
fail ArgumentError, 'key_name is nil' if key_name.nil?
|
604
|
-
|
605
|
-
parameters = RegenerateKeyParameters.new
|
606
|
-
unless key_name.nil?
|
607
|
-
parameters.key_name = key_name
|
608
|
-
end
|
609
|
-
|
610
|
-
request_headers = {}
|
611
|
-
|
612
|
-
# Set Headers
|
613
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
614
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
615
|
-
|
616
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
617
|
-
|
618
|
-
# Serialize Request
|
619
|
-
request_mapper = Azure::ARM::CognitiveServices::Models::RegenerateKeyParameters.mapper()
|
620
|
-
request_content = @client.serialize(request_mapper, parameters)
|
621
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
622
|
-
|
623
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey'
|
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: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
630
|
-
query_params: {'api-version' => @client.api_version},
|
631
|
-
body: request_content,
|
632
|
-
headers: request_headers.merge(custom_headers || {}),
|
633
|
-
base_url: request_url
|
634
|
-
}
|
635
|
-
promise = @client.make_request_async(:post, path_template, options)
|
636
|
-
|
637
|
-
promise = promise.then do |result|
|
638
|
-
http_response = result.response
|
639
|
-
status_code = http_response.status
|
640
|
-
response_content = http_response.body
|
641
|
-
unless status_code == 200
|
642
|
-
error_model = JSON.load(response_content)
|
643
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
644
|
-
end
|
645
|
-
|
646
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
647
|
-
# Deserialize Response
|
648
|
-
if status_code == 200
|
649
|
-
begin
|
650
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
651
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountKeys.mapper()
|
652
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
653
|
-
rescue Exception => e
|
654
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
655
|
-
end
|
656
|
-
end
|
657
|
-
|
658
|
-
result
|
659
|
-
end
|
660
|
-
|
661
|
-
promise.execute
|
662
|
-
end
|
663
|
-
|
664
|
-
#
|
665
|
-
# List available SKUs for the requested Cognitive Services account
|
666
|
-
#
|
667
|
-
# @param resource_group_name [String] The name of the resource group within the
|
668
|
-
# user's subscription.
|
669
|
-
# @param account_name [String] The name of Cognitive Services account.
|
670
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
671
|
-
# will be added to the HTTP request.
|
672
|
-
#
|
673
|
-
# @return [CognitiveServicesAccountEnumerateSkusResult] operation results.
|
674
|
-
#
|
675
|
-
def list_skus(resource_group_name, account_name, custom_headers = nil)
|
676
|
-
response = list_skus_async(resource_group_name, account_name, custom_headers).value!
|
677
|
-
response.body unless response.nil?
|
678
|
-
end
|
679
|
-
|
680
|
-
#
|
681
|
-
# List available SKUs for the requested Cognitive Services account
|
682
|
-
#
|
683
|
-
# @param resource_group_name [String] The name of the resource group within the
|
684
|
-
# user's subscription.
|
685
|
-
# @param account_name [String] The name of Cognitive Services account.
|
686
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
687
|
-
# will be added to the HTTP request.
|
688
|
-
#
|
689
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
690
|
-
#
|
691
|
-
def list_skus_with_http_info(resource_group_name, account_name, custom_headers = nil)
|
692
|
-
list_skus_async(resource_group_name, account_name, custom_headers).value!
|
693
|
-
end
|
694
|
-
|
695
|
-
#
|
696
|
-
# List available SKUs for the requested Cognitive Services account
|
697
|
-
#
|
698
|
-
# @param resource_group_name [String] The name of the resource group within the
|
699
|
-
# user's subscription.
|
700
|
-
# @param account_name [String] The name of Cognitive Services account.
|
701
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
702
|
-
# to the HTTP request.
|
703
|
-
#
|
704
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
705
|
-
#
|
706
|
-
def list_skus_async(resource_group_name, account_name, custom_headers = nil)
|
707
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
708
|
-
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
709
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
710
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
711
|
-
|
712
|
-
|
713
|
-
request_headers = {}
|
714
|
-
|
715
|
-
# Set Headers
|
716
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
717
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
718
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus'
|
719
|
-
|
720
|
-
request_url = @base_url || @client.base_url
|
721
|
-
|
722
|
-
options = {
|
723
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
724
|
-
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
725
|
-
query_params: {'api-version' => @client.api_version},
|
726
|
-
headers: request_headers.merge(custom_headers || {}),
|
727
|
-
base_url: request_url
|
728
|
-
}
|
729
|
-
promise = @client.make_request_async(:get, path_template, options)
|
730
|
-
|
731
|
-
promise = promise.then do |result|
|
732
|
-
http_response = result.response
|
733
|
-
status_code = http_response.status
|
734
|
-
response_content = http_response.body
|
735
|
-
unless status_code == 200
|
736
|
-
error_model = JSON.load(response_content)
|
737
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
738
|
-
end
|
739
|
-
|
740
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
741
|
-
# Deserialize Response
|
742
|
-
if status_code == 200
|
743
|
-
begin
|
744
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
745
|
-
result_mapper = Azure::ARM::CognitiveServices::Models::CognitiveServicesAccountEnumerateSkusResult.mapper()
|
746
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
747
|
-
rescue Exception => e
|
748
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
749
|
-
end
|
750
|
-
end
|
751
|
-
|
752
|
-
result
|
753
|
-
end
|
754
|
-
|
755
|
-
promise.execute
|
756
|
-
end
|
757
|
-
|
758
|
-
end
|
759
|
-
end
|