azure_mgmt_event_hub 0.18.1 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -37,9 +37,6 @@ module Azure::EventHub::Mgmt::V2017_04_01
37
37
  # generated and included in each request. Default is true.
38
38
  attr_accessor :generate_client_request_id
39
39
 
40
- # @return [Operations] operations
41
- attr_reader :operations
42
-
43
40
  # @return [Namespaces] namespaces
44
41
  attr_reader :namespaces
45
42
 
@@ -52,6 +49,9 @@ module Azure::EventHub::Mgmt::V2017_04_01
52
49
  # @return [ConsumerGroups] consumer_groups
53
50
  attr_reader :consumer_groups
54
51
 
52
+ # @return [Operations] operations
53
+ attr_reader :operations
54
+
55
55
  # @return [Regions] regions
56
56
  attr_reader :regions
57
57
 
@@ -68,11 +68,11 @@ module Azure::EventHub::Mgmt::V2017_04_01
68
68
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
69
69
  @credentials = credentials
70
70
 
71
- @operations = Operations.new(self)
72
71
  @namespaces = Namespaces.new(self)
73
72
  @disaster_recovery_configs = DisasterRecoveryConfigs.new(self)
74
73
  @event_hubs = EventHubs.new(self)
75
74
  @consumer_groups = ConsumerGroups.new(self)
75
+ @operations = Operations.new(self)
76
76
  @regions = Regions.new(self)
77
77
  @api_version = '2017-04-01'
78
78
  @accept_language = 'en-US'
@@ -146,7 +146,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
146
146
  #
147
147
  def add_telemetry
148
148
  sdk_information = 'azure_mgmt_event_hub'
149
- sdk_information = "#{sdk_information}/0.18.1"
149
+ sdk_information = "#{sdk_information}/0.18.2"
150
150
  add_user_agent_information(sdk_information)
151
151
  end
152
152
  end
@@ -22,78 +22,62 @@ module Azure::EventHub::Mgmt::V2017_04_01
22
22
  attr_reader :client
23
23
 
24
24
  #
25
- # Gets all the Event Hubs in a Namespace.
25
+ # Gets the authorization rules for an Event Hub.
26
26
  #
27
27
  # @param resource_group_name [String] Name of the resource group within the
28
28
  # azure subscription.
29
29
  # @param namespace_name [String] The Namespace name
30
- # @param skip [Integer] Skip is only used if a previous operation returned a
31
- # partial result. If a previous response contains a nextLink element, the value
32
- # of the nextLink element will include a skip parameter that specifies a
33
- # starting point to use for subsequent calls.
34
- # @param top [Integer] May be used to limit the number of results to the most
35
- # recent N usageDetails.
30
+ # @param event_hub_name [String] The Event Hub name
36
31
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
32
  # will be added to the HTTP request.
38
33
  #
39
- # @return [Array<Eventhub>] operation results.
34
+ # @return [Array<AuthorizationRule>] operation results.
40
35
  #
41
- def list_by_namespace(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
42
- first_page = list_by_namespace_as_lazy(resource_group_name, namespace_name, skip:skip, top:top, custom_headers:custom_headers)
36
+ def list_authorization_rules(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
37
+ first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers)
43
38
  first_page.get_all_items
44
39
  end
45
40
 
46
41
  #
47
- # Gets all the Event Hubs in a Namespace.
42
+ # Gets the authorization rules for an Event Hub.
48
43
  #
49
44
  # @param resource_group_name [String] Name of the resource group within the
50
45
  # azure subscription.
51
46
  # @param namespace_name [String] The Namespace name
52
- # @param skip [Integer] Skip is only used if a previous operation returned a
53
- # partial result. If a previous response contains a nextLink element, the value
54
- # of the nextLink element will include a skip parameter that specifies a
55
- # starting point to use for subsequent calls.
56
- # @param top [Integer] May be used to limit the number of results to the most
57
- # recent N usageDetails.
47
+ # @param event_hub_name [String] The Event Hub name
58
48
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
59
49
  # will be added to the HTTP request.
60
50
  #
61
51
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
52
  #
63
- def list_by_namespace_with_http_info(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
64
- list_by_namespace_async(resource_group_name, namespace_name, skip:skip, top:top, custom_headers:custom_headers).value!
53
+ def list_authorization_rules_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
54
+ list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
65
55
  end
66
56
 
67
57
  #
68
- # Gets all the Event Hubs in a Namespace.
58
+ # Gets the authorization rules for an Event Hub.
69
59
  #
70
60
  # @param resource_group_name [String] Name of the resource group within the
71
61
  # azure subscription.
72
62
  # @param namespace_name [String] The Namespace name
73
- # @param skip [Integer] Skip is only used if a previous operation returned a
74
- # partial result. If a previous response contains a nextLink element, the value
75
- # of the nextLink element will include a skip parameter that specifies a
76
- # starting point to use for subsequent calls.
77
- # @param top [Integer] May be used to limit the number of results to the most
78
- # recent N usageDetails.
63
+ # @param event_hub_name [String] The Event Hub name
79
64
  # @param [Hash{String => String}] A hash of custom headers that will be added
80
65
  # to the HTTP request.
81
66
  #
82
67
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
83
68
  #
84
- def list_by_namespace_async(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
69
+ def list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
85
70
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
86
71
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
87
72
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
88
73
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
89
74
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
90
75
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
76
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
77
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
78
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
91
79
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
92
80
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
93
- fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !skip.nil? && skip > 1000
94
- fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
95
- fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
96
- fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
97
81
 
98
82
 
99
83
  request_headers = {}
@@ -102,14 +86,14 @@ module Azure::EventHub::Mgmt::V2017_04_01
102
86
  # Set Headers
103
87
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
104
88
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
105
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs'
89
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules'
106
90
 
107
91
  request_url = @base_url || @client.base_url
108
92
 
109
93
  options = {
110
94
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
111
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
112
- query_params: {'api-version' => @client.api_version,'$skip' => skip,'$top' => top},
95
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
96
+ query_params: {'api-version' => @client.api_version},
113
97
  headers: request_headers.merge(custom_headers || {}),
114
98
  base_url: request_url
115
99
  }
@@ -131,7 +115,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
131
115
  if status_code == 200
132
116
  begin
133
117
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
134
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EventHubListResult.mapper()
118
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRuleListResult.mapper()
135
119
  result.body = @client.deserialize(result_mapper, parsed_response)
136
120
  rescue Exception => e
137
121
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -145,57 +129,63 @@ module Azure::EventHub::Mgmt::V2017_04_01
145
129
  end
146
130
 
147
131
  #
148
- # Creates or updates a new Event Hub as a nested resource within a Namespace.
132
+ # Creates or updates an AuthorizationRule for the specified Event Hub.
133
+ # Creation/update of the AuthorizationRule will take a few seconds to take
134
+ # effect.
149
135
  #
150
136
  # @param resource_group_name [String] Name of the resource group within the
151
137
  # azure subscription.
152
138
  # @param namespace_name [String] The Namespace name
153
139
  # @param event_hub_name [String] The Event Hub name
154
- # @param parameters [Eventhub] Parameters supplied to create an Event Hub
155
- # resource.
140
+ # @param authorization_rule_name [String] The authorization rule name.
141
+ # @param parameters [AuthorizationRule] The shared access AuthorizationRule.
156
142
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
143
  # will be added to the HTTP request.
158
144
  #
159
- # @return [Eventhub] operation results.
145
+ # @return [AuthorizationRule] operation results.
160
146
  #
161
- def create_or_update(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:nil)
162
- response = create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:custom_headers).value!
147
+ def create_or_update_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
148
+ response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
163
149
  response.body unless response.nil?
164
150
  end
165
151
 
166
152
  #
167
- # Creates or updates a new Event Hub as a nested resource within a Namespace.
153
+ # Creates or updates an AuthorizationRule for the specified Event Hub.
154
+ # Creation/update of the AuthorizationRule will take a few seconds to take
155
+ # effect.
168
156
  #
169
157
  # @param resource_group_name [String] Name of the resource group within the
170
158
  # azure subscription.
171
159
  # @param namespace_name [String] The Namespace name
172
160
  # @param event_hub_name [String] The Event Hub name
173
- # @param parameters [Eventhub] Parameters supplied to create an Event Hub
174
- # resource.
161
+ # @param authorization_rule_name [String] The authorization rule name.
162
+ # @param parameters [AuthorizationRule] The shared access AuthorizationRule.
175
163
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
176
164
  # will be added to the HTTP request.
177
165
  #
178
166
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
179
167
  #
180
- def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:nil)
181
- create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:custom_headers).value!
168
+ def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
169
+ create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
182
170
  end
