azure_mgmt_event_hub 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-08-01/generated/azure_mgmt_event_hub/consumer_groups.rb +555 -0
  3. data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +143 -0
  4. data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hubs.rb +1268 -0
  5. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/access_rights.rb +1 -1
  6. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/check_name_availability_parameter.rb +1 -1
  7. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/check_name_availability_result.rb +13 -13
  8. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/consumer_group_create_or_update_parameters.rb +107 -0
  9. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/consumer_group_list_result.rb +96 -0
  10. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/consumer_group_resource.rb +108 -0
  11. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/entity_status.rb +1 -1
  12. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/event_hub_create_or_update_parameters.rb +139 -0
  13. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/event_hub_list_result.rb +96 -0
  14. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/event_hub_resource.rb +140 -0
  15. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/namespace_create_or_update_parameters.rb +148 -0
  16. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/namespace_list_result.rb +96 -0
  17. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/namespace_resource.rb +166 -0
  18. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/namespace_state.rb +27 -0
  19. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/namespace_update_parameter.rb +62 -0
  20. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/operation.rb +1 -1
  21. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/operation_display.rb +1 -1
  22. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/operation_list_result.rb +1 -1
  23. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/policykey.rb +16 -0
  24. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/regenerate_keys_parameters.rb +46 -0
  25. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/resource.rb +77 -0
  26. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/resource_list_keys.rb +93 -0
  27. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_create_or_update_parameters.rb +74 -0
  28. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_list_result.rb +98 -0
  29. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_resource.rb +83 -0
  30. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/sku.rb +66 -0
  31. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/sku_name.rb +1 -1
  32. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/sku_tier.rb +17 -0
  33. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/tracked_resource.rb +82 -0
  34. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/models/unavailable_reason.rb +1 -1
  35. data/lib/2015-08-01/generated/azure_mgmt_event_hub/module_definition.rb +9 -0
  36. data/lib/2015-08-01/generated/azure_mgmt_event_hub/namespaces.rb +1764 -0
  37. data/lib/2015-08-01/generated/azure_mgmt_event_hub/operations.rb +213 -0
  38. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_event_hub/version.rb +2 -2
  39. data/lib/2015-08-01/generated/azure_mgmt_event_hub.rb +61 -0
  40. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/consumer_groups.rb +6 -6
  41. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/disaster_recovery_configs.rb +6 -6
  42. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/event_hub_management_client.rb +3 -3
  43. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/event_hubs.rb +14 -14
  44. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/access_keys.rb +1 -1
  45. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/access_rights.rb +17 -0
  46. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/arm_disaster_recovery.rb +1 -1
  47. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/arm_disaster_recovery_list_result.rb +1 -1
  48. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/authorization_rule.rb +1 -1
  49. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/authorization_rule_list_result.rb +1 -1
  50. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/capture_description.rb +1 -1
  51. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/check_name_availability_parameter.rb +44 -0
  52. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/check_name_availability_result.rb +71 -0
  53. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/consumer_group.rb +1 -1
  54. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/consumer_group_list_result.rb +1 -1
  55. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/destination.rb +1 -1
  56. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/ehnamespace.rb +1 -1
  57. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/ehnamespace_list_result.rb +1 -1
  58. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/encoding_capture_description.rb +1 -1
  59. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/entity_status.rb +23 -0
  60. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/error_response.rb +1 -1
  61. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/event_hub_list_result.rb +1 -1
  62. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/eventhub.rb +1 -1
  63. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/key_type.rb +1 -1
  64. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/operation.rb +56 -0
  65. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/operation_display.rb +68 -0
  66. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/operation_list_result.rb +99 -0
  67. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/provisioning_state_dr.rb +1 -1
  68. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/regenerate_access_key_parameters.rb +1 -1
  69. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/resource.rb +1 -1
  70. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/role_disaster_recovery.rb +1 -1
  71. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/sku.rb +1 -1
  72. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku_name.rb +16 -0
  73. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/sku_tier.rb +1 -1
  74. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/models/tracked_resource.rb +1 -1
  75. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/unavailable_reason.rb +20 -0
  76. data/lib/2017-04-01/generated/azure_mgmt_event_hub/module_definition.rb +9 -0
  77. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/namespaces.rb +24 -24
  78. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub/operations.rb +3 -3
  79. data/lib/{generated/azure_mgmt_event_hub/module_definition.rb → 2017-04-01/generated/azure_mgmt_event_hub/version.rb} +3 -3
  80. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_event_hub.rb +40 -40
  81. data/lib/azure_mgmt_event_hub.rb +3 -1
  82. data/lib/module_definition.rb +7 -0
  83. data/lib/profiles/common/configurable.rb +73 -0
  84. data/lib/profiles/common/default.rb +68 -0
  85. data/lib/profiles/latest/eventhub_latest_profile_client.rb +33 -0
  86. data/lib/profiles/latest/eventhub_module_definition.rb +9 -0
  87. data/lib/profiles/latest/modules/eventhub_profile_module.rb +178 -0
  88. data/lib/version.rb +7 -0
  89. metadata +88 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df5e43f1de9a6f8d25e1c8deff284a77d8cffdb0
