azure_mgmt_event_hub 0.18.1 → 0.18.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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2014-09-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
  3. data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
  4. data/lib/2017-04-01/generated/azure_mgmt_event_hub.rb +15 -28
  5. data/lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb +5 -5
  6. data/lib/2017-04-01/generated/azure_mgmt_event_hub/disaster_recovery_configs.rb +239 -239
  7. data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +5 -5
  8. data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hubs.rb +278 -272
  9. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/error_response.rb +1 -1
  10. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_regions.rb +1 -1
  11. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_regions_properties.rb +1 -2
  12. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/resource.rb +4 -4
  13. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/tracked_resource.rb +3 -3
  14. data/lib/2017-04-01/generated/azure_mgmt_event_hub/namespaces.rb +198 -1678
  15. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub.rb +24 -18
  16. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/clusters.rb +74 -56
  17. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/configuration.rb +7 -7
  18. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/{event_hub2018preview_management_client.rb → event_hub_management_client.rb} +18 -14
  19. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster.rb +6 -6
  20. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/{operation.rb → connection_state.rb} +16 -16
  21. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace.rb +12 -12
  22. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/encryption.rb +11 -3
  23. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/end_point_provisioning_state.rb +20 -0
  24. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/error_response.rb +1 -1
  25. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/key_vault_properties.rb +11 -0
  26. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_set.rb +12 -0
  27. data/lib/{2017-04-01/generated/azure_mgmt_event_hub/models/subnet.rb → 2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_endpoint.rb} +8 -8
  28. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_endpoint_connection.rb +100 -0
  29. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/{operation_list_result.rb → private_endpoint_connection_list_result.rb} +13 -16
  30. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_link_connection_status.rb +18 -0
  31. data/lib/{2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set.rb → 2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_link_resource.rb} +55 -50
  32. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_link_resources_list_result.rb +67 -0
  33. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/resource.rb +4 -4
  34. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/tracked_resource.rb +3 -3
  35. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb +395 -395
  36. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/private_endpoint_connections.rb +625 -0
  37. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/private_link_resources.rb +127 -0
  38. data/lib/azure_mgmt_event_hub.rb +2 -2
  39. data/lib/profiles/latest/modules/eventhub_profile_module.rb +211 -63
  40. data/lib/version.rb +1 -1
  41. metadata +14 -21
  42. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/default_action.rb +0 -16
  43. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace.rb +0 -200
  44. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace_list_result.rb +0 -99
  45. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_plan.rb +0 -134
  46. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb +0 -15
  47. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set_list_result.rb +0 -100
  48. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb +0 -59
  49. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb +0 -59
  50. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku.rb +0 -75
  51. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku_name.rb +0 -16
  52. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku_tier.rb +0 -16
  53. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation_display.rb +0 -72
  54. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/operations.rb +0 -220