183
171
 
184
172
  #
185
- # Creates or updates a new Event Hub as a nested resource within a Namespace.
173
+ # Creates or updates an AuthorizationRule for the specified Event Hub.
174
+ # Creation/update of the AuthorizationRule will take a few seconds to take
175
+ # effect.
186
176
  #
187
177
  # @param resource_group_name [String] Name of the resource group within the
188
178
  # azure subscription.
189
179
  # @param namespace_name [String] The Namespace name
190
180
  # @param event_hub_name [String] The Event Hub name
191
- # @param parameters [Eventhub] Parameters supplied to create an Event Hub
192
- # resource.
181
+ # @param authorization_rule_name [String] The authorization rule name.
182
+ # @param parameters [AuthorizationRule] The shared access AuthorizationRule.
193
183
  # @param [Hash{String => String}] A hash of custom headers that will be added
194
184
  # to the HTTP request.
195
185
  #
196
186
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
197
187
  #
198
- def create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:nil)
188
+ def create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
199
189
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
200
190
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
201
191
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -203,8 +193,10 @@ module Azure::EventHub::Mgmt::V2017_04_01
203
193
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
204
194
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
205
195
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
206
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
196
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
207
197
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
198
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
199
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
208
200
  fail ArgumentError, 'parameters is nil' if parameters.nil?
209
201
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
210
202
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
@@ -218,17 +210,17 @@ module Azure::EventHub::Mgmt::V2017_04_01
218
210
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
219
211
 
220
212
  # Serialize Request
221
- request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::Eventhub.mapper()
213
+ request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
222
214
  request_content = @client.serialize(request_mapper, parameters)
223
215
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
224
216
 
225
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'
217
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'
226
218
 
227
219
  request_url = @base_url || @client.base_url
228
220
 
