azure_mgmt_key_vault 0.17.6 → 0.17.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  3. data/lib/2016-10-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  4. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  5. data/lib/2018-02-14/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  6. data/lib/2019-09-01/generated/azure_mgmt_key_vault.rb +86 -0
  7. data/lib/2019-09-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +149 -0
  8. data/lib/2019-09-01/generated/azure_mgmt_key_vault/keys.rb +806 -0
  9. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +86 -0
  10. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +17 -0
  11. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/attributes.rb +111 -0
  12. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +31 -0
  13. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +77 -0
  14. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/create_mode.rb +16 -0
  15. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault.rb +83 -0
  16. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb +98 -0
  17. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb +103 -0
  18. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deletion_recovery_level.rb +18 -0
  19. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/iprule.rb +49 -0
  20. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_curve_name.rb +18 -0
  21. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_operation.rb +21 -0
  22. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_type.rb +18 -0
  23. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key.rb +184 -0
  24. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_attributes.rb +86 -0
  25. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_create_parameters.rb +67 -0
  26. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_list_result.rb +98 -0
  27. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_permissions.rb +31 -0
  28. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_properties.rb +131 -0
  29. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/log_specification.rb +68 -0
  30. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_action.rb +16 -0
  31. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_bypass_options.rb +16 -0
  32. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_set.rb +103 -0
  33. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/operation.rb +83 -0
  34. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/operation_display.rb +79 -0
  35. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/operation_list_result.rb +100 -0
  36. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/permissions.rb +111 -0
  37. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint.rb +47 -0
  38. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection.rb +127 -0
  39. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection_item.rb +74 -0
  40. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection_provisioning_state.rb +20 -0
  41. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_service_connection_status.rb +18 -0
  42. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_link_resource.rb +140 -0
  43. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_link_resource_list_result.rb +55 -0
  44. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_link_service_connection_state.rb +73 -0
  45. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/reason.rb +16 -0
  46. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/resource.rb +113 -0
  47. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb +98 -0
  48. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/secret_permissions.rb +23 -0
  49. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/service_specification.rb +55 -0
  50. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/sku.rb +62 -0
  51. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/sku_name.rb +16 -0
  52. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/storage_permissions.rb +29 -0
  53. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault.rb +115 -0
  54. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +95 -0
  55. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +57 -0
  56. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +60 -0
  57. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +80 -0
  58. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb +98 -0
  59. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +67 -0
  60. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +205 -0
  61. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_properties.rb +248 -0
  62. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/virtual_network_rule.rb +48 -0
  63. data/lib/2019-09-01/generated/azure_mgmt_key_vault/module_definition.rb +9 -0
  64. data/lib/2019-09-01/generated/azure_mgmt_key_vault/operations.rb +220 -0
  65. data/lib/2019-09-01/generated/azure_mgmt_key_vault/private_endpoint_connections.rb +410 -0
  66. data/lib/2019-09-01/generated/azure_mgmt_key_vault/private_link_resources.rb +124 -0
  67. data/lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb +1771 -0
  68. data/lib/azure_mgmt_key_vault.rb +4 -3
  69. data/lib/version.rb +1 -1
  70. metadata +65 -3