@@ -0,0 +1,625 @@
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::EventHub::Mgmt::V2018_01_01_preview
7
+ #
8
+ # Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and
9
+ # VirtualNetworkRules resources.
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 [EventHubManagementClient] reference to the EventHubManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets the available PrivateEndpointConnections within a namespace.
27
+ #
28
+ # @param resource_group_name [String] Name of the resource group within the
29
+ # azure subscription.
30
+ # @param namespace_name [String] The Namespace name
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<PrivateEndpointConnection>] operation results.
35
+ #
36
+ def list(resource_group_name, namespace_name, custom_headers:nil)
37
+ first_page = list_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Gets the available PrivateEndpointConnections within a namespace.
43
+ #
44
+ # @param resource_group_name [String] Name of the resource group within the
45
+ # azure subscription.
46
+ # @param namespace_name [String] The Namespace name
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_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
53
+ list_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
54
+ end
55
+
56
+ #
57
+ # Gets the available PrivateEndpointConnections within a namespace.
58
+ #
59
+ # @param resource_group_name [String] Name of the resource group within the
60
+ # azure subscription.
61
+ # @param namespace_name [String] The Namespace name
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_async(resource_group_name, namespace_name, custom_headers:nil)
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
72
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
73
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
76
+
77
+
78
+ request_headers = {}
79
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
80
+
81
+ # Set Headers
82
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
83
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
84
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
91
+ query_params: {'api-version' => @client.api_version},
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
94
+ }
95
+ promise = @client.make_request_async(:get, path_template, options)
96
+
97
+ promise = promise.then do |result|
98
+ http_response = result.response
99
+ status_code = http_response.status
100
+ response_content = http_response.body
101
+ unless status_code == 200
102
+ error_model = JSON.load(response_content)
103
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
104
+ end
105
+
106
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
107
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
108
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::PrivateEndpointConnectionListResult.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Creates or updates PrivateEndpointConnections of service namespace.
128
+ #
129
+ # @param resource_group_name [String] Name of the resource group within the
130
+ # azure subscription.
131
+ # @param namespace_name [String] The Namespace name
132
+ # @param private_endpoint_connection_name [String] The
133
+ # PrivateEndpointConnection name
134
+ # @param parameters [PrivateEndpointConnection] Parameters supplied to update
135
+ # Status of PrivateEndPoint Connection to namespace resource.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [PrivateEndpointConnection] operation results.
140
+ #
141
+ def create_or_update(resource_group_name, namespace_name, private_endpoint_connection_name, parameters, custom_headers:nil)
142
+ response = create_or_update_async(resource_group_name, namespace_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # Creates or updates PrivateEndpointConnections of service namespace.
148
+ #
149
+ # @param resource_group_name [String] Name of the resource group within the
150
+ # azure subscription.
151
+ # @param namespace_name [String] The Namespace name
152
+ # @param private_endpoint_connection_name [String] The
153
+ # PrivateEndpointConnection name
154
+ # @param parameters [PrivateEndpointConnection] Parameters supplied to update
155
+ # Status of PrivateEndPoint Connection to namespace resource.
156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
+ # will be added to the HTTP request.
158
+ #
159
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
160
+ #
161
+ def create_or_update_with_http_info(resource_group_name, namespace_name, private_endpoint_connection_name, parameters, custom_headers:nil)
162
+ create_or_update_async(resource_group_name, namespace_name, private_endpoint_connection_name, parameters, custom_headers:custom_headers).value!
163
+ end
164
+
165
+ #
166
+ # Creates or updates PrivateEndpointConnections of service namespace.
167
+ #
168
+ # @param resource_group_name [String] Name of the resource group within the
169
+ # azure subscription.
170
+ # @param namespace_name [String] The Namespace name
171
+ # @param private_endpoint_connection_name [String] The
172
+ # PrivateEndpointConnection name
173
+ # @param parameters [PrivateEndpointConnection] Parameters supplied to update
174
+ # Status of PrivateEndPoint Connection to namespace resource.
175
+ # @param [Hash{String => String}] A hash of custom headers that will be added
176
+ # to the HTTP request.
177
+ #
178
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
179
+ #
180
+ def create_or_update_async(resource_group_name, namespace_name, private_endpoint_connection_name, parameters, custom_headers:nil)
181
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
182
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
183
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
184
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
185
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
186
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
187
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
188
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
189
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
190
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
191
+
192
+
193
+ request_headers = {}
194
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
195
+
196
+ # Set Headers
197
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
198
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
199
+
200
+ # Serialize Request
201
+ request_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::PrivateEndpointConnection.mapper()
202
+ request_content = @client.serialize(request_mapper, parameters)
203
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
204
+
205
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'
206
+
207
+ request_url = @base_url || @client.base_url
208
+
209
+ options = {
210
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
211
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'privateEndpointConnectionName' => private_endpoint_connection_name},
212
+ query_params: {'api-version' => @client.api_version},
213
+ body: request_content,
214
+ headers: request_headers.merge(custom_headers || {}),
215
+ base_url: request_url
216
+ }
217
+ promise = @client.make_request_async(:put, path_template, options)
218
+
219
+ promise = promise.then do |result|
220
+ http_response = result.response
221
+ status_code = http_response.status
222
+ response_content = http_response.body
223
+ unless status_code == 200 || status_code == 201
224
+ error_model = JSON.load(response_content)
225
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
226
+ end
227
+
228
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
229
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
230
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
231
+ # Deserialize Response
232
+ if status_code == 200
233
+ begin
234
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
235
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::PrivateEndpointConnection.mapper()
236
+ result.body = @client.deserialize(result_mapper, parsed_response)
237
+ rescue Exception => e
238
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
239
+ end
240
+ end
241
+ # Deserialize Response
242
+ if status_code == 201
243
+ begin
244
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
245
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::PrivateEndpointConnection.mapper()
246
+ result.body = @client.deserialize(result_mapper, parsed_response)
247
+ rescue Exception => e
248
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
249
+ end
250
+ end
251
+
252
+ result
253
+ end
254
+
255
+ promise.execute
256
+ end
257
+
258
+ #
259
+ # Deletes an existing namespace. This operation also removes all associated
260
+ # resources under the namespace.
261
+ #
262
+ # @param resource_group_name [String] Name of the resource group within the
263
+ # azure subscription.
264
+ # @param namespace_name [String] The Namespace name
265
+ # @param private_endpoint_connection_name [String] The
266
+ # PrivateEndpointConnection name
267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
268
+ # will be added to the HTTP request.
269
+ #
270
+ def delete(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
271
+ response = delete_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
272
+ nil
273
+ end
274
+
275
+ #
276
+ # @param resource_group_name [String] Name of the resource group within the
277
+ # azure subscription.
278
+ # @param namespace_name [String] The Namespace name
279
+ # @param private_endpoint_connection_name [String] The
280
+ # PrivateEndpointConnection name
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] promise which provides async access to http
285
+ # response.
286
+ #
287
+ def delete_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
288
+ # Send request
289
+ promise = begin_delete_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:custom_headers)
290
+
291
+ promise = promise.then do |response|
292
+ # Defining deserialization method.
293
+ deserialize_method = lambda do |parsed_response|
294
+ end
295
+
296
+ # Waiting for response.
297
+ @client.get_long_running_operation_result(response, deserialize_method)
298
+ end
299
+
300
+ promise
301
+ end
302
+
303
+ #
304
+ # Gets a description for the specified Private Endpoint Connection name.
305
+ #
306
+ # @param resource_group_name [String] Name of the resource group within the
307
+ # azure subscription.
308
+ # @param namespace_name [String] The Namespace name
309
+ # @param private_endpoint_connection_name [String] The
310
+ # PrivateEndpointConnection name
311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
312
+ # will be added to the HTTP request.
313
+ #
314
+ # @return [PrivateEndpointConnection] operation results.
315
+ #
316
+ def get(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
317
+ response = get_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
318
+ response.body unless response.nil?
319
+ end
320
+
321
+ #
322
+ # Gets a description for the specified Private Endpoint Connection name.
323
+ #
324
+ # @param resource_group_name [String] Name of the resource group within the
325
+ # azure subscription.
326
+ # @param namespace_name [String] The Namespace name
327
+ # @param private_endpoint_connection_name [String] The
328
+ # PrivateEndpointConnection name
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 get_with_http_info(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
335
+ get_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
336
+ end
337
+
338
+ #
339
+ # Gets a description for the specified Private Endpoint Connection name.
340
+ #
341
+ # @param resource_group_name [String] Name of the resource group within the
342
+ # azure subscription.
343
+ # @param namespace_name [String] The Namespace name
344
+ # @param private_endpoint_connection_name [String] The
345
+ # PrivateEndpointConnection name
346
+ # @param [Hash{String => String}] A hash of custom headers that will be added
347
+ # to the HTTP request.
348
+ #
349
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
350
+ #
351
+ def get_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
352
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
353
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
354
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
355
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
356
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
357
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
358
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
359
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
360
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
361
+
362
+
363
+ request_headers = {}
364
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
365
+
366
+ # Set Headers
367
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
368
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
369
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'
370
+
371
+ request_url = @base_url || @client.base_url
372
+
373
+ options = {
374
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
375
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'privateEndpointConnectionName' => private_endpoint_connection_name,'subscriptionId' => @client.subscription_id},
376
+ query_params: {'api-version' => @client.api_version},
377
+ headers: request_headers.merge(custom_headers || {}),
378
+ base_url: request_url
379
+ }
380
+ promise = @client.make_request_async(:get, path_template, options)
381
+
382
+ promise = promise.then do |result|
383
+ http_response = result.response
384
+ status_code = http_response.status
385
+ response_content = http_response.body
386
+ unless status_code == 200
387
+ error_model = JSON.load(response_content)
388
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
389
+ end
390
+
391
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
392
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
393
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
394
+ # Deserialize Response
395
+ if status_code == 200
396
+ begin
397
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
398
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::PrivateEndpointConnection.mapper()
399
+ result.body = @client.deserialize(result_mapper, parsed_response)
400
+ rescue Exception => e
401
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
402
+ end
403
+ end
404
+
405
+ result
406
+ end
407
+
408
+ promise.execute
409
+ end
410
+
411
+ #
412
+ # Deletes an existing namespace. This operation also removes all associated
413
+ # resources under the namespace.
414
+ #
415
+ # @param resource_group_name [String] Name of the resource group within the
416
+ # azure subscription.
417
+ # @param namespace_name [String] The Namespace name
418
+ # @param private_endpoint_connection_name [String] The
419
+ # PrivateEndpointConnection name
420
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
421
+ # will be added to the HTTP request.
422
+ #
423
+ #
424
+ def begin_delete(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
425
+ response = begin_delete_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
426
+ nil
427
+ end
428
+
429
+ #
430
+ # Deletes an existing namespace. This operation also removes all associated
431
+ # resources under the namespace.
432
+ #
433
+ # @param resource_group_name [String] Name of the resource group within the
434
+ # azure subscription.
435
+ # @param namespace_name [String] The Namespace name
436
+ # @param private_endpoint_connection_name [String] The
437
+ # PrivateEndpointConnection name
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
442
+ #
443
+ def begin_delete_with_http_info(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
444
+ begin_delete_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
445
+ end
446
+
447
+ #
448
+ # Deletes an existing namespace. This operation also removes all associated
449
+ # resources under the namespace.
450
+ #
451
+ # @param resource_group_name [String] Name of the resource group within the
452
+ # azure subscription.
453
+ # @param namespace_name [String] The Namespace name
454
+ # @param private_endpoint_connection_name [String] The
455
+ # PrivateEndpointConnection name
456
+ # @param [Hash{String => String}] A hash of custom headers that will be added
457
+ # to the HTTP request.
458
+ #
459
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
460
+ #
461
+ def begin_delete_async(resource_group_name, namespace_name, private_endpoint_connection_name, custom_headers:nil)
462
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
463
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
464
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
465
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
466
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
467
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
468
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
469
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
470
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
471
+
472
+
473
+ request_headers = {}
474
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
475
+
476
+ # Set Headers
477
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
478
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
479
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'
480
+
481
+ request_url = @base_url || @client.base_url
482
+
483
+ options = {
484
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
485
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
486
+ query_params: {'api-version' => @client.api_version},
487
+ headers: request_headers.merge(custom_headers || {}),
488
+ base_url: request_url
489
+ }
490
+ promise = @client.make_request_async(:delete, path_template, options)
491
+
492
+ promise = promise.then do |result|
493
+ http_response = result.response
494
+ status_code = http_response.status
495
+ response_content = http_response.body
496
+ unless status_code == 200 || status_code == 202 || status_code == 204
497
+ error_model = JSON.load(response_content)
498
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
499
+ end
500
+
501
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
502
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
503
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
504
+
505
+ result
506
+ end
507
+
508
+ promise.execute
509
+ end
510
+
511
+ #
512
+ # Gets the available PrivateEndpointConnections within a namespace.
513
+ #
514
+ # @param next_page_link [String] The NextLink from the previous successful call
515
+ # to List operation.
516
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
517
+ # will be added to the HTTP request.
518
+ #
519
+ # @return [PrivateEndpointConnectionListResult] operation results.
520
+ #
521
+ def list_next(next_page_link, custom_headers:nil)
522
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
523
+ response.body unless response.nil?
524
+ end
525
+
526
+ #
527
+ # Gets the available PrivateEndpointConnections within a namespace.
528
+ #
529
+ # @param next_page_link [String] The NextLink from the previous successful call
530
+ # to List operation.
531
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
532
+ # will be added to the HTTP request.
533
+ #
534
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
535
+ #
536
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
537
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
538
+ end
539
+
540
+ #
541
+ # Gets the available PrivateEndpointConnections within a namespace.
542
+ #
543
+ # @param next_page_link [String] The NextLink from the previous successful call
544
+ # to List operation.
545
+ # @param [Hash{String => String}] A hash of custom headers that will be added
546
+ # to the HTTP request.
547
+ #
548
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
549
+ #
550
+ def list_next_async(next_page_link, custom_headers:nil)
551
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
552
+
553
+
554
+ request_headers = {}
555
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
556
+
557
+ # Set Headers
558
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
559
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
560
+ path_template = '{nextLink}'
561
+
562
+ request_url = @base_url || @client.base_url
563
+
564
+ options = {
565
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
566
+ skip_encoding_path_params: {'nextLink' => next_page_link},
567
+ headers: request_headers.merge(custom_headers || {}),
568
+ base_url: request_url
569
+ }
570
+ promise = @client.make_request_async(:get, path_template, options)
571
+
572
+ promise = promise.then do |result|
573
+ http_response = result.response
574
+ status_code = http_response.status
575
+ response_content = http_response.body
576
+ unless status_code == 200
577
+ error_model = JSON.load(response_content)
578
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
579
+ end
580
+
581
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
582
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
583
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
584
+ # Deserialize Response
585
+ if status_code == 200
586
+ begin
587
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
588
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::PrivateEndpointConnectionListResult.mapper()
589
+ result.body = @client.deserialize(result_mapper, parsed_response)
590
+ rescue Exception => e
591
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
592
+ end
593
+ end
594
+
595
+ result
596
+ end
597
+
598
+ promise.execute
599
+ end
600
+
601
+ #
602
+ # Gets the available PrivateEndpointConnections within a namespace.
603
+ #
604
+ # @param resource_group_name [String] Name of the resource group within the
605
+ # azure subscription.
606
+ # @param namespace_name [String] The Namespace name
607
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
608
+ # will be added to the HTTP request.
609
+ #
610
+ # @return [PrivateEndpointConnectionListResult] which provide lazy access to
611
+ # pages of the response.
612
+ #
613
+ def list_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
614
+ response = list_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
615
+ unless response.nil?
616
+ page = response.body
617
+ page.next_method = Proc.new do |next_page_link|
618
+ list_next_async(next_page_link, custom_headers:custom_headers)
619
+ end
620
+ page
621
+ end
622
+ end
623
+
624
+ end
625
+ end