4
- data.tar.gz: 347681351bf8eb3eac4d2755b3f7316199eecee3
3
+ metadata.gz: dda03430210a7814f065c40913e8c2d0f674d89f
4
+ data.tar.gz: 1edea4c0af72eff3a1a8a3d1348de8d6f1cbf428
5
5
  SHA512:
6
- metadata.gz: 22abd6470241686e07db5c48b856214b7cec7f5e293f875580a3f9fef935e0c10c8a5ab9486582052f2d7f81d885e5339ccecfd78fceb9d34bd15ffe6e862c1e
7
- data.tar.gz: 904e5550b81fc43f49680a2f23dbffa9470bfa9690b887596b84f7c63a050e9c032411d7da535d8287a95c639ca2ae54dd97845c0b4195fb5fd1e75647bf7a7a
6
+ metadata.gz: 2b32029beff4ca45b105cbf64d668c9c125eac51479aefc57e222dc79356e5b8a09ec15ce0090544d9e3dfcfed1bd3b630156b2c42fe25297acd375109d774fc
7
+ data.tar.gz: a3d533c164d531265a90af165f38dd39564fdd4df70e0a911d3ddb722e60791855712e7c8506f324db07049a9d581c651a7de092a4a6b16381ff07c81342425e
@@ -0,0 +1,555 @@
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::V2015_08_01
7
+ #
8
+ # Azure Event Hubs client
9
+ #
10
+ class ConsumerGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ConsumerGroups class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [EventHubManagementClient] reference to the EventHubManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
26
+ # 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 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 or update 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] Name of the resource group within the
50
+ # azure subscription.
51
+ # @param namespace_name [String] The Namespace name
52
+ # @param event_hub_name [String] The Event Hub name
53
+ # @param consumer_group_name [String] The consumer group name
54
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
55
+ # to create or update a consumer group resource.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers = nil)
62
+ create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
67
+ # Namespace.
68
+ #
69
+ # @param resource_group_name [String] Name of the resource group within the
70
+ # azure subscription.
71
+ # @param namespace_name [String] The Namespace name
72
+ # @param event_hub_name [String] The Event Hub name
73
+ # @param consumer_group_name [String] The consumer group name
74
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
75
+ # to create or update a consumer group resource.
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers = nil)
82
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
83
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
84
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
85
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
86
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
87
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+
90
+
91
+ request_headers = {}
92
+
93
+ # Set Headers
94
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
95
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
96
+
97
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
98
+
99
+ # Serialize Request
100
+ request_mapper = Azure::EventHub::Mgmt::V2015_08_01::Models::ConsumerGroupCreateOrUpdateParameters.mapper()
101
+ request_content = @client.serialize(request_mapper, parameters)
102
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
103
+
104
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
105
+
106
+ request_url = @base_url || @client.base_url
107
+
108
+ options = {
109
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
110
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
111
+ query_params: {'api-version' => @client.api_version},
112
+ body: request_content,
113
+ headers: request_headers.merge(custom_headers || {}),
114
+ base_url: request_url
115
+ }
116
+ promise = @client.make_request_async(:put, path_template, options)
117
+
118
+ promise = promise.then do |result|
119
+ http_response = result.response
120
+ status_code = http_response.status
121
+ response_content = http_response.body
122
+ unless status_code == 200
123
+ error_model = JSON.load(response_content)
124
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
125
+ end
126
+
127
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
128
+ # Deserialize Response
129
+ if status_code == 200
130
+ begin
131
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
132
+ result_mapper = Azure::EventHub::Mgmt::V2015_08_01::Models::ConsumerGroupResource.mapper()
133
+ result.body = @client.deserialize(result_mapper, parsed_response)
134
+ rescue Exception => e
135
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
136
+ end
137
+ end
138
+
139
+ result
140
+ end
141
+
142
+ promise.execute
143
+ end
144
+
145
+ #
146
+ # Deletes a consumer group from the specified Event Hub and resource group.
147
+ #
148
+ # @param resource_group_name [String] Name of the resource group within the
149
+ # azure subscription.
150
+ # @param namespace_name [String] The Namespace name
151
+ # @param event_hub_name [String] The Event Hub name
152
+ # @param consumer_group_name [String] The consumer group name
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ #
157
+ def delete(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
158
+ response = delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
159
+ nil
160
+ end
161
+
162
+ #
163
+ # Deletes a consumer group from the specified Event Hub and resource group.
164
+ #
165
+ # @param resource_group_name [String] Name of the resource group within the
166
+ # azure subscription.
167
+ # @param namespace_name [String] The Namespace name
168
+ # @param event_hub_name [String] The Event Hub name
169
+ # @param consumer_group_name [String] The consumer group name
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
174
+ #
175
+ def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
176
+ delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
177
+ end
178
+
179
+ #
180
+ # Deletes a consumer group from the specified Event Hub and resource group.
181
+ #
182
+ # @param resource_group_name [String] Name of the resource group within the
183
+ # azure subscription.
184
+ # @param namespace_name [String] The Namespace name
185
+ # @param event_hub_name [String] The Event Hub name
186
+ # @param consumer_group_name [String] The consumer group name
187
+ # @param [Hash{String => String}] A hash of custom headers that will be added
188
+ # to the HTTP request.
189
+ #
190
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
191
+ #
192
+ def delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
193
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
194
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
195
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
196
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
197
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
198
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
199
+
200
+
201
+ request_headers = {}
202
+
203
+ # Set Headers
204
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
205
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
206
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
207
+
208
+ request_url = @base_url || @client.base_url
209
+
210
+ options = {
211
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
212
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
213
+ query_params: {'api-version' => @client.api_version},
214
+ headers: request_headers.merge(custom_headers || {}),
215
+ base_url: request_url
216
+ }
217
+ promise = @client.make_request_async(:delete, 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 == 204 || status_code == 200
224
+ error_model = JSON.load(response_content)
225
+ fail MsRestAzure::AzureOperationError.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
+
230
+ result
231
+ end
232
+
233
+ promise.execute
234
+ end
235
+
236
+ #
237
+ # Gets a description for the specified consumer group.
238
+ #
239
+ # @param resource_group_name [String] Name of the resource group within the
240
+ # azure subscription.
241
+ # @param namespace_name [String] The Namespace name
242
+ # @param event_hub_name [String] The Event Hub name
243
+ # @param consumer_group_name [String] The consumer group name
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [ConsumerGroupResource] operation results.
248
+ #
249
+ def get(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
250
+ response = get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
251
+ response.body unless response.nil?
252
+ end
253
+
254
+ #
255
+ # Gets a description for the specified consumer group.
256
+ #
257
+ # @param resource_group_name [String] Name of the resource group within the
258
+ # azure subscription.
259
+ # @param namespace_name [String] The Namespace name
260
+ # @param event_hub_name [String] The Event Hub name
261
+ # @param consumer_group_name [String] The consumer group name
262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
263
+ # will be added to the HTTP request.
264
+ #
265
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
266
+ #
267
+ def get_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
268
+ get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers).value!
269
+ end
270
+
271
+ #
272
+ # Gets a description for the specified consumer group.
273
+ #
274
+ # @param resource_group_name [String] Name of the resource group within the
275
+ # azure subscription.
276
+ # @param namespace_name [String] The Namespace name
277
+ # @param event_hub_name [String] The Event Hub name
278
+ # @param consumer_group_name [String] The consumer group name
279
+ # @param [Hash{String => String}] A hash of custom headers that will be added
280
+ # to the HTTP request.
281
+ #
282
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
283
+ #
284
+ def get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers = nil)
285
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
286
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
287
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
288
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
289
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
290
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
291
+
292
+
293
+ request_headers = {}
294
+
295
+ # Set Headers
296
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
297
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
298
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
299
+
300
+ request_url = @base_url || @client.base_url
301
+
302
+ options = {
303
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
304
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
305
+ query_params: {'api-version' => @client.api_version},
306
+ headers: request_headers.merge(custom_headers || {}),
307
+ base_url: request_url
308
+ }
309
+ promise = @client.make_request_async(:get, path_template, options)
310
+
311
+ promise = promise.then do |result|
312
+ http_response = result.response
313
+ status_code = http_response.status
314
+ response_content = http_response.body
315
+ unless status_code == 200
316
+ error_model = JSON.load(response_content)
317
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
318
+ end
319
+
320
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
321
+ # Deserialize Response
322
+ if status_code == 200
323
+ begin
324
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
325
+ result_mapper = Azure::EventHub::Mgmt::V2015_08_01::Models::ConsumerGroupResource.mapper()
326
+ result.body = @client.deserialize(result_mapper, parsed_response)
327
+ rescue Exception => e
328
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
329
+ end
330
+ end
331
+
332
+ result
333
+ end
334
+
335
+ promise.execute
336
+ end
337
+
338
+ #
339
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
340
+ # consumer group exists in the Namespace.
341
+ #
342
+ # @param resource_group_name [String] Name of the resource group within the
343
+ # azure subscription.
344
+ # @param namespace_name [String] The Namespace name
345
+ # @param event_hub_name [String] The Event Hub name
346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
+ # will be added to the HTTP request.
348
+ #
349
+ # @return [Array<ConsumerGroupResource>] operation results.
350
+ #
351
+ def list_all(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
352
+ first_page = list_all_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers)
353
+ first_page.get_all_items
354
+ end
355
+
356
+ #
357
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
358
+ # consumer group exists in the Namespace.
359
+ #
360
+ # @param resource_group_name [String] Name of the resource group within the
361
+ # azure subscription.
362
+ # @param namespace_name [String] The Namespace name
363
+ # @param event_hub_name [String] The Event Hub name
364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
365
+ # will be added to the HTTP request.
366
+ #
367
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
368
+ #
369
+ def list_all_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
370
+ list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
371
+ end
372
+
373
+ #
374
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
375
+ # consumer group exists in the Namespace.
376
+ #
377
+ # @param resource_group_name [String] Name of the resource group within the
378
+ # azure subscription.
379
+ # @param namespace_name [String] The Namespace name
380
+ # @param event_hub_name [String] The Event Hub name
381
+ # @param [Hash{String => String}] A hash of custom headers that will be added
382
+ # to the HTTP request.
383
+ #
384
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
385
+ #
386
+ def list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
387
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
388
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
389
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
390
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
391
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
392
+
393
+
394
+ request_headers = {}
395
+
396
+ # Set Headers
397
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
398
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
399
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups'
400
+
401
+ request_url = @base_url || @client.base_url
402
+
403
+ options = {
404
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
405
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
406
+ query_params: {'api-version' => @client.api_version},
407
+ headers: request_headers.merge(custom_headers || {}),
408
+ base_url: request_url
409
+ }
410
+ promise = @client.make_request_async(:get, path_template, options)
411
+
412
+ promise = promise.then do |result|
413
+ http_response = result.response
414
+ status_code = http_response.status
415
+ response_content = http_response.body
416
+ unless status_code == 200
417
+ error_model = JSON.load(response_content)
418
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
419
+ end
420
+
421
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
422
+ # Deserialize Response
423
+ if status_code == 200
424
+ begin
425
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
426
+ result_mapper = Azure::EventHub::Mgmt::V2015_08_01::Models::ConsumerGroupListResult.mapper()
427
+ result.body = @client.deserialize(result_mapper, parsed_response)
428
+ rescue Exception => e
429
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
430
+ end
431
+ end
432
+
433
+ result
434
+ end
435
+
436
+ promise.execute
437
+ end
438
+
439
+ #
440
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
441
+ # consumer group exists in the Namespace.
442
+ #
443
+ # @param next_page_link [String] The NextLink from the previous successful call
444
+ # to List operation.
445
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
+ # will be added to the HTTP request.
447
+ #
448
+ # @return [ConsumerGroupListResult] operation results.
449
+ #
450
+ def list_all_next(next_page_link, custom_headers = nil)
451
+ response = list_all_next_async(next_page_link, custom_headers).value!
452
+ response.body unless response.nil?
453
+ end
454
+
455
+ #
456
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
457
+ # consumer group exists in the Namespace.
458
+ #
459
+ # @param next_page_link [String] The NextLink from the previous successful call
460
+ # to List operation.
461
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
462
+ # will be added to the HTTP request.
463
+ #
464
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
465
+ #
466
+ def list_all_next_with_http_info(next_page_link, custom_headers = nil)
467
+ list_all_next_async(next_page_link, custom_headers).value!
468
+ end
469
+
470
+ #
471
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
472
+ # consumer group exists in the Namespace.
473
+ #
474
+ # @param next_page_link [String] The NextLink from the previous successful call
475
+ # to List operation.
476
+ # @param [Hash{String => String}] A hash of custom headers that will be added
477
+ # to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
480
+ #
481
+ def list_all_next_async(next_page_link, custom_headers = nil)
482
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
483
+
484
+
485
+ request_headers = {}
486
+
487
+ # Set Headers
488
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
489
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
490
+ path_template = '{nextLink}'
491
+
492
+ request_url = @base_url || @client.base_url
493
+
494
+ options = {
495
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
496
+ skip_encoding_path_params: {'nextLink' => next_page_link},
497
+ headers: request_headers.merge(custom_headers || {}),
498
+ base_url: request_url
499
+ }
500
+ promise = @client.make_request_async(:get, path_template, options)
501
+
502
+ promise = promise.then do |result|
503
+ http_response = result.response
504
+ status_code = http_response.status
505
+ response_content = http_response.body
506
+ unless status_code == 200
507
+ error_model = JSON.load(response_content)
508
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
509
+ end
510
+
511
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
512
+ # Deserialize Response
513
+ if status_code == 200
514
+ begin
515
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
516
+ result_mapper = Azure::EventHub::Mgmt::V2015_08_01::Models::ConsumerGroupListResult.mapper()
517
+ result.body = @client.deserialize(result_mapper, parsed_response)
518
+ rescue Exception => e
519
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
520
+ end
521
+ end
522
+
523
+ result
524
+ end
525
+
526
+ promise.execute
527
+ end
528
+
529
+ #
530
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
531
+ # consumer group exists in the Namespace.
532
+ #
533
+ # @param resource_group_name [String] Name of the resource group within the
534
+ # azure subscription.
535
+ # @param namespace_name [String] The Namespace name
536
+ # @param event_hub_name [String] The Event Hub name
537
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
538
+ # will be added to the HTTP request.
539
+ #
540
+ # @return [ConsumerGroupListResult] which provide lazy access to pages of the
541
+ # response.
542
+ #
543
+ def list_all_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
544
+ response = list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
545
+ unless response.nil?
546
+ page = response.body
547
+ page.next_method = Proc.new do |next_page_link|
548
+ list_all_next_async(next_page_link, custom_headers)
549
+ end
550
+ page
551
+ end
552
+ end
553
+
554
+ end
555
+ end