229
221
  options = {
230
222
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
231
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
223
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
232
224
  query_params: {'api-version' => @client.api_version},
233
225
  body: request_content,
234
226
  headers: request_headers.merge(custom_headers || {}),
@@ -252,7 +244,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
252
244
  if status_code == 200
253
245
  begin
254
246
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
255
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::Eventhub.mapper()
247
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
256
248
  result.body = @client.deserialize(result_mapper, parsed_response)
257
249
  rescue Exception => e
258
250
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -266,50 +258,54 @@ module Azure::EventHub::Mgmt::V2017_04_01
266
258
  end
267
259
 
268
260
  #
269
- # Deletes an Event Hub from the specified Namespace and resource group.
261
+ # Gets an AuthorizationRule for an Event Hub by rule name.
270
262
  #
271
263
  # @param resource_group_name [String] Name of the resource group within the
272
264
  # azure subscription.
273
265
  # @param namespace_name [String] The Namespace name
274
266
  # @param event_hub_name [String] The Event Hub name
267
+ # @param authorization_rule_name [String] The authorization rule name.
275
268
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
276
269
  # will be added to the HTTP request.
277
270
  #
271
+ # @return [AuthorizationRule] operation results.
278
272
  #
279
- def delete(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
280
- response = delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
281
- nil
273
+ def get_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
274
+ response = get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
275
+ response.body unless response.nil?
282
276
  end
283
277
 
284
278
  #
285
- # Deletes an Event Hub from the specified Namespace and resource group.
279
+ # Gets an AuthorizationRule for an Event Hub by rule name.
286
280
  #
287
281
  # @param resource_group_name [String] Name of the resource group within the
288
282
  # azure subscription.
289
283
  # @param namespace_name [String] The Namespace name
290
284
  # @param event_hub_name [String] The Event Hub name
285
+ # @param authorization_rule_name [String] The authorization rule name.
291
286
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
287
  # will be added to the HTTP request.
293
288
  #
294
289
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
295
290
  #
296
- def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
297
- delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
291
+ def get_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
292
+ get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
298
293
  end
299
294
 
300
295
  #
301
- # Deletes an Event Hub from the specified Namespace and resource group.
296
+ # Gets an AuthorizationRule for an Event Hub by rule name.
302
297
  #
303
298
  # @param resource_group_name [String] Name of the resource group within the
304
299
  # azure subscription.
305
300
  # @param namespace_name [String] The Namespace name
306
301
  # @param event_hub_name [String] The Event Hub name
302
+ # @param authorization_rule_name [String] The authorization rule name.
307
303
  # @param [Hash{String => String}] A hash of custom headers that will be added
308
304
  # to the HTTP request.
309
305
  #
310
306
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
311
307
  #
312
- def delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
308
+ def get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
313
309
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
314
310
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
315
311
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -317,8 +313,10 @@ module Azure::EventHub::Mgmt::V2017_04_01
317
313
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
318
314
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
319
315
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
320
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
316
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
321
317
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
318
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
319
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
322
320
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
323
321
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
324
322
 
@@ -329,24 +327,24 @@ module Azure::EventHub::Mgmt::V2017_04_01
329
327
  # Set Headers
330
328
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
331
329
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
332
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'
330
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'
333
331
 
334
332
  request_url = @base_url || @client.base_url
335
333
 
336
334
  options = {
337
335
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
338
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
336
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
339
337
  query_params: {'api-version' => @client.api_version},
340
338
  headers: request_headers.merge(custom_headers || {}),
341
339
  base_url: request_url
342
340
  }
343
- promise = @client.make_request_async(:delete, path_template, options)
341
+ promise = @client.make_request_async(:get, path_template, options)
344
342
 
345
343
  promise = promise.then do |result|
346
344
  http_response = result.response
347
345
  status_code = http_response.status
348
346
  response_content = http_response.body
349
- unless status_code == 204 || status_code == 200
347
+ unless status_code == 200
350
348
  error_model = JSON.load(response_content)
351
349
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
352
350
  end
@@ -354,6 +352,16 @@ module Azure::EventHub::Mgmt::V2017_04_01
354
352
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
355
353
  result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
356
354
  result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
355
+ # Deserialize Response
356
+ if status_code == 200
357
+ begin
358
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
359
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
360
+ result.body = @client.deserialize(result_mapper, parsed_response)
361
+ rescue Exception => e
362
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
363
+ end
364
+ end
357
365
 
358
366
  result
359
367
  end
@@ -362,51 +370,53 @@ module Azure::EventHub::Mgmt::V2017_04_01
362
370
  end
363
371
 
364
372
  #
365
- # Gets an Event Hubs description for the specified Event Hub.
373
+ # Deletes an Event Hub AuthorizationRule.
366
374
  #
367
375
  # @param resource_group_name [String] Name of the resource group within the
368
376
  # azure subscription.
369
377
  # @param namespace_name [String] The Namespace name
370
378
  # @param event_hub_name [String] The Event Hub name
379
+ # @param authorization_rule_name [String] The authorization rule name.
371
380
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
381
  # will be added to the HTTP request.
373
382
  #
374
- # @return [Eventhub] operation results.
375
383
  #
376
- def get(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
377
- response = get_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
378
- response.body unless response.nil?
384
+ def delete_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
385
+ response = delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
386
+ nil
379
387
  end
380
388
 
381
389
  #
382
- # Gets an Event Hubs description for the specified Event Hub.
390
+ # Deletes an Event Hub AuthorizationRule.
383
391
  #
384
392
  # @param resource_group_name [String] Name of the resource group within the
385
393
  # azure subscription.
386
394
  # @param namespace_name [String] The Namespace name
387
395
  # @param event_hub_name [String] The Event Hub name
396
+ # @param authorization_rule_name [String] The authorization rule name.
388
397
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
389
398
  # will be added to the HTTP request.
390
399
  #
391
400
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
392
401
  #
393
- def get_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
394
- get_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
402
+ def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
403
+ delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
395
404
  end
396
405
 
397
406
  #
398
- # Gets an Event Hubs description for the specified Event Hub.
407
+ # Deletes an Event Hub AuthorizationRule.
399
408
  #
400
409
  # @param resource_group_name [String] Name of the resource group within the
401
410
  # azure subscription.
402
411
  # @param namespace_name [String] The Namespace name
403
412
  # @param event_hub_name [String] The Event Hub name
413
+ # @param authorization_rule_name [String] The authorization rule name.
404
414
  # @param [Hash{String => String}] A hash of custom headers that will be added
405
415
  # to the HTTP request.
406
416
  #
407
417
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
408
418
  #
409
- def get_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
419
+ def delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
410
420
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
411
421
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
412
422
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -414,8 +424,10 @@ module Azure::EventHub::Mgmt::V2017_04_01
414
424
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
415
425
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
416
426
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
417
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
427
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
418
428
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
429
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
430
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
419
431
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
420
432
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
421
433
 
@@ -426,24 +438,24 @@ module Azure::EventHub::Mgmt::V2017_04_01
426
438
  # Set Headers
427
439
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
428
440
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
429
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'
441
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'
430
442
 
431
443
  request_url = @base_url || @client.base_url
432
444
 
433
445
  options = {
434
446
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
435
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
447
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
436
448
  query_params: {'api-version' => @client.api_version},
437
449
  headers: request_headers.merge(custom_headers || {}),
438
450
  base_url: request_url
439
451
  }
440
- promise = @client.make_request_async(:get, path_template, options)
452
+ promise = @client.make_request_async(:delete, path_template, options)
441
453
 
442
454
  promise = promise.then do |result|
443
455
  http_response = result.response
444
456
  status_code = http_response.status
445
457
  response_content = http_response.body
446
- unless status_code == 200
458
+ unless status_code == 200 || status_code == 204
447
459
  error_model = JSON.load(response_content)
448
460
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
449
461
  end
@@ -451,16 +463,6 @@ module Azure::EventHub::Mgmt::V2017_04_01
451
463
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
452
464
  result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
453
465
  result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
454
- # Deserialize Response
455
- if status_code == 200
456
- begin
457
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
458
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::Eventhub.mapper()
459
- result.body = @client.deserialize(result_mapper, parsed_response)
460
- rescue Exception => e
461
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
462
- end
463
- end
464
466
 
465
467
  result
466
468
  end
@@ -469,51 +471,54 @@ module Azure::EventHub::Mgmt::V2017_04_01
469
471
  end
470
472
 
471
473
  #
472
- # Gets the authorization rules for an Event Hub.
474
+ # Gets the ACS and SAS connection strings for the Event Hub.
473
475
  #
474
476
  # @param resource_group_name [String] Name of the resource group within the
475
477
  # azure subscription.
476
478
  # @param namespace_name [String] The Namespace name
477
479
  # @param event_hub_name [String] The Event Hub name
480
+ # @param authorization_rule_name [String] The authorization rule name.
478
481
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
482
  # will be added to the HTTP request.
480
483
  #
481
- # @return [Array<AuthorizationRule>] operation results.
484
+ # @return [AccessKeys] operation results.
482
485
  #
483
- def list_authorization_rules(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
484
- first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers)
485
- first_page.get_all_items
486
+ def list_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
487
+ response = list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
488
+ response.body unless response.nil?
486
489
  end
487
490
 
488
491
  #
489
- # Gets the authorization rules for an Event Hub.
492
+ # Gets the ACS and SAS connection strings for the Event Hub.
490
493
  #
491
494
  # @param resource_group_name [String] Name of the resource group within the
492
495
  # azure subscription.
493
496
  # @param namespace_name [String] The Namespace name
494
497
  # @param event_hub_name [String] The Event Hub name
498
+ # @param authorization_rule_name [String] The authorization rule name.
495
499
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
496
500
  # will be added to the HTTP request.
497
501
  #
498
502
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
499
503
  #
500
- def list_authorization_rules_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
501
- list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
504
+ def list_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
505
+ list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
502
506
  end
503
507
 
504
508
  #
505
- # Gets the authorization rules for an Event Hub.
509
+ # Gets the ACS and SAS connection strings for the Event Hub.
506
510
  #
507
511
  # @param resource_group_name [String] Name of the resource group within the
508
512
  # azure subscription.
509
513
  # @param namespace_name [String] The Namespace name
510
514
  # @param event_hub_name [String] The Event Hub name
515
+ # @param authorization_rule_name [String] The authorization rule name.
511
516
  # @param [Hash{String => String}] A hash of custom headers that will be added
512
517
  # to the HTTP request.
513
518
  #
514
519
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
515
520
  #
516
- def list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
521
+ def list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
517
522
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
518
523
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
519
524
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -521,8 +526,10 @@ module Azure::EventHub::Mgmt::V2017_04_01
521
526
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
522
527
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
523
528
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
524
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
529
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
525
530
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
531
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
532
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
526
533
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
527
534
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
528
535
 
@@ -533,18 +540,18 @@ module Azure::EventHub::Mgmt::V2017_04_01
533
540
  # Set Headers
534
541
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
535
542
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
536
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules'
543
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys'
537
544
 
538
545
  request_url = @base_url || @client.base_url
539
546
 
540
547
  options = {
541
548
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
542
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
549
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
543
550
  query_params: {'api-version' => @client.api_version},
544
551
  headers: request_headers.merge(custom_headers || {}),
545
552
  base_url: request_url
546
553
  }
547
- promise = @client.make_request_async(:get, path_template, options)
554
+ promise = @client.make_request_async(:post, path_template, options)
548
555
 
549
556
  promise = promise.then do |result|
550
557
  http_response = result.response
@@ -562,7 +569,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
562
569
  if status_code == 200
563
570
  begin
564
571
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
565
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRuleListResult.mapper()
572
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
566
573
  result.body = @client.deserialize(result_mapper, parsed_response)
567
574
  rescue Exception => e
568
575
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -576,57 +583,60 @@ module Azure::EventHub::Mgmt::V2017_04_01
576
583
  end
577
584
 
578
585
  #
579
- # Creates or updates an AuthorizationRule for the specified Event Hub.
586
+ # Regenerates the ACS and SAS connection strings for the Event Hub.
580
587
  #
581
588
  # @param resource_group_name [String] Name of the resource group within the
582
589
  # azure subscription.
583
590
  # @param namespace_name [String] The Namespace name
584
591
  # @param event_hub_name [String] The Event Hub name
585
592
  # @param authorization_rule_name [String] The authorization rule name.
586
- # @param parameters [AuthorizationRule] The shared access AuthorizationRule.
593
+ # @param parameters [RegenerateAccessKeyParameters] Parameters supplied to
594
+ # regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
587
595
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
588
596
  # will be added to the HTTP request.
589
597
  #
590
- # @return [AuthorizationRule] operation results.
598
+ # @return [AccessKeys] operation results.
591
599
  #
592
- def create_or_update_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
593
- response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
600
+ def regenerate_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
601
+ response = regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
594
602
  response.body unless response.nil?
595
603
  end
596
604
 
597
605
  #
598
- # Creates or updates an AuthorizationRule for the specified Event Hub.
606
+ # Regenerates the ACS and SAS connection strings for the Event Hub.
599
607
  #
600
608
  # @param resource_group_name [String] Name of the resource group within the
601
609
  # azure subscription.
602
610
  # @param namespace_name [String] The Namespace name
603
611
  # @param event_hub_name [String] The Event Hub name
604
612
  # @param authorization_rule_name [String] The authorization rule name.
605
- # @param parameters [AuthorizationRule] The shared access AuthorizationRule.
613
+ # @param parameters [RegenerateAccessKeyParameters] Parameters supplied to
614
+ # regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
606
615
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
607
616
  # will be added to the HTTP request.
608
617
  #
609
618
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
610
619
  #
611
- def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
612
- create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
620
+ def regenerate_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
621
+ regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
613
622
  end
614
623
 
615
624
  #
616
- # Creates or updates an AuthorizationRule for the specified Event Hub.
625
+ # Regenerates the ACS and SAS connection strings for the Event Hub.
617
626
  #
618
627
  # @param resource_group_name [String] Name of the resource group within the
619
628
  # azure subscription.
620
629
  # @param namespace_name [String] The Namespace name
621
630
  # @param event_hub_name [String] The Event Hub name
622
631
  # @param authorization_rule_name [String] The authorization rule name.
623
- # @param parameters [AuthorizationRule] The shared access AuthorizationRule.
632
+ # @param parameters [RegenerateAccessKeyParameters] Parameters supplied to
633
+ # regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
624
634
  # @param [Hash{String => String}] A hash of custom headers that will be added
625
635
  # to the HTTP request.
626
636
  #
627
637
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
628
638
  #
629
- def create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
639
+ def regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
630
640
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
631
641
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
632
642
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -634,7 +644,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
634
644
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
635
645
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
636
646
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
637
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
647
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
638
648
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
639
649
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
640
650
  fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
@@ -651,11 +661,11 @@ module Azure::EventHub::Mgmt::V2017_04_01
651
661
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
652
662
 
653
663
  # Serialize Request
654
- request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
664
+ request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::RegenerateAccessKeyParameters.mapper()
655
665
  request_content = @client.serialize(request_mapper, parameters)
656
666
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
657
667
 
658
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'
668
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
659
669
 
660
670
  request_url = @base_url || @client.base_url
661
671
 
@@ -667,7 +677,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
667
677
  headers: request_headers.merge(custom_headers || {}),
668
678
  base_url: request_url
669
679
  }
670
- promise = @client.make_request_async(:put, path_template, options)
680
+ promise = @client.make_request_async(:post, path_template, options)
671
681
 
672
682
  promise = promise.then do |result|
673
683
  http_response = result.response
@@ -685,7 +695,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
685
695
  if status_code == 200
686
696
  begin
687
697
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
688
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
698
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
689
699
  result.body = @client.deserialize(result_mapper, parsed_response)
690
700
  rescue Exception => e
691
701
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -699,67 +709,78 @@ module Azure::EventHub::Mgmt::V2017_04_01
699
709
  end
700
710
 
701
711
  #
702
- # Gets an AuthorizationRule for an Event Hub by rule name.
712
+ # Gets all the Event Hubs in a Namespace.
703
713
  #
704
714
  # @param resource_group_name [String] Name of the resource group within the
705
715
  # azure subscription.
706
716
  # @param namespace_name [String] The Namespace name
707
- # @param event_hub_name [String] The Event Hub name
708
- # @param authorization_rule_name [String] The authorization rule name.
717
+ # @param skip [Integer] Skip is only used if a previous operation returned a
718
+ # partial result. If a previous response contains a nextLink element, the value
719
+ # of the nextLink element will include a skip parameter that specifies a
720
+ # starting point to use for subsequent calls.
721
+ # @param top [Integer] May be used to limit the number of results to the most
722
+ # recent N usageDetails.
709
723
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
710
724
  # will be added to the HTTP request.
711
725
  #
712
- # @return [AuthorizationRule] operation results.
726
+ # @return [Array<Eventhub>] operation results.
713
727
  #
714
- def get_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
715
- response = get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
716
- response.body unless response.nil?
728
+ def list_by_namespace(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
729
+ first_page = list_by_namespace_as_lazy(resource_group_name, namespace_name, skip:skip, top:top, custom_headers:custom_headers)
730
+ first_page.get_all_items
717
731
  end
718
732
 
719
733
  #
720
- # Gets an AuthorizationRule for an Event Hub by rule name.
734
+ # Gets all the Event Hubs in a Namespace.
721
735
  #
722
736
  # @param resource_group_name [String] Name of the resource group within the
723
737
  # azure subscription.
724
738
  # @param namespace_name [String] The Namespace name
725
- # @param event_hub_name [String] The Event Hub name
726
- # @param authorization_rule_name [String] The authorization rule name.
739
+ # @param skip [Integer] Skip is only used if a previous operation returned a
740
+ # partial result. If a previous response contains a nextLink element, the value
741
+ # of the nextLink element will include a skip parameter that specifies a
742
+ # starting point to use for subsequent calls.
743
+ # @param top [Integer] May be used to limit the number of results to the most
744
+ # recent N usageDetails.
727
745
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
746
  # will be added to the HTTP request.
729
747
  #
730
748
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
731
749
  #
732
- def get_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
733
- get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
750
+ def list_by_namespace_with_http_info(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
751
+ list_by_namespace_async(resource_group_name, namespace_name, skip:skip, top:top, custom_headers:custom_headers).value!
734
752
  end
735
753
 
736
754
  #
737
- # Gets an AuthorizationRule for an Event Hub by rule name.
755
+ # Gets all the Event Hubs in a Namespace.
738
756
  #
739
757
  # @param resource_group_name [String] Name of the resource group within the
740
758
  # azure subscription.
741
759
  # @param namespace_name [String] The Namespace name
742
- # @param event_hub_name [String] The Event Hub name
743
- # @param authorization_rule_name [String] The authorization rule name.
760
+ # @param skip [Integer] Skip is only used if a previous operation returned a
761
+ # partial result. If a previous response contains a nextLink element, the value
762
+ # of the nextLink element will include a skip parameter that specifies a
763
+ # starting point to use for subsequent calls.
764
+ # @param top [Integer] May be used to limit the number of results to the most
765
+ # recent N usageDetails.
744
766
  # @param [Hash{String => String}] A hash of custom headers that will be added
745
767
  # to the HTTP request.
746
768
  #
747
769
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
748
770
  #
749
- def get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
771
+ def list_by_namespace_async(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
750
772
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
751
773
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
752
774
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
753
775
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
754
776
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
755
777
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
756
- fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
757
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
758
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
759
- fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
760
- fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
761
778
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
762
779
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
780
+ fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !skip.nil? && skip > 1000
781
+ fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
782
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
783
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
763
784
 
764
785
 
765
786
  request_headers = {}
@@ -768,14 +789,14 @@ module Azure::EventHub::Mgmt::V2017_04_01
768
789
  # Set Headers
769
790
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
770
791
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
771
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'
792
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs'
772
793
 
773
794
  request_url = @base_url || @client.base_url
774
795
 
775
796
  options = {
776
797
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
777
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
778
- query_params: {'api-version' => @client.api_version},
798
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
799
+ query_params: {'api-version' => @client.api_version,'$skip' => skip,'$top' => top},
779
800
  headers: request_headers.merge(custom_headers || {}),
780
801
  base_url: request_url
781
802
  }
@@ -797,7 +818,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
797
818
  if status_code == 200
798
819
  begin
799
820
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
800
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
821
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EventHubListResult.mapper()
801
822
  result.body = @client.deserialize(result_mapper, parsed_response)
802
823
  rescue Exception => e
803
824
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -811,53 +832,57 @@ module Azure::EventHub::Mgmt::V2017_04_01
811
832
  end
812
833
 
813
834
  #
814
- # Deletes an Event Hub AuthorizationRule.
835
+ # Creates or updates a new Event Hub as a nested resource within a Namespace.
815
836
  #
816
837
  # @param resource_group_name [String] Name of the resource group within the
817
838
  # azure subscription.
818
839
  # @param namespace_name [String] The Namespace name
819
840
  # @param event_hub_name [String] The Event Hub name
820
- # @param authorization_rule_name [String] The authorization rule name.
841
+ # @param parameters [Eventhub] Parameters supplied to create an Event Hub
842
+ # resource.
821
843
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
822
844
  # will be added to the HTTP request.
823
845
  #
846
+ # @return [Eventhub] operation results.
824
847
  #
825
- def delete_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
826
- response = delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
827
- nil
848
+ def create_or_update(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:nil)
849
+ response = create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:custom_headers).value!
850
+ response.body unless response.nil?
828
851
  end
829
852
 
830
853
  #
831
- # Deletes an Event Hub AuthorizationRule.
854
+ # Creates or updates a new Event Hub as a nested resource within a Namespace.
832
855
  #
833
856
  # @param resource_group_name [String] Name of the resource group within the
834
857
  # azure subscription.
835
858
  # @param namespace_name [String] The Namespace name
836
859
  # @param event_hub_name [String] The Event Hub name
837
- # @param authorization_rule_name [String] The authorization rule name.
860
+ # @param parameters [Eventhub] Parameters supplied to create an Event Hub
861
+ # resource.
838
862
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
839
863
  # will be added to the HTTP request.
840
864
  #
841
865
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
842
866
  #
843
- def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
844
- delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
867
+ def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:nil)
868
+ create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:custom_headers).value!
845
869
  end
846
870
 
847
871
  #
848
- # Deletes an Event Hub AuthorizationRule.
872
+ # Creates or updates a new Event Hub as a nested resource within a Namespace.
849
873
  #
850
874
  # @param resource_group_name [String] Name of the resource group within the
851
875
  # azure subscription.
852
876
  # @param namespace_name [String] The Namespace name
853
877
  # @param event_hub_name [String] The Event Hub name
854
- # @param authorization_rule_name [String] The authorization rule name.
878
+ # @param parameters [Eventhub] Parameters supplied to create an Event Hub
879
+ # resource.
855
880
  # @param [Hash{String => String}] A hash of custom headers that will be added
856
881
  # to the HTTP request.
857
882
  #
858
883
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
859
884
  #
860
- def delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
885
+ def create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers:nil)
861
886
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
862
887
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
863
888
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -865,10 +890,9 @@ module Azure::EventHub::Mgmt::V2017_04_01
865
890
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
866
891
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
867
892
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
868
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
893
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
869
894
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
870
- fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
871
- fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
895
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
872
896
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
873
897
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
874
898
 
@@ -879,24 +903,31 @@ module Azure::EventHub::Mgmt::V2017_04_01
879
903
  # Set Headers
880
904
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
881
905
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
882
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'
906
+
907
+ # Serialize Request
908
+ request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::Eventhub.mapper()
909
+ request_content = @client.serialize(request_mapper, parameters)
910
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
911
+
912
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'
883
913
 
884
914
  request_url = @base_url || @client.base_url
885
915
 
886
916
  options = {
887
917
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
888
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
918
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
889
919
  query_params: {'api-version' => @client.api_version},
920
+ body: request_content,
890
921
  headers: request_headers.merge(custom_headers || {}),
891
922
  base_url: request_url
892
923
  }
893
- promise = @client.make_request_async(:delete, path_template, options)
924
+ promise = @client.make_request_async(:put, path_template, options)
894
925
 
895
926
  promise = promise.then do |result|
896
927
  http_response = result.response
897
928
  status_code = http_response.status
898
929
  response_content = http_response.body
899
- unless status_code == 204 || status_code == 200
930
+ unless status_code == 200
900
931
  error_model = JSON.load(response_content)
901
932
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
902
933
  end
@@ -904,6 +935,16 @@ module Azure::EventHub::Mgmt::V2017_04_01
904
935
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
905
936
  result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
906
937
  result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
938
+ # Deserialize Response
939
+ if status_code == 200
940
+ begin
941
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
942
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::Eventhub.mapper()
943
+ result.body = @client.deserialize(result_mapper, parsed_response)
944
+ rescue Exception => e
945
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
946
+ end
947
+ end
907
948
 
908
949
  result
909
950
  end
@@ -912,54 +953,50 @@ module Azure::EventHub::Mgmt::V2017_04_01
912
953
  end
913
954
 
914
955
  #
915
- # Gets the ACS and SAS connection strings for the Event Hub.
956
+ # Deletes an Event Hub from the specified Namespace and resource group.
916
957
  #
917
958
  # @param resource_group_name [String] Name of the resource group within the
918
959
  # azure subscription.
919
960
  # @param namespace_name [String] The Namespace name
920
961
  # @param event_hub_name [String] The Event Hub name
921
- # @param authorization_rule_name [String] The authorization rule name.
922
962
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
923
963
  # will be added to the HTTP request.
924
964
  #
925
- # @return [AccessKeys] operation results.
926
965
  #
927
- def list_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
928
- response = list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
929
- response.body unless response.nil?
966
+ def delete(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
967
+ response = delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
968
+ nil
930
969
  end
931
970
 
932
971
  #
933
- # Gets the ACS and SAS connection strings for the Event Hub.
972
+ # Deletes an Event Hub from the specified Namespace and resource group.
934
973
  #
935
974
  # @param resource_group_name [String] Name of the resource group within the
936
975
  # azure subscription.
937
976
  # @param namespace_name [String] The Namespace name
938
977
  # @param event_hub_name [String] The Event Hub name
939
- # @param authorization_rule_name [String] The authorization rule name.
940
978
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
941
979
  # will be added to the HTTP request.
942
980
  #
943
981
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
944
982
  #
945
- def list_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
946
- list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:custom_headers).value!
983
+ def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
984
+ delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
947
985
  end
948
986
 
949
987
  #
950
- # Gets the ACS and SAS connection strings for the Event Hub.
988
+ # Deletes an Event Hub from the specified Namespace and resource group.
951
989
  #
952
990
  # @param resource_group_name [String] Name of the resource group within the
953
991
  # azure subscription.
954
992
  # @param namespace_name [String] The Namespace name
955
993
  # @param event_hub_name [String] The Event Hub name
956
- # @param authorization_rule_name [String] The authorization rule name.
957
994
  # @param [Hash{String => String}] A hash of custom headers that will be added
958
995
  # to the HTTP request.
959
996
  #
960
997
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
961
998
  #
962
- def list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers:nil)
999
+ def delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
963
1000
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
964
1001
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
965
1002
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -967,10 +1004,8 @@ module Azure::EventHub::Mgmt::V2017_04_01
967
1004
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
968
1005
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
969
1006
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
970
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
1007
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
971
1008
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
972
- fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
973
- fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
974
1009
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
975
1010
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
976
1011
 