@@ -0,0 +1,410 @@
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::KeyVault::Mgmt::V2019_09_01
7
+ #
8
+ # The Azure management API provides a RESTful set of web services that
9
+ # interact with Azure Key Vault.
10
+ #
11
+ class PrivateEndpointConnections
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the PrivateEndpointConnections class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [KeyVaultManagementClient] reference to the KeyVaultManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets the specified private endpoint connection associated with the key vault.
27
+ #
28
+ # @param resource_group_name [String] Name of the resource group that contains
29
+ # the key vault.
30
+ # @param vault_name [String] The name of the key vault.
31
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
32
+ # connection associated with the key vault.
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, vault_name, private_endpoint_connection_name, custom_headers:nil)
39
+ response = get_async(resource_group_name, vault_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 key vault.
45
+ #
46
+ # @param resource_group_name [String] Name of the resource group that contains
47
+ # the key vault.
48
+ # @param vault_name [String] The name of the key vault.
49
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
50
+ # connection associated with the key vault.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
+ #
56
+ def get_with_http_info(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
57
+ get_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
58
+ end
59
+
60
+ #
61
+ # Gets the specified private endpoint connection associated with the key vault.
62
+ #
63
+ # @param resource_group_name [String] Name of the resource group that contains
64
+ # the key vault.
65
+ # @param vault_name [String] The name of the key vault.
66
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
67
+ # connection associated with the key vault.
68
+ # @param [Hash{String => String}] A hash of custom headers that will be added
69
+ # to the HTTP request.
70
+ #
71
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
72
+ #
73
+ def get_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
77
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
78
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
79
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
80
+
81
+
82
+ request_headers = {}
83
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
84
+
85
+ # Set Headers
86
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
95
+ query_params: {'api-version' => @client.api_version},
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:get, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 200
106
+ error_model = JSON.load(response_content)
107
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
112
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
113
+ # Deserialize Response
114
+ if status_code == 200
115
+ begin
116
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
117
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::PrivateEndpointConnection.mapper()
118
+ result.body = @client.deserialize(result_mapper, parsed_response)
119
+ rescue Exception => e
120
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
121
+ end
122
+ end
123
+
124
+ result
125
+ end
126
+
127
+ promise.execute
128
+ end
129
+
130
+ #
131
+ # Updates the specified private endpoint connection associated with the key
132
+ # vault.
133
+ #
134
+ # @param resource_group_name [String] Name of the resource group that contains
135
+ # the key vault.
136
+ # @param vault_name [String] The name of the key vault.
137
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
138
+ # connection associated with the key vault.
139
+ # @param properties [PrivateEndpointConnection] The intended state of private
140
+ # endpoint connection.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [PrivateEndpointConnection] operation results.
145
+ #
146
+ def put(resource_group_name, vault_name, private_endpoint_connection_name, properties, custom_headers:nil)
147
+ response = put_async(resource_group_name, vault_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
148
+ response.body unless response.nil?
149
+ end
150
+
151
+ #
152
+ # Updates the specified private endpoint connection associated with the key
153
+ # vault.
154
+ #
155
+ # @param resource_group_name [String] Name of the resource group that contains
156
+ # the key vault.
157
+ # @param vault_name [String] The name of the key vault.
158
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
159
+ # connection associated with the key vault.
160
+ # @param properties [PrivateEndpointConnection] The intended state of private
161
+ # endpoint connection.
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
166
+ #
167
+ def put_with_http_info(resource_group_name, vault_name, private_endpoint_connection_name, properties, custom_headers:nil)
168
+ put_async(resource_group_name, vault_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
169
+ end
170
+
171
+ #
172
+ # Updates the specified private endpoint connection associated with the key
173
+ # vault.
174
+ #
175
+ # @param resource_group_name [String] Name of the resource group that contains
176
+ # the key vault.
177
+ # @param vault_name [String] The name of the key vault.
178
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
179
+ # connection associated with the key vault.
180
+ # @param properties [PrivateEndpointConnection] The intended state of private
181
+ # endpoint connection.
182
+ # @param [Hash{String => String}] A hash of custom headers that will be added
183
+ # to the HTTP request.
184
+ #
185
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
186
+ #
187
+ def put_async(resource_group_name, vault_name, private_endpoint_connection_name, properties, custom_headers:nil)
188
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
189
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
190
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
191
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
192
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
193
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
194
+ fail ArgumentError, 'properties is nil' if properties.nil?
195
+
196
+
197
+ request_headers = {}
198
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
199
+
200
+ # Set Headers
201
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
202
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
203
+
204
+ # Serialize Request
205
+ request_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::PrivateEndpointConnection.mapper()
206
+ request_content = @client.serialize(request_mapper, properties)
207
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
208
+
209
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'
210
+
211
+ request_url = @base_url || @client.base_url
212
+
213
+ options = {
214
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
215
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
216
+ query_params: {'api-version' => @client.api_version},
217
+ body: request_content,
218
+ headers: request_headers.merge(custom_headers || {}),
219
+ base_url: request_url
220
+ }
221
+ promise = @client.make_request_async(:put, path_template, options)
222
+
223
+ promise = promise.then do |result|
224
+ http_response = result.response
225
+ status_code = http_response.status
226
+ response_content = http_response.body
227
+ unless status_code == 200
228
+ error_model = JSON.load(response_content)
229
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
230
+ end
231
+
232
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
233
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
234
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
235
+ # Deserialize Response
236
+ if status_code == 200
237
+ begin
238
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
239
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::PrivateEndpointConnection.mapper()
240
+ result.body = @client.deserialize(result_mapper, parsed_response)
241
+ rescue Exception => e
242
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
243
+ end
244
+ end
245
+
246
+ result
247
+ end
248
+
249
+ promise.execute
250
+ end
251
+
252
+ #
253
+ # Deletes the specified private endpoint connection associated with the key
254
+ # vault.
255
+ #
256
+ # @param resource_group_name [String] Name of the resource group that contains
257
+ # the key vault.
258
+ # @param vault_name [String] The name of the key vault.
259
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
260
+ # connection associated with the key vault.
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [PrivateEndpointConnection] operation results.
265
+ #
266
+ def delete(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
267
+ response = delete_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
268
+ response.body unless response.nil?
269
+ end
270
+
271
+ #
272
+ # @param resource_group_name [String] Name of the resource group that contains
273
+ # the key vault.
274
+ # @param vault_name [String] The name of the key vault.
275
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
276
+ # connection associated with the key vault.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [Concurrent::Promise] promise which provides async access to http
281
+ # response.
282
+ #
283
+ def delete_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
284
+ # Send request
285
+ promise = begin_delete_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:custom_headers)
286
+
287
+ promise = promise.then do |response|
288
+ # Defining deserialization method.
289
+ deserialize_method = lambda do |parsed_response|
290
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::PrivateEndpointConnection.mapper()
291
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
292
+ end
293
+
294
+ # Waiting for response.
295
+ @client.get_long_running_operation_result(response, deserialize_method)
296
+ end
297
+
298
+ promise
299
+ end
300
+
301
+ #
302
+ # Deletes the specified private endpoint connection associated with the key
303
+ # vault.
304
+ #
305
+ # @param resource_group_name [String] Name of the resource group that contains
306
+ # the key vault.
307
+ # @param vault_name [String] The name of the key vault.
308
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
309
+ # connection associated with the key vault.
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ # @return [PrivateEndpointConnection] operation results.
314
+ #
315
+ def begin_delete(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
316
+ response = begin_delete_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
317
+ response.body unless response.nil?
318
+ end
319
+
320
+ #
321
+ # Deletes the specified private endpoint connection associated with the key
322
+ # vault.
323
+ #
324
+ # @param resource_group_name [String] Name of the resource group that contains
325
+ # the key vault.
326
+ # @param vault_name [String] The name of the key vault.
327
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
328
+ # connection associated with the key vault.
329
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
330
+ # will be added to the HTTP request.
331
+ #
332
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
333
+ #
334
+ def begin_delete_with_http_info(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
335
+ begin_delete_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
336
+ end
337
+
338
+ #
339
+ # Deletes the specified private endpoint connection associated with the key
340
+ # vault.
341
+ #
342
+ # @param resource_group_name [String] Name of the resource group that contains
343
+ # the key vault.
344
+ # @param vault_name [String] The name of the key vault.
345
+ # @param private_endpoint_connection_name [String] Name of the private endpoint
346
+ # connection associated with the key vault.
347
+ # @param [Hash{String => String}] A hash of custom headers that will be added
348
+ # to the HTTP request.
349
+ #
350
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
351
+ #
352
+ def begin_delete_async(resource_group_name, vault_name, private_endpoint_connection_name, custom_headers:nil)
353
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
354
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
355
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
356
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
357
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
358
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
359
+
360
+
361
+ request_headers = {}
362
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
363
+
364
+ # Set Headers
365
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
366
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
367
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'
368
+
369
+ request_url = @base_url || @client.base_url
370
+
371
+ options = {
372
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
373
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
374
+ query_params: {'api-version' => @client.api_version},
375
+ headers: request_headers.merge(custom_headers || {}),
376
+ base_url: request_url
377
+ }
378
+ promise = @client.make_request_async(:delete, path_template, options)
379
+
380
+ promise = promise.then do |result|
381
+ http_response = result.response
382
+ status_code = http_response.status
383
+ response_content = http_response.body
384
+ unless status_code == 200 || status_code == 202 || status_code == 204
385
+ error_model = JSON.load(response_content)
386
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
387
+ end
388
+
389
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
390
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
391
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
392
+ # Deserialize Response
393
+ if status_code == 200
394
+ begin
395
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
396
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::PrivateEndpointConnection.mapper()
397
+ result.body = @client.deserialize(result_mapper, parsed_response)
398
+ rescue Exception => e
399
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
400
+ end
401
+ end
402
+
403
+ result
404
+ end
405
+
406
+ promise.execute
407
+ end
408
+
409
+ end
410
+ end
@@ -0,0 +1,124 @@
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::KeyVault::Mgmt::V2019_09_01
7
+ #
8
+ # The Azure management API provides a RESTful set of web services that
9
+ # interact with Azure Key Vault.
10
+ #
11
+ class PrivateLinkResources
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the PrivateLinkResources class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [KeyVaultManagementClient] reference to the KeyVaultManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets the private link resources supported for the key vault.
27
+ #
28
+ # @param resource_group_name [String] Name of the resource group that contains
29
+ # the key vault.
30
+ # @param vault_name [String] The name of the key vault.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [PrivateLinkResourceListResult] operation results.
35
+ #
36
+ def list_by_vault(resource_group_name, vault_name, custom_headers:nil)
37
+ response = list_by_vault_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Gets the private link resources supported for the key vault.
43
+ #
44
+ # @param resource_group_name [String] Name of the resource group that contains
45
+ # the key vault.
46
+ # @param vault_name [String] The name of the key vault.
47
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
48
+ # will be added to the HTTP request.
49
+ #
50
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
51
+ #
52
+ def list_by_vault_with_http_info(resource_group_name, vault_name, custom_headers:nil)
53
+ list_by_vault_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
54
+ end
55
+
56
+ #
57
+ # Gets the private link resources supported for the key vault.
58
+ #
59
+ # @param resource_group_name [String] Name of the resource group that contains
60
+ # the key vault.
61
+ # @param vault_name [String] The name of the key vault.
62
+ # @param [Hash{String => String}] A hash of custom headers that will be added
63
+ # to the HTTP request.
64
+ #
65
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
66
+ #
67
+ def list_by_vault_async(resource_group_name, vault_name, custom_headers:nil)
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
71
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+
74
+
75
+ request_headers = {}
76
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
77
+
78
+ # Set Headers
79
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
80
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
81
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateLinkResources'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
88
+ query_params: {'api-version' => @client.api_version},
89
+ headers: request_headers.merge(custom_headers || {}),
90
+ base_url: request_url
91
+ }
92
+ promise = @client.make_request_async(:get, path_template, options)
93
+
94
+ promise = promise.then do |result|
95
+ http_response = result.response
96
+ status_code = http_response.status
97
+ response_content = http_response.body
98
+ unless status_code == 200
99
+ error_model = JSON.load(response_content)
100
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
101
+ end
102
+
103
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
104
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
105
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::PrivateLinkResourceListResult.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ end
124
+ end