azure_mgmt_appconfiguration 0.17.0 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +20 -20
  3. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration.rb +43 -43
  4. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/app_configuration_management_client.rb +1 -1
  5. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb +1386 -1386
  6. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key.rb +111 -111
  7. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/api_key_list_result.rb +99 -99
  8. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/check_name_availability_parameters.rb +60 -60
  9. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store.rb +126 -126
  10. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_list_result.rb +99 -99
  11. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_update_parameters.rb +65 -65
  12. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/error.rb +57 -57
  13. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/name_availability_status.rb +73 -73
  14. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition.rb +59 -59
  15. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_display.rb +81 -81
  16. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_list_result.rb +99 -99
  17. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb +20 -20
  18. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/regenerate_key_parameters.rb +46 -46
  19. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/models/resource.rb +111 -111
  20. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/module_definition.rb +9 -9
  21. data/lib/2019-02-01-preview/generated/azure_mgmt_appconfiguration/operations.rb +339 -339
  22. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration.rb +61 -0
  23. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/app_configuration_management_client.rb +143 -0
  24. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb +1500 -0
  25. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/actions_required.rb +16 -0
  26. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/api_key.rb +111 -0
  27. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/api_key_list_result.rb +99 -0
  28. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/check_name_availability_parameters.rb +60 -0
  29. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store.rb +164 -0
  30. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_list_result.rb +99 -0
  31. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/configuration_store_update_parameters.rb +92 -0
  32. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/connection_status.rb +18 -0
  33. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/encryption_properties.rb +47 -0
  34. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/error.rb +57 -0
  35. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/identity_type.rb +18 -0
  36. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/key_value.rb +150 -0
  37. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/key_vault_properties.rb +58 -0
  38. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/list_key_value_parameters.rb +57 -0
  39. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/name_availability_status.rb +73 -0
  40. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition.rb +59 -0
  41. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_display.rb +81 -0
  42. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/operation_definition_list_result.rb +99 -0
  43. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_endpoint.rb +46 -0
  44. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_endpoint_connection.rb +111 -0
  45. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_endpoint_connection_list_result.rb +99 -0
  46. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_link_resource.rb +104 -0
  47. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_link_resource_list_result.rb +99 -0
  48. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/private_link_service_connection_state.rb +73 -0
  49. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/provisioning_state.rb +20 -0
  50. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/regenerate_key_parameters.rb +46 -0
  51. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/resource.rb +111 -0
  52. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/resource_identity.rb +99 -0
  53. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/sku.rb +46 -0
  54. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/models/user_identity.rb +59 -0
  55. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/module_definition.rb +9 -0
  56. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/operations.rb +339 -0
  57. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/private_endpoint_connections.rb +675 -0
  58. data/lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/private_link_resources.rb +352 -0
  59. data/lib/azure_mgmt_appconfiguration.rb +1 -0
  60. data/lib/module_definition.rb +7 -7
  61. data/lib/profiles/latest/appconfiguration_latest_profile_client.rb +40 -40
  62. data/lib/profiles/latest/appconfiguration_module_definition.rb +8 -8
  63. data/lib/profiles/latest/modules/appconfiguration_profile_module.rb +107 -39
  64. data/lib/version.rb +1 -1
  65. metadata +39 -2