@@ -981,24 +1016,24 @@ module Azure::EventHub::Mgmt::V2017_04_01
981
1016
  # Set Headers
982
1017
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
983
1018
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
984
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/ListKeys'
1019
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'
985
1020
 
986
1021
  request_url = @base_url || @client.base_url
987
1022
 
988
1023
  options = {
989
1024
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
990
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1025
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
991
1026
  query_params: {'api-version' => @client.api_version},
992
1027
  headers: request_headers.merge(custom_headers || {}),
993
1028
  base_url: request_url
994
1029
  }
995
- promise = @client.make_request_async(:post, path_template, options)
1030
+ promise = @client.make_request_async(:delete, path_template, options)
996
1031
 
997
1032
  promise = promise.then do |result|
998
1033
  http_response = result.response
999
1034
  status_code = http_response.status
1000
1035
  response_content = http_response.body
1001
- unless status_code == 200
1036
+ unless status_code == 200 || status_code == 204
1002
1037
  error_model = JSON.load(response_content)
1003
1038
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1004
1039
  end
@@ -1006,16 +1041,6 @@ module Azure::EventHub::Mgmt::V2017_04_01
1006
1041
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1007
1042
  result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1008
1043
  result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1009
- # Deserialize Response
1010
- if status_code == 200
1011
- begin
1012
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1013
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
1014
- result.body = @client.deserialize(result_mapper, parsed_response)
1015
- rescue Exception => e
1016
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1017
- end
1018
- end
1019
1044
 
