azure_mgmt_cognitive_services 0.19.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +1 -1
  3. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services.rb +34 -18
  4. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/accounts.rb +103 -56
  5. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +15 -4
  6. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/azure_entity_resource.rb +75 -0
  7. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_properties.rb +57 -0
  8. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint.rb +47 -0
  9. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_connection.rb +74 -0
  10. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_connection_properties.rb +80 -0
  11. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_endpoint_service_connection_status.rb +18 -0
  12. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_resource.rb +74 -0
  13. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_resource_list_result.rb +55 -0
  14. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_resource_properties.rb +100 -0
  15. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/private_link_service_connection_state.rb +73 -0
  16. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/proxy_resource.rb +63 -0
  17. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/public_network_access.rb +16 -0
  18. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/resource.rb +83 -0
  19. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/sku_capability.rb +57 -0
  20. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/tracked_resource.rb +92 -0
  21. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/operations.rb +1 -0
  22. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/private_endpoint_connections.rb +373 -0
  23. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/private_link_resources.rb +133 -0
  24. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/resource_skus.rb +2 -0
  25. data/lib/profiles/latest/modules/cognitiveservices_profile_module.rb +117 -57
  26. data/lib/version.rb +1 -1
  27. metadata +20 -4
@@ -0,0 +1,92 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Mgmt::V2017_04_18
7
+ module Models
8
+ #
9
+ # The resource model definition for a ARM tracked top level resource
10
+ #
11
+ class TrackedResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] Resource tags.
16
+ attr_accessor :tags
17
+
18
+ # @return [String] The geo-location where the resource lives
19
+ attr_accessor :location
20
+
21
+
22
+ #
23
+ # Mapper for TrackedResource class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'TrackedResource',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'TrackedResource',
34
+ model_properties: {
35
+ id: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'id',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ name: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'name',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ },
53
+ type: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'type',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ tags: {
63
+ client_side_validation: true,
64
+ required: false,
65
+ serialized_name: 'tags',
66
+ type: {
67
+ name: 'Dictionary',
68
+ value: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'StringElementType',
72
+ type: {
73
+ name: 'String'
74
+ }
75
+ }
76
+ }
77
+ },
78
+ location: {
79
+ client_side_validation: true,
80
+ required: true,
81
+ serialized_name: 'location',
82
+ type: {
83
+ name: 'String'
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ end
90
+ end
91
+ end
92
+ end
@@ -56,6 +56,7 @@ module Azure::CognitiveServices::Mgmt::V2017_04_18
56
56
  #
57
57
  def list_async(custom_headers:nil)
58
58
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
59
60
 
60
61
 
61
62
  request_headers = {}
@@ -0,0 +1,373 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::Mgmt::V2017_04_18
7
+ #
8
+ # Cognitive Services Management Client
9
+ #
10
+ class PrivateEndpointConnections
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateEndpointConnections 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
+ # Gets the specified private endpoint connection associated with the Cognitive
26
+ # Services account.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group. The name
29
+ # is case insensitive.
30
+ # @param account_name [String] The name of Cognitive Services account.
31
+ # @param private_endpoint_connection_name [String] The name of the private
32
+ # endpoint connection associated with the Cognitive Services Account
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [PrivateEndpointConnection] operation results.
37
+ #
38
+ def get(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
39
+ response = get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Gets the specified private endpoint connection associated with the Cognitive
45
+ # Services account.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group. The name
48
+ # is case insensitive.
49
+ # @param account_name [String] The name of Cognitive Services account.
50
+ # @param private_endpoint_connection_name [String] The name of the private
51
+ # endpoint connection associated with the Cognitive Services Account
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def get_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
58
+ get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Gets the specified private endpoint connection associated with the Cognitive
63
+ # Services account.
64
+ #
65
+ # @param resource_group_name [String] The name of the resource group. The name
66
+ # is case insensitive.
67
+ # @param account_name [String] The name of Cognitive Services account.
68
+ # @param private_endpoint_connection_name [String] The name of the private
69
+ # endpoint connection associated with the Cognitive Services Account
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
76
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
77
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
78
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
80
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
81
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
82
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
83
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
84
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
85
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
86
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
87
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
88
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
89
+
90
+
91
+ request_headers = {}
92
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
93
+
94
+ # Set Headers
95
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
96
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
97
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
98
+
99
+ request_url = @base_url || @client.base_url
100
+
101
+ options = {
102
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
103
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
104
+ query_params: {'api-version' => @client.api_version},
105
+ headers: request_headers.merge(custom_headers || {}),
106
+ base_url: request_url
107
+ }
108
+ promise = @client.make_request_async(:get, path_template, options)
109
+
110
+ promise = promise.then do |result|
111
+ http_response = result.response
112
+ status_code = http_response.status
113
+ response_content = http_response.body
114
+ unless status_code == 200
115
+ error_model = JSON.load(response_content)
116
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
117
+ end
118
+
119
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
120
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
121
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
122
+ # Deserialize Response
123
+ if status_code == 200
124
+ begin
125
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
126
+ result_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnection.mapper()
127
+ result.body = @client.deserialize(result_mapper, parsed_response)
128
+ rescue Exception => e
129
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
130
+ end
131
+ end
132
+
133
+ result
134
+ end
135
+
136
+ promise.execute
137
+ end
138
+
139
+ #
140
+ # Update the state of specified private endpoint connection associated with the
141
+ # Cognitive Services account.
142
+ #
143
+ # @param resource_group_name [String] The name of the resource group. The name
144
+ # is case insensitive.
145
+ # @param account_name [String] The name of Cognitive Services account.
146
+ # @param private_endpoint_connection_name [String] The name of the private
147
+ # endpoint connection associated with the Cognitive Services Account
148
+ # @param properties [PrivateEndpointConnection] The private endpoint connection
149
+ # properties.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [PrivateEndpointConnection] operation results.
154
+ #
155
+ def create_or_update(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
156
+ response = create_or_update_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
157
+ response.body unless response.nil?
158
+ end
159
+
160
+ #
161
+ # Update the state of specified private endpoint connection associated with the
162
+ # Cognitive Services account.
163
+ #
164
+ # @param resource_group_name [String] The name of the resource group. The name
165
+ # is case insensitive.
166
+ # @param account_name [String] The name of Cognitive Services account.
167
+ # @param private_endpoint_connection_name [String] The name of the private
168
+ # endpoint connection associated with the Cognitive Services Account
169
+ # @param properties [PrivateEndpointConnection] The private endpoint connection
170
+ # properties.
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
175
+ #
176
+ def create_or_update_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
177
+ create_or_update_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
178
+ end
179
+
180
+ #
181
+ # Update the state of specified private endpoint connection associated with the
182
+ # Cognitive Services account.
183
+ #
184
+ # @param resource_group_name [String] The name of the resource group. The name
185
+ # is case insensitive.
186
+ # @param account_name [String] The name of Cognitive Services account.
187
+ # @param private_endpoint_connection_name [String] The name of the private
188
+ # endpoint connection associated with the Cognitive Services Account
189
+ # @param properties [PrivateEndpointConnection] The private endpoint connection
190
+ # properties.
191
+ # @param [Hash{String => String}] A hash of custom headers that will be added
192
+ # to the HTTP request.
193
+ #
194
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
195
+ #
196
+ def create_or_update_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
197
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
198
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
199
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
200
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
201
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
202
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
203
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
204
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
205
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
206
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
207
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
208
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
209
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
210
+ fail ArgumentError, 'properties is nil' if properties.nil?
211
+
212
+
213
+ request_headers = {}
214
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
215
+
216
+ # Set Headers
217
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
218
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
219
+
220
+ # Serialize Request
221
+ request_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnection.mapper()
222
+ request_content = @client.serialize(request_mapper, properties)
223
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
224
+
225
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
226
+
227
+ request_url = @base_url || @client.base_url
228
+
229
+ options = {
230
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
231
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
232
+ query_params: {'api-version' => @client.api_version},
233
+ body: request_content,
234
+ headers: request_headers.merge(custom_headers || {}),
235
+ base_url: request_url
236
+ }
237
+ promise = @client.make_request_async(:put, path_template, options)
238
+
239
+ promise = promise.then do |result|
240
+ http_response = result.response
241
+ status_code = http_response.status
242
+ response_content = http_response.body
243
+ unless status_code == 200
244
+ error_model = JSON.load(response_content)
245
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
246
+ end
247
+
248
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
249
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
250
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
251
+ # Deserialize Response
252
+ if status_code == 200
253
+ begin
254
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
255
+ result_mapper = Azure::CognitiveServices::Mgmt::V2017_04_18::Models::PrivateEndpointConnection.mapper()
256
+ result.body = @client.deserialize(result_mapper, parsed_response)
257
+ rescue Exception => e
258
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
259
+ end
260
+ end
261
+
262
+ result
263
+ end
264
+
265
+ promise.execute
266
+ end
267
+
268
+ #
269
+ # Deletes the specified private endpoint connection associated with the
270
+ # Cognitive Services account.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group. The name
273
+ # is case insensitive.
274
+ # @param account_name [String] The name of Cognitive Services account.
275
+ # @param private_endpoint_connection_name [String] The name of the private
276
+ # endpoint connection associated with the Cognitive Services Account
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ #
281
+ def delete(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
282
+ response = delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
283
+ nil
284
+ end
285
+
286
+ #
287
+ # Deletes the specified private endpoint connection associated with the
288
+ # Cognitive Services account.
289
+ #
290
+ # @param resource_group_name [String] The name of the resource group. The name
291
+ # is case insensitive.
292
+ # @param account_name [String] The name of Cognitive Services account.
293
+ # @param private_endpoint_connection_name [String] The name of the private
294
+ # endpoint connection associated with the Cognitive Services Account
295
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
296
+ # will be added to the HTTP request.
297
+ #
298
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
299
+ #
300
+ def delete_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
301
+ delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
302
+ end
303
+
304
+ #
305
+ # Deletes the specified private endpoint connection associated with the
306
+ # Cognitive Services account.
307
+ #
308
+ # @param resource_group_name [String] The name of the resource group. The name
309
+ # is case insensitive.
310
+ # @param account_name [String] The name of Cognitive Services account.
311
+ # @param private_endpoint_connection_name [String] The name of the private
312
+ # endpoint connection associated with the Cognitive Services Account
313
+ # @param [Hash{String => String}] A hash of custom headers that will be added
314
+ # to the HTTP request.
315
+ #
316
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
317
+ #
318
+ def delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
319
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
320
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
321
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
322
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
323
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
324
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '64'" if !account_name.nil? && account_name.length > 64
325
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '2'" if !account_name.nil? && account_name.length < 2
326
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
327
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
328
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
329
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
330
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
331
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
332
+
333
+
334
+ request_headers = {}
335
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
336
+
337
+ # Set Headers
338
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
339
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
340
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
341
+
342
+ request_url = @base_url || @client.base_url
343
+
344
+ options = {
345
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
346
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
347
+ query_params: {'api-version' => @client.api_version},
348
+ headers: request_headers.merge(custom_headers || {}),
349
+ base_url: request_url
350
+ }
351
+ promise = @client.make_request_async(:delete, path_template, options)
352
+
353
+ promise = promise.then do |result|
354
+ http_response = result.response
355
+ status_code = http_response.status
356
+ response_content = http_response.body
357
+ unless status_code == 200 || status_code == 204
358
+ error_model = JSON.load(response_content)
359
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
360
+ end
361
+
362
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
363
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
364
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
365
+
366
+ result
367
+ end
368
+
369
+ promise.execute
370
+ end
371
+
372
+ end
373
+ end