azure_mgmt_event_hub 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_event_hub.rb +5 -0
  4. data/lib/generated/azure_mgmt_event_hub/consumer_groups.rb +543 -0
  5. data/lib/generated/azure_mgmt_event_hub/event_hub_management_client.rb +140 -0
  6. data/lib/generated/azure_mgmt_event_hub/event_hubs.rb +1243 -0
  7. data/lib/generated/azure_mgmt_event_hub/models/access_rights.rb +17 -0
  8. data/lib/generated/azure_mgmt_event_hub/models/consumer_group_create_or_update_parameters.rb +104 -0
  9. data/lib/generated/azure_mgmt_event_hub/models/consumer_group_list_result.rb +95 -0
  10. data/lib/generated/azure_mgmt_event_hub/models/consumer_group_resource.rb +119 -0
  11. data/lib/generated/azure_mgmt_event_hub/models/entity_status.rb +23 -0
  12. data/lib/generated/azure_mgmt_event_hub/models/event_hub_create_or_update_parameters.rb +75 -0
  13. data/lib/generated/azure_mgmt_event_hub/models/event_hub_list_result.rb +95 -0
  14. data/lib/generated/azure_mgmt_event_hub/models/event_hub_properties.rb +107 -0
  15. data/lib/generated/azure_mgmt_event_hub/models/event_hub_resource.rb +151 -0
  16. data/lib/generated/azure_mgmt_event_hub/models/namespace_create_or_update_parameters.rb +147 -0
  17. data/lib/generated/azure_mgmt_event_hub/models/namespace_list_result.rb +95 -0
  18. data/lib/generated/azure_mgmt_event_hub/models/namespace_resource.rb +165 -0
  19. data/lib/generated/azure_mgmt_event_hub/models/namespace_state.rb +27 -0
  20. data/lib/generated/azure_mgmt_event_hub/models/policykey.rb +16 -0
  21. data/lib/generated/azure_mgmt_event_hub/models/regenerate_keys_parameters.rb +46 -0
  22. data/lib/generated/azure_mgmt_event_hub/models/resource_list_keys.rb +88 -0
  23. data/lib/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_create_or_update_parameters.rb +74 -0
  24. data/lib/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_list_result.rb +97 -0
  25. data/lib/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_resource.rb +97 -0
  26. data/lib/generated/azure_mgmt_event_hub/models/sku.rb +66 -0
  27. data/lib/generated/azure_mgmt_event_hub/models/sku_name.rb +17 -0
  28. data/lib/generated/azure_mgmt_event_hub/models/sku_tier.rb +17 -0
  29. data/lib/generated/azure_mgmt_event_hub/module_definition.rb +8 -0
  30. data/lib/generated/azure_mgmt_event_hub/namespaces.rb +1524 -0
  31. data/lib/generated/azure_mgmt_event_hub/version.rb +8 -0
  32. data/lib/generated/azure_mgmt_event_hub.rb +52 -0
  33. metadata +144 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ff3bd02d23d887597fec65c281f34776002528a1