1020
1045
  result
1021
1046
  end
@@ -1024,60 +1049,51 @@ module Azure::EventHub::Mgmt::V2017_04_01
1024
1049
  end
1025
1050
 
1026
1051
  #
1027
- # Regenerates the ACS and SAS connection strings for the Event Hub.
1052
+ # Gets an Event Hubs description for the specified Event Hub.
1028
1053
  #
1029
1054
  # @param resource_group_name [String] Name of the resource group within the
1030
1055
  # azure subscription.
1031
1056
  # @param namespace_name [String] The Namespace name
1032
1057
  # @param event_hub_name [String] The Event Hub name
1033
- # @param authorization_rule_name [String] The authorization rule name.
1034
- # @param parameters [RegenerateAccessKeyParameters] Parameters supplied to
1035
- # regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
1036
1058
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1037
1059
  # will be added to the HTTP request.
1038
1060
  #
1039
- # @return [AccessKeys] operation results.
1061
+ # @return [Eventhub] operation results.
1040
1062
  #
1041
- def regenerate_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
1042
- response = regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
1063
+ def get(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
1064
+ response = get_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
1043
1065
  response.body unless response.nil?
1044
1066
  end
1045
1067
 
1046
1068
  #
1047
- # Regenerates the ACS and SAS connection strings for the Event Hub.
1069
+ # Gets an Event Hubs description for the specified Event Hub.
1048
1070
  #
1049
1071
  # @param resource_group_name [String] Name of the resource group within the
1050
1072
  # azure subscription.
1051
1073
  # @param namespace_name [String] The Namespace name
1052
1074
  # @param event_hub_name [String] The Event Hub name
1053
- # @param authorization_rule_name [String] The authorization rule name.
1054
- # @param parameters [RegenerateAccessKeyParameters] Parameters supplied to
1055
- # regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
1056
1075
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1057
1076
  # will be added to the HTTP request.
1058
1077
  #
1059
1078
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1060
1079
  #
1061
- def regenerate_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
1062
- regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
1080
+ def get_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
1081
+ get_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
1063
1082
  end
1064
1083
 
1065
1084
  #
1066
- # Regenerates the ACS and SAS connection strings for the Event Hub.
1085
+ # Gets an Event Hubs description for the specified Event Hub.
1067
1086
  #
1068
1087
  # @param resource_group_name [String] Name of the resource group within the
1069
1088
  # azure subscription.
1070
1089
  # @param namespace_name [String] The Namespace name
1071
1090
  # @param event_hub_name [String] The Event Hub name
1072
- # @param authorization_rule_name [String] The authorization rule name.
1073
- # @param parameters [RegenerateAccessKeyParameters] Parameters supplied to
1074
- # regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
1075
1091
  # @param [Hash{String => String}] A hash of custom headers that will be added
1076
1092
  # to the HTTP request.
1077
1093
  #
1078
1094
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1079
1095
  #
1080
- def regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers:nil)
1096
+ def get_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
1081
1097
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1082
1098
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1083
1099
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
@@ -1085,11 +1101,8 @@ module Azure::EventHub::Mgmt::V2017_04_01
1085
1101
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1086
1102
  fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1087