@@ -0,0 +1,675 @@
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::Appconfiguration::Mgmt::V2019_11_01_preview
7
+ #
8
+ # PrivateEndpointConnections
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 [AppConfigurationManagementClient] reference to the AppConfigurationManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all private endpoint connections for a configuration store.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group to which
28
+ # the container registry belongs.
29
+ # @param config_store_name [String] The name of the configuration store.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<PrivateEndpointConnection>] operation results.
34
+ #
35
+ def list_by_configuration_store(resource_group_name, config_store_name, custom_headers:nil)
36
+ first_page = list_by_configuration_store_as_lazy(resource_group_name, config_store_name, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Lists all private endpoint connections for a configuration store.
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group to which
44
+ # the container registry belongs.
45
+ # @param config_store_name [String] The name of the configuration store.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_by_configuration_store_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
52
+ list_by_configuration_store_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Lists all private endpoint connections for a configuration store.
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group to which
59
+ # the container registry belongs.
60
+ # @param config_store_name [String] The name of the configuration store.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_by_configuration_store_async(resource_group_name, config_store_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
70
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
71
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
72
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnectionListResult.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Gets the specified private endpoint connection associated with the
126
+ # configuration store.
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group to which
129
+ # the container registry belongs.
130
+ # @param config_store_name [String] The name of the configuration store.
131
+ # @param private_endpoint_connection_name [String] Private endpoint connection
132
+ # name
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [PrivateEndpointConnection] operation results.
137
+ #
138
+ def get(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
139
+ response = get_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
140
+ response.body unless response.nil?
141
+ end
142
+
143
+ #
144
+ # Gets the specified private endpoint connection associated with the
145
+ # configuration store.
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group to which
148
+ # the container registry belongs.
149
+ # @param config_store_name [String] The name of the configuration store.
150
+ # @param private_endpoint_connection_name [String] Private endpoint connection
151
+ # name
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
156
+ #
157
+ def get_with_http_info(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
158
+ get_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
159
+ end
160
+
161
+ #
162
+ # Gets the specified private endpoint connection associated with the
163
+ # configuration store.
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group to which
166
+ # the container registry belongs.
167
+ # @param config_store_name [String] The name of the configuration store.
168
+ # @param private_endpoint_connection_name [String] Private endpoint connection
169
+ # name
170
+ # @param [Hash{String => String}] A hash of custom headers that will be added
171
+ # to the HTTP request.
172
+ #
173
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
174
+ #
175
+ def get_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
177
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
178
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
179
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
180
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
181
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
182
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
183
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
184
+
185
+
186
+ request_headers = {}
187
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
188
+
189
+ # Set Headers
190
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
191
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
192
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'
193
+
194
+ request_url = @base_url || @client.base_url
195
+
196
+ options = {
197
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
198
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
199
+ query_params: {'api-version' => @client.api_version},
200
+ headers: request_headers.merge(custom_headers || {}),
201
+ base_url: request_url
202
+ }
203
+ promise = @client.make_request_async(:get, path_template, options)
204
+
205
+ promise = promise.then do |result|
206
+ http_response = result.response
207
+ status_code = http_response.status
208
+ response_content = http_response.body
209
+ unless status_code == 200
210
+ error_model = JSON.load(response_content)
211
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
212
+ end
213
+
214
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
215
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
216
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
217
+ # Deserialize Response
218
+ if status_code == 200
219
+ begin
220
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
221
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnection.mapper()
222
+ result.body = @client.deserialize(result_mapper, parsed_response)
223
+ rescue Exception => e
224
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
225
+ end
226
+ end
227
+
228
+ result
229
+ end
230
+
231
+ promise.execute
232
+ end
233
+
234
+ #
235
+ # Update the state of the specified private endpoint connection associated with
236
+ # the configuration store.
237
+ #
238
+ # @param resource_group_name [String] The name of the resource group to which
239
+ # the container registry belongs.
240
+ # @param config_store_name [String] The name of the configuration store.
241
+ # @param private_endpoint_connection_name [String] Private endpoint connection
242
+ # name
243
+ # @param private_endpoint_connection [PrivateEndpointConnection] The private
244
+ # endpoint connection properties.
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [PrivateEndpointConnection] operation results.
249
+ #
250
+ def create_or_update(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
251
+ response = create_or_update_async(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value!
252
+ response.body unless response.nil?
253
+ end
254
+
255
+ #
256
+ # @param resource_group_name [String] The name of the resource group to which
257
+ # the container registry belongs.
258
+ # @param config_store_name [String] The name of the configuration store.
259
+ # @param private_endpoint_connection_name [String] Private endpoint connection
260
+ # name
261
+ # @param private_endpoint_connection [PrivateEndpointConnection] The private
262
+ # endpoint connection properties.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [Concurrent::Promise] promise which provides async access to http
267
+ # response.
268
+ #
269
+ def create_or_update_async(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
270
+ # Send request
271
+ promise = begin_create_or_update_async(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers)
272
+
273
+ promise = promise.then do |response|
274
+ # Defining deserialization method.
275
+ deserialize_method = lambda do |parsed_response|
276
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnection.mapper()
277
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
278
+ end
279
+
280
+ # Waiting for response.
281
+ @client.get_long_running_operation_result(response, deserialize_method)
282
+ end
283
+
284
+ promise
285
+ end
286
+
287
+ #
288
+ # Deletes a private endpoint connection.
289
+ #
290
+ # @param resource_group_name [String] The name of the resource group to which
291
+ # the container registry belongs.
292
+ # @param config_store_name [String] The name of the configuration store.
293
+ # @param private_endpoint_connection_name [String] Private endpoint connection
294
+ # name
295
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
296
+ # will be added to the HTTP request.
297
+ #
298
+ def delete(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
299
+ response = delete_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
300
+ nil
301
+ end
302
+
303
+ #
304
+ # @param resource_group_name [String] The name of the resource group to which
305
+ # the container registry belongs.
306
+ # @param config_store_name [String] The name of the configuration store.
307
+ # @param private_endpoint_connection_name [String] Private endpoint connection
308
+ # name
309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
+ # will be added to the HTTP request.
311
+ #
312
+ # @return [Concurrent::Promise] promise which provides async access to http
313
+ # response.
314
+ #
315
+ def delete_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
316
+ # Send request
317
+ promise = begin_delete_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:custom_headers)
318
+
319
+ promise = promise.then do |response|
320
+ # Defining deserialization method.
321
+ deserialize_method = lambda do |parsed_response|
322
+ end
323
+
324
+ # Waiting for response.
325
+ @client.get_long_running_operation_result(response, deserialize_method)
326
+ end
327
+
328
+ promise
329
+ end
330
+
331
+ #
332
+ # Update the state of the specified private endpoint connection associated with
333
+ # the configuration store.
334
+ #
335
+ # @param resource_group_name [String] The name of the resource group to which
336
+ # the container registry belongs.
337
+ # @param config_store_name [String] The name of the configuration store.
338
+ # @param private_endpoint_connection_name [String] Private endpoint connection
339
+ # name
340
+ # @param private_endpoint_connection [PrivateEndpointConnection] The private
341
+ # endpoint connection properties.
342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
343
+ # will be added to the HTTP request.
344
+ #
345
+ # @return [PrivateEndpointConnection] operation results.
346
+ #
347
+ def begin_create_or_update(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
348
+ response = begin_create_or_update_async(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value!
349
+ response.body unless response.nil?
350
+ end
351
+
352
+ #
353
+ # Update the state of the specified private endpoint connection associated with
354
+ # the configuration store.
355
+ #
356
+ # @param resource_group_name [String] The name of the resource group to which
357
+ # the container registry belongs.
358
+ # @param config_store_name [String] The name of the configuration store.
359
+ # @param private_endpoint_connection_name [String] Private endpoint connection
360
+ # name
361
+ # @param private_endpoint_connection [PrivateEndpointConnection] The private
362
+ # endpoint connection properties.
363
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
364
+ # will be added to the HTTP request.
365
+ #
366
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
367
+ #
368
+ def begin_create_or_update_with_http_info(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
369
+ begin_create_or_update_async(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value!
370
+ end
371
+
372
+ #
373
+ # Update the state of the specified private endpoint connection associated with
374
+ # the configuration store.
375
+ #
376
+ # @param resource_group_name [String] The name of the resource group to which
377
+ # the container registry belongs.
378
+ # @param config_store_name [String] The name of the configuration store.
379
+ # @param private_endpoint_connection_name [String] Private endpoint connection
380
+ # name
381
+ # @param private_endpoint_connection [PrivateEndpointConnection] The private
382
+ # endpoint connection properties.
383
+ # @param [Hash{String => String}] A hash of custom headers that will be added
384
+ # to the HTTP request.
385
+ #
386
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
387
+ #
388
+ def begin_create_or_update_async(resource_group_name, config_store_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
389
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
390
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
391
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
392
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
393
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
394
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
395
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
396
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
397
+ fail ArgumentError, 'private_endpoint_connection is nil' if private_endpoint_connection.nil?
398
+
399
+
400
+ request_headers = {}
401
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
402
+
403
+ # Set Headers
404
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
405
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
406
+
407
+ # Serialize Request
408
+ request_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnection.mapper()
409
+ request_content = @client.serialize(request_mapper, private_endpoint_connection)
410
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
411
+
412
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'
413
+
414
+ request_url = @base_url || @client.base_url
415
+
416
+ options = {
417
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
418
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
419
+ query_params: {'api-version' => @client.api_version},
420
+ body: request_content,
421
+ headers: request_headers.merge(custom_headers || {}),
422
+ base_url: request_url
423
+ }
424
+ promise = @client.make_request_async(:put, 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 || status_code == 201
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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
437
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
438
+ # Deserialize Response
439
+ if status_code == 200
440
+ begin
441
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
442
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnection.mapper()
443
+ result.body = @client.deserialize(result_mapper, parsed_response)
444
+ rescue Exception => e
445
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
446
+ end
447
+ end
448
+ # Deserialize Response
449
+ if status_code == 201
450
+ begin
451
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
452
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnection.mapper()
453
+ result.body = @client.deserialize(result_mapper, parsed_response)
454
+ rescue Exception => e
455
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
456
+ end
457
+ end
458
+
459
+ result
460
+ end
461
+
462
+ promise.execute
463
+ end
464
+
465
+ #
466
+ # Deletes a private endpoint connection.
467
+ #
468
+ # @param resource_group_name [String] The name of the resource group to which
469
+ # the container registry belongs.
470
+ # @param config_store_name [String] The name of the configuration store.
471
+ # @param private_endpoint_connection_name [String] Private endpoint connection
472
+ # name
473
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
474
+ # will be added to the HTTP request.
475
+ #
476
+ #
477
+ def begin_delete(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
478
+ response = begin_delete_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
479
+ nil
480
+ end
481
+
482
+ #
483
+ # Deletes a private endpoint connection.
484
+ #
485
+ # @param resource_group_name [String] The name of the resource group to which
486
+ # the container registry belongs.
487
+ # @param config_store_name [String] The name of the configuration store.
488
+ # @param private_endpoint_connection_name [String] Private endpoint connection
489
+ # name
490
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
491
+ # will be added to the HTTP request.
492
+ #
493
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
494
+ #
495
+ def begin_delete_with_http_info(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
496
+ begin_delete_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
497
+ end
498
+
499
+ #
500
+ # Deletes a private endpoint connection.
501
+ #
502
+ # @param resource_group_name [String] The name of the resource group to which
503
+ # the container registry belongs.
504
+ # @param config_store_name [String] The name of the configuration store.
505
+ # @param private_endpoint_connection_name [String] Private endpoint connection
506
+ # name
507
+ # @param [Hash{String => String}] A hash of custom headers that will be added
508
+ # to the HTTP request.
509
+ #
510
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
511
+ #
512
+ def begin_delete_async(resource_group_name, config_store_name, private_endpoint_connection_name, custom_headers:nil)
513
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
514
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
515
+ fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
516
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
517
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
518
+ fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
519
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
520
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
521
+
522
+
523
+ request_headers = {}
524
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
525
+
526
+ # Set Headers
527
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
528
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
529
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}'
530
+
531
+ request_url = @base_url || @client.base_url
532
+
533
+ options = {
534
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
535
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
536
+ query_params: {'api-version' => @client.api_version},
537
+ headers: request_headers.merge(custom_headers || {}),
538
+ base_url: request_url
539
+ }
540
+ promise = @client.make_request_async(:delete, path_template, options)
541
+
542
+ promise = promise.then do |result|
543
+ http_response = result.response
544
+ status_code = http_response.status
545
+ response_content = http_response.body
546
+ unless status_code == 200 || status_code == 202 || status_code == 204
547
+ error_model = JSON.load(response_content)
548
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
549
+ end
550
+
551
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
552
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
553
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
554
+
555
+ result
556
+ end
557
+
558
+ promise.execute
559
+ end
560
+
561
+ #
562
+ # Lists all private endpoint connections for a configuration store.
563
+ #
564
+ # @param next_page_link [String] The NextLink from the previous successful call
565
+ # to List operation.
566
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
+ # will be added to the HTTP request.
568
+ #
569
+ # @return [PrivateEndpointConnectionListResult] operation results.
570
+ #
571
+ def list_by_configuration_store_next(next_page_link, custom_headers:nil)
572
+ response = list_by_configuration_store_next_async(next_page_link, custom_headers:custom_headers).value!
573
+ response.body unless response.nil?
574
+ end
575
+
576
+ #
577
+ # Lists all private endpoint connections for a configuration store.
578
+ #
579
+ # @param next_page_link [String] The NextLink from the previous successful call
580
+ # to List operation.
581
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
582
+ # will be added to the HTTP request.
583
+ #
584
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
585
+ #
586
+ def list_by_configuration_store_next_with_http_info(next_page_link, custom_headers:nil)
587
+ list_by_configuration_store_next_async(next_page_link, custom_headers:custom_headers).value!
588
+ end
589
+
590
+ #
591
+ # Lists all private endpoint connections for a configuration store.
592
+ #
593
+ # @param next_page_link [String] The NextLink from the previous successful call
594
+ # to List operation.
595
+ # @param [Hash{String => String}] A hash of custom headers that will be added
596
+ # to the HTTP request.
597
+ #
598
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
599
+ #
600
+ def list_by_configuration_store_next_async(next_page_link, custom_headers:nil)
601
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
602
+
603
+
604
+ request_headers = {}
605
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
606
+
607
+ # Set Headers
608
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
609
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
610
+ path_template = '{nextLink}'
611
+
612
+ request_url = @base_url || @client.base_url
613
+
614
+ options = {
615
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
616
+ skip_encoding_path_params: {'nextLink' => next_page_link},
617
+ headers: request_headers.merge(custom_headers || {}),
618
+ base_url: request_url
619
+ }
620
+ promise = @client.make_request_async(:get, path_template, options)
621
+
622
+ promise = promise.then do |result|
623
+ http_response = result.response
624
+ status_code = http_response.status
625
+ response_content = http_response.body
626
+ unless status_code == 200
627
+ error_model = JSON.load(response_content)
628
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
629
+ end
630
+
631
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
632
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
633
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
634
+ # Deserialize Response
635
+ if status_code == 200
636
+ begin
637
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
638
+ result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::PrivateEndpointConnectionListResult.mapper()
639
+ result.body = @client.deserialize(result_mapper, parsed_response)
640
+ rescue Exception => e
641
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
642
+ end
643
+ end
644
+
645
+ result
646
+ end
647
+
648
+ promise.execute
649
+ end
650
+
651
+ #
652
+ # Lists all private endpoint connections for a configuration store.
653
+ #
654
+ # @param resource_group_name [String] The name of the resource group to which
655
+ # the container registry belongs.
656
+ # @param config_store_name [String] The name of the configuration store.
657
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
658
+ # will be added to the HTTP request.
659
+ #
660
+ # @return [PrivateEndpointConnectionListResult] which provide lazy access to
661
+ # pages of the response.
662
+ #
663
+ def list_by_configuration_store_as_lazy(resource_group_name, config_store_name, custom_headers:nil)
664
+ response = list_by_configuration_store_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
665
+ unless response.nil?
666
+ page = response.body
667
+ page.next_method = Proc.new do |next_page_link|
668
+ list_by_configuration_store_next_async(next_page_link, custom_headers:custom_headers)
669
+ end
670
+ page
671
+ end
672
+ end
673
+
674
+ end
675
+ end