4
+ data.tar.gz: 03386ab4e883dee66b6a11029a2e957e9628c3f8
5
+ SHA512:
6
+ metadata.gz: a151cead81ae71f31167275040cc03c5212afb53b1dd4a29a54f923299e18a34f2535ad5ffe7b2737c0c6f6d7283c0c4297730b683fbd11d8689f7fb4c45f1b0
7
+ data.tar.gz: ed6e2ebbc2f0f4b3510debf389f726a0679783802aabe1f333786ee2aa75bf63856f0882a5e872e68aca31605df639f038b90ae94dc30a76489a0504b35595eb
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'generated/azure_mgmt_event_hub'
@@ -0,0 +1,543 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::EventHub
7
+ #
8
+ # Azure Event Hubs client
9
+ #
10
+ class ConsumerGroups
11
+ include Azure::ARM::EventHub::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the ConsumerGroups 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
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
27
+ # namespace.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param namespace_name [String] The namespace name.
31
+ # @param event_hub_name [String] The Event Hub name.
32
+ # @param consumer_group_name [String] The consumer group name.
33
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
34
+ # to create a consumer group resource.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [ConsumerGroupResource] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers = nil)
41
+ response = create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
47
+ # namespace.
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group.
50
+ # @param namespace_name [String] The namespace name.
51
+ # @param event_hub_name [String] The Event Hub name.
52
+ # @param consumer_group_name [String] The consumer group name.
53
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
54
+ # to create a consumer group resource.
55
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
+ # will be added to the HTTP request.
57
+ #
58
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
+ #
60
+ def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers = nil)
61
+ create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers).value!
62
+ end
63
+
64
+ #
65
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
66
+ # namespace.
67
+ #
68
+ # @param resource_group_name [String] The name of the resource group.
69
+ # @param namespace_name [String] The namespace name.
70
+ # @param event_hub_name [String] The Event Hub name.
71
+ # @param consumer_group_name [String] The consumer group name.
72
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
73
+ # to create a consumer group resource.
74
+ # @param [Hash{String => String}] A hash of custom headers that will be added
75
+ # to the HTTP request.
76
+ #
77
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
78
+ #
79
+ def create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers = nil)
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
82
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
83
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
84
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
85
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
86
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
87
+
88
+
89
+ request_headers = {}
90
+
91
+ # Set Headers
92
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
93
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
94
+
95
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
96
+
97
+ # Serialize Request
98
+ request_mapper = ConsumerGroupCreateOrUpdateParameters.mapper()
99
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
100
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
101
+
102
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
103
+
104
+ request_url = @base_url || @client.base_url
105
+
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
109
+ query_params: {'api-version' => @client.api_version},
110
+ body: request_content,
111
+ headers: request_headers.merge(custom_headers || {}),
112
+ base_url: request_url
113
+ }
114
+ promise = @client.make_request_async(:put, path_template, options)
115
+
116
+ promise = promise.then do |result|
117
+ http_response = result.response
118
+ status_code = http_response.status
119
+ response_content = http_response.body
120
+ unless status_code == 200
121
+ error_model = JSON.load(response_content)
122
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
123
+ end
124
+
125
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
126
+ # Deserialize Response
127
+ if status_code == 200
128
+ begin
129
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
130
+ result_mapper = ConsumerGroupResource.mapper()
131
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
132
+ rescue Exception => e
133
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
134
+ end
135
+ end
136
+
137
+ result
138
+ end
139
+
140
+ promise.execute
141
+ end
142
+
143
+ #
144
+ # Deletes a consumer group from the specified Event Hub and resource group.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group.
147
+ # @param namespace_name [String] The namespace name.
148
+ # @param event_hub_name [String] The Event Hub name.
149
+ # @param consumer_group_name [String] The Cconsumer group name.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ #
154
+ def delete(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
155
+ response = delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
156
+ nil
157
+ end
158
+
159
+ #
160
+ # Deletes a consumer group from the specified Event Hub and resource group.
161
+ #
162
+ # @param resource_group_name [String] The name of the resource group.
163
+ # @param namespace_name [String] The namespace name.
164
+ # @param event_hub_name [String] The Event Hub name.
165
+ # @param consumer_group_name [String] The Cconsumer group name.
166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
+ # will be added to the HTTP request.
168
+ #
169
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
170
+ #
171
+ def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
172
+ delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
173
+ end
174
+
175
+ #
176
+ # Deletes a consumer group from the specified Event Hub and resource group.
177
+ #
178
+ # @param resource_group_name [String] The name of the resource group.
179
+ # @param namespace_name [String] The namespace name.
180
+ # @param event_hub_name [String] The Event Hub name.
181
+ # @param consumer_group_name [String] The Cconsumer group name.
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 delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
188
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
189
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
190
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
191
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
192
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
193
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
194
+
195
+
196
+ request_headers = {}
197
+
198
+ # Set Headers
199
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
200
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
201
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
202
+
203
+ request_url = @base_url || @client.base_url
204
+
205
+ options = {
206
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
207
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
208
+ query_params: {'api-version' => @client.api_version},
209
+ headers: request_headers.merge(custom_headers || {}),
210
+ base_url: request_url
211
+ }
212
+ promise = @client.make_request_async(:delete, path_template, options)
213
+
214
+ promise = promise.then do |result|
215
+ http_response = result.response
216
+ status_code = http_response.status
217
+ response_content = http_response.body
218
+ unless status_code == 204 || status_code == 200
219
+ error_model = JSON.load(response_content)
220
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
221
+ end
222
+
223
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
224
+
225
+ result
226
+ end
227
+
228
+ promise.execute
229
+ end
230
+
231
+ #
232
+ # Gets a description for the specified consumer group.
233
+ #
234
+ # @param resource_group_name [String] The name of the resource group.
235
+ # @param namespace_name [String] The namespace name.
236
+ # @param event_hub_name [String] The Event Hub name.
237
+ # @param consumer_group_name [String] The consumer group name.
238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
239
+ # will be added to the HTTP request.
240
+ #
241
+ # @return [ConsumerGroupResource] operation results.
242
+ #
243
+ def get(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
244
+ response = get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
245
+ response.body unless response.nil?
246
+ end
247
+
248
+ #
249
+ # Gets a description for the specified consumer group.
250
+ #
251
+ # @param resource_group_name [String] The name of the resource group.
252
+ # @param namespace_name [String] The namespace name.
253
+ # @param event_hub_name [String] The Event Hub name.
254
+ # @param consumer_group_name [String] The consumer group name.
255
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
256
+ # will be added to the HTTP request.
257
+ #
258
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
259
+ #
260
+ def get_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
261
+ get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
262
+ end
263
+
264
+ #
265
+ # Gets a description for the specified consumer group.
266
+ #
267
+ # @param resource_group_name [String] The name of the resource group.
268
+ # @param namespace_name [String] The namespace name.
269
+ # @param event_hub_name [String] The Event Hub name.
270
+ # @param consumer_group_name [String] The consumer group name.
271
+ # @param [Hash{String => String}] A hash of custom headers that will be added
272
+ # to the HTTP request.
273
+ #
274
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
275
+ #
276
+ def get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
277
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
279
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
280
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
281
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
282
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
283
+
284
+
285
+ request_headers = {}
286
+
287
+ # Set Headers
288
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
289
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
290
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
291
+
292
+ request_url = @base_url || @client.base_url
293
+
294
+ options = {
295
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
296
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
297
+ query_params: {'api-version' => @client.api_version},
298
+ headers: request_headers.merge(custom_headers || {}),
299
+ base_url: request_url
300
+ }
301
+ promise = @client.make_request_async(:get, path_template, options)
302
+
303
+ promise = promise.then do |result|
304
+ http_response = result.response
305
+ status_code = http_response.status
306
+ response_content = http_response.body
307
+ unless status_code == 200
308
+ error_model = JSON.load(response_content)
309
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
310
+ end
311
+
312
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
313
+ # Deserialize Response
314
+ if status_code == 200
315
+ begin
316
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
317
+ result_mapper = ConsumerGroupResource.mapper()
318
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
319
+ rescue Exception => e
320
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
321
+ end
322
+ end
323
+
324
+ result
325
+ end
326
+
327
+ promise.execute
328
+ end
329
+
330
+ #
331
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
332
+ # consumer group exists in the namespace.
333
+ #
334
+ # @param resource_group_name [String] The name of the resource group.
335
+ # @param namespace_name [String] The namespace name.
336
+ # @param event_hub_name [String] The Event Hub name.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [Array<ConsumerGroupResource>] operation results.
341
+ #
342
+ def list_all(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
343
+ first_page = list_all_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers)
344
+ first_page.get_all_items
345
+ end
346
+
347
+ #
348
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
349
+ # consumer group exists in the namespace.
350
+ #
351
+ # @param resource_group_name [String] The name of the resource group.
352
+ # @param namespace_name [String] The namespace name.
353
+ # @param event_hub_name [String] The Event Hub name.
354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
355
+ # will be added to the HTTP request.
356
+ #
357
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
358
+ #
359
+ def list_all_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
360
+ list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
361
+ end
362
+
363
+ #
364
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
365
+ # consumer group exists in the namespace.
366
+ #
367
+ # @param resource_group_name [String] The name of the resource group.
368
+ # @param namespace_name [String] The namespace name.
369
+ # @param event_hub_name [String] The Event Hub name.
370
+ # @param [Hash{String => String}] A hash of custom headers that will be added
371
+ # to the HTTP request.
372
+ #
373
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
374
+ #
375
+ def list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
376
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
377
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
378
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
379
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
380
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
381
+
382
+
383
+ request_headers = {}
384
+
385
+ # Set Headers
386
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
387
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
388
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups'
389
+
390
+ request_url = @base_url || @client.base_url
391
+
392
+ options = {
393
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
394
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
395
+ query_params: {'api-version' => @client.api_version},
396
+ headers: request_headers.merge(custom_headers || {}),
397
+ base_url: request_url
398
+ }
399
+ promise = @client.make_request_async(:get, path_template, options)
400
+
401
+ promise = promise.then do |result|
402
+ http_response = result.response
403
+ status_code = http_response.status
404
+ response_content = http_response.body
405
+ unless status_code == 200
406
+ error_model = JSON.load(response_content)
407
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
408
+ end
409
+
410
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
411
+ # Deserialize Response
412
+ if status_code == 200
413
+ begin
414
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
415
+ result_mapper = ConsumerGroupListResult.mapper()
416
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
417
+ rescue Exception => e
418
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
419
+ end
420
+ end
421
+
422
+ result
423
+ end
424
+
425
+ promise.execute
426
+ end
427
+
428
+ #
429
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
430
+ # consumer group exists in the namespace.
431
+ #
432
+ # @param next_page_link [String] The NextLink from the previous successful call
433
+ # to List operation.
434
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
+ # will be added to the HTTP request.
436
+ #
437
+ # @return [ConsumerGroupListResult] operation results.
438
+ #
439
+ def list_all_next(next_page_link, custom_headers = nil)
440
+ response = list_all_next_async(next_page_link, custom_headers).value!
441
+ response.body unless response.nil?
442
+ end
443
+
444
+ #
445
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
446
+ # consumer group exists in the namespace.
447
+ #
448
+ # @param next_page_link [String] The NextLink from the previous successful call
449
+ # to List operation.
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
454
+ #
455
+ def list_all_next_with_http_info(next_page_link, custom_headers = nil)
456
+ list_all_next_async(next_page_link, custom_headers).value!
457
+ end
458
+
459
+ #
460
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
461
+ # consumer group exists in the namespace.
462
+ #
463
+ # @param next_page_link [String] The NextLink from the previous successful call
464
+ # to List operation.
465
+ # @param [Hash{String => String}] A hash of custom headers that will be added
466
+ # to the HTTP request.
467
+ #
468
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
469
+ #
470
+ def list_all_next_async(next_page_link, custom_headers = nil)
471
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
472
+
473
+
474
+ request_headers = {}
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 = '{nextLink}'
480
+
481
+ request_url = @base_url || @client.base_url
482
+
483
+ options = {
484
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
485
+ skip_encoding_path_params: {'nextLink' => next_page_link},
486
+ headers: request_headers.merge(custom_headers || {}),
487
+ base_url: request_url
488
+ }
489
+ promise = @client.make_request_async(:get, path_template, options)
490
+
491
+ promise = promise.then do |result|
492
+ http_response = result.response
493
+ status_code = http_response.status
494
+ response_content = http_response.body
495
+ unless status_code == 200
496
+ error_model = JSON.load(response_content)
497
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
498
+ end
499
+
500
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
501
+ # Deserialize Response
502
+ if status_code == 200
503
+ begin
504
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
505
+ result_mapper = ConsumerGroupListResult.mapper()
506
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
507
+ rescue Exception => e
508
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
509
+ end
510
+ end
511
+
512
+ result
513
+ end
514
+
515
+ promise.execute
516
+ end
517
+
518
+ #
519
+ # Gets all the consumer groups in a namespace. An empty feed is returned if no
520
+ # consumer group exists in the namespace.
521
+ #
522
+ # @param resource_group_name [String] The name of the resource group.
523
+ # @param namespace_name [String] The namespace name.
524
+ # @param event_hub_name [String] The Event Hub name.
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [ConsumerGroupListResult] which provide lazy access to pages of the
529
+ # response.
530
+ #
531
+ def list_all_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
532
+ response = list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
533
+ unless response.nil?
534
+ page = response.body
535
+ page.next_method = Proc.new do |next_page_link|
536
+ list_all_next_async(next_page_link, custom_headers)
537
+ end
538
+ page
539
+ end
540
+ end
541
+
542
+ end
543
+ end