1103
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
1088
- fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
1104
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '256'" if !event_hub_name.nil? && event_hub_name.length > 256
1089
1105
  fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
1090
- fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1091
- fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1092
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1093
1106
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1094
1107
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1095
1108
 
@@ -1100,25 +1113,18 @@ module Azure::EventHub::Mgmt::V2017_04_01
1100
1113
  # Set Headers
1101
1114
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1102
1115
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1103
-
1104
- # Serialize Request
1105
- request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::RegenerateAccessKeyParameters.mapper()
1106
- request_content = @client.serialize(request_mapper, parameters)
1107
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1108
-
1109
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
1116
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'
1110
1117
 
1111
1118
  request_url = @base_url || @client.base_url
1112
1119
 
1113
1120
  options = {
1114
1121
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1115
- path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1122
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
1116
1123
  query_params: {'api-version' => @client.api_version},
1117
- body: request_content,
1118
1124
  headers: request_headers.merge(custom_headers || {}),
1119
1125
  base_url: request_url
1120
1126
  }
1121
- promise = @client.make_request_async(:post, path_template, options)
1127
+ promise = @client.make_request_async(:get, path_template, options)
1122
1128
 
1123
1129
  promise = promise.then do |result|
1124
1130
  http_response = result.response
@@ -1136,7 +1142,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
1136
1142
  if status_code == 200
