azure_mgmt_event_hub 0.17.1 → 0.18.2

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