1137
1143
  begin
1138
1144
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1139
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
1145
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::Eventhub.mapper()
1140
1146
  result.body = @client.deserialize(result_mapper, parsed_response)
1141
1147
  rescue Exception => e
1142
1148
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1150,22 +1156,22 @@ module Azure::EventHub::Mgmt::V2017_04_01
1150
1156
  end
1151
1157
 
1152
1158
  #
1153
- # Gets all the Event Hubs in a Namespace.
1159
+ # Gets the authorization rules for an Event Hub.
1154
1160
  #
1155
1161
  # @param next_page_link [String] The NextLink from the previous successful call
1156
1162
  # to List operation.
1157
1163
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1158
1164
  # will be added to the HTTP request.
1159
1165
  #
1160
- # @return [EventHubListResult] operation results.
1166
+ # @return [AuthorizationRuleListResult] operation results.
1161
1167
  #
1162
- def list_by_namespace_next(next_page_link, custom_headers:nil)
1163
- response = list_by_namespace_next_async(next_page_link, custom_headers:custom_headers).value!
1168
+ def list_authorization_rules_next(next_page_link, custom_headers:nil)
1169
+ response = list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1164
1170
  response.body unless response.nil?
1165
1171
  end
1166
1172
 
1167
1173
  #
1168
- # Gets all the Event Hubs in a Namespace.
1174
+ # Gets the authorization rules for an Event Hub.
1169
1175
  #
1170
1176
  # @param next_page_link [String] The NextLink from the previous successful call
1171
1177
  # to List operation.
@@ -1174,12 +1180,12 @@ module Azure::EventHub::Mgmt::V2017_04_01
1174
1180
  #
1175
1181
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1176
1182
  #
1177
- def list_by_namespace_next_with_http_info(next_page_link, custom_headers:nil)
1178
- list_by_namespace_next_async(next_page_link, custom_headers:custom_headers).value!
1183
+ def list_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1184
+ list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1179
1185
  end
1180
1186
 
1181
1187
  #
1182
- # Gets all the Event Hubs in a Namespace.
1188
+ # Gets the authorization rules for an Event Hub.
1183
1189
  #
1184
1190
  # @param next_page_link [String] The NextLink from the previous successful call
1185
1191
  # to List operation.
@@ -1188,7 +1194,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
1188
1194
  #
1189
1195
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1190
1196
  #
1191
- def list_by_namespace_next_async(next_page_link, custom_headers:nil)
1197
+ def list_authorization_rules_next_async(next_page_link, custom_headers:nil)
1192
1198
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1193
1199
 
1194
1200
 
@@ -1226,7 +1232,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
1226
1232
  if status_code == 200
1227
1233
  begin
1228
1234
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1229
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EventHubListResult.mapper()
1235
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRuleListResult.mapper()
1230
1236
  result.body = @client.deserialize(result_mapper, parsed_response)
1231
1237
  rescue Exception => e
1232
1238
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1240,22 +1246,22 @@ module Azure::EventHub::Mgmt::V2017_04_01
1240
1246
  end
1241
1247
 
1242
1248
  #
1243
- # Gets the authorization rules for an Event Hub.
1249
+ # Gets all the Event Hubs in a Namespace.
1244
1250
  #
1245
1251
  # @param next_page_link [String] The NextLink from the previous successful call
1246
1252
  # to List operation.
1247
1253
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1248
1254
  # will be added to the HTTP request.
1249
1255
  #
1250
- # @return [AuthorizationRuleListResult] operation results.
1256
+ # @return [EventHubListResult] operation results.
1251
1257
  #
1252
- def list_authorization_rules_next(next_page_link, custom_headers:nil)
1253
- response = list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1258
+ def list_by_namespace_next(next_page_link, custom_headers:nil)
1259
+ response = list_by_namespace_next_async(next_page_link, custom_headers:custom_headers).value!
1254
1260
  response.body unless response.nil?
1255
1261
  end
1256
1262
 
1257
1263
  #
1258
- # Gets the authorization rules for an Event Hub.
1264
+ # Gets all the Event Hubs in a Namespace.
1259
1265
  #
1260
1266
  # @param next_page_link [String] The NextLink from the previous successful call
1261
1267
  # to List operation.
@@ -1264,12 +1270,12 @@ module Azure::EventHub::Mgmt::V2017_04_01
1264
1270
  #
1265
1271
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1266
1272
  #
1267
- def list_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1268
- list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1273
+ def list_by_namespace_next_with_http_info(next_page_link, custom_headers:nil)
1274
+ list_by_namespace_next_async(next_page_link, custom_headers:custom_headers).value!
1269
1275
  end
1270
1276
 
1271
1277
  #
1272
- # Gets the authorization rules for an Event Hub.
1278
+ # Gets all the Event Hubs in a Namespace.
1273
1279
  #
1274
1280
  # @param next_page_link [String] The NextLink from the previous successful call
1275
1281
  # to List operation.
@@ -1278,7 +1284,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
1278
1284
  #
1279
1285
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1280
1286
  #
1281
- def list_authorization_rules_next_async(next_page_link, custom_headers:nil)
1287
+ def list_by_namespace_next_async(next_page_link, custom_headers:nil)
1282
1288
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1283
1289
 
1284
1290
 
@@ -1316,7 +1322,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
1316
1322
  if status_code == 200
1317
1323
  begin
1318
1324
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1319
- result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRuleListResult.mapper()
1325
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EventHubListResult.mapper()
1320
1326
  result.body = @client.deserialize(result_mapper, parsed_response)
1321
1327
  rescue Exception => e
1322
1328
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1330,53 +1336,53 @@ module Azure::EventHub::Mgmt::V2017_04_01
1330
1336
  end
1331
1337
 
1332
1338
  #
1333
- # Gets all the Event Hubs in a Namespace.
1339
+ # Gets the authorization rules for an Event Hub.
1334
1340
  #
1335
1341
  # @param resource_group_name [String] Name of the resource group within the
1336
1342
  # azure subscription.
1337
1343
  # @param namespace_name [String] The Namespace name
1338
- # @param skip [Integer] Skip is only used if a previous operation returned a
1339
- # partial result. If a previous response contains a nextLink element, the value
1340
- # of the nextLink element will include a skip parameter that specifies a
1341
- # starting point to use for subsequent calls.
1342
- # @param top [Integer] May be used to limit the number of results to the most
1343
- # recent N usageDetails.
1344
+ # @param event_hub_name [String] The Event Hub name
1344
1345
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1345
1346
  # will be added to the HTTP request.
1346
1347
  #
1347
- # @return [EventHubListResult] which provide lazy access to pages of the
1348
- # response.
1348
+ # @return [AuthorizationRuleListResult] which provide lazy access to pages of
1349
+ # the response.
1349
1350
  #
1350
- def list_by_namespace_as_lazy(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
1351
- response = list_by_namespace_async(resource_group_name, namespace_name, skip:skip, top:top, custom_headers:custom_headers).value!
1351
+ def list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
1352
+ response = list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
1352
1353
  unless response.nil?
1353
1354
  page = response.body
1354
1355
  page.next_method = Proc.new do |next_page_link|
1355
- list_by_namespace_next_async(next_page_link, custom_headers:custom_headers)
1356
+ list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
1356
1357
  end
1357
1358
  page
1358
1359
  end
1359
1360
  end
1360
1361
 
1361
1362
  #
1362
- # Gets the authorization rules for an Event Hub.
1363
+ # Gets all the Event Hubs in a Namespace.
1363
1364
  #
1364
1365
  # @param resource_group_name [String] Name of the resource group within the
1365
1366
  # azure subscription.
1366
1367
  # @param namespace_name [String] The Namespace name
1367
- # @param event_hub_name [String] The Event Hub name
1368
+ # @param skip [Integer] Skip is only used if a previous operation returned a
1369
+ # partial result. If a previous response contains a nextLink element, the value
1370
+ # of the nextLink element will include a skip parameter that specifies a
1371
+ # starting point to use for subsequent calls.
1372
+ # @param top [Integer] May be used to limit the number of results to the most
1373
+ # recent N usageDetails.
1368
1374
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1369
1375
  # will be added to the HTTP request.
1370
1376
  #
1371
- # @return [AuthorizationRuleListResult] which provide lazy access to pages of
1372
- # the response.
1377
+ # @return [EventHubListResult] which provide lazy access to pages of the
1378
+ # response.
1373
1379
  #
1374
- def list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
1375
- response = list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
1380
+ def list_by_namespace_as_lazy(resource_group_name, namespace_name, skip:nil, top:nil, custom_headers:nil)
1381
+ response = list_by_namespace_async(resource_group_name, namespace_name, skip:skip, top:top, custom_headers:custom_headers).value!
1376
1382
  unless response.nil?
1377
1383
  page = response.body
1378
1384
  page.next_method = Proc.new do |next_page_link|
1379
- list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
1385
+ list_by_namespace_next_async(next_page_link, custom_headers:custom_headers)
1380
1386
  end
1381
1387
  page
1382
1388
  end