azure_mgmt_service_bus 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-08-01/generated/azure_mgmt_service_bus.rb +67 -0
  3. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/access_rights.rb +1 -1
  4. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/check_name_availability.rb +1 -1
  5. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/check_name_availability_result.rb +70 -0
  6. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/entity_availability_status.rb +19 -0
  7. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/entity_status.rb +5 -5
  8. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/message_count_details.rb +8 -8
  9. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_create_or_update_parameters.rb +151 -0
  10. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_list_result.rb +96 -0
  11. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_resource.rb +169 -0
  12. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_state.rb +27 -0
  13. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_update_parameters.rb +62 -0
  14. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/operation.rb +1 -1
  15. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/operation_display.rb +1 -1
  16. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/operation_list_result.rb +1 -1
  17. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/policykey.rb +16 -0
  18. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_create_or_update_parameters.rb +307 -0
  19. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_list_result.rb +95 -0
  20. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_resource.rb +318 -0
  21. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/regenerate_keys_parameters.rb +46 -0
  22. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/resource.rb +77 -0
  23. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/resource_list_keys.rb +88 -0
  24. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_create_or_update_parameters.rb +74 -0
  25. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_list_result.rb +98 -0
  26. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_resource.rb +83 -0
  27. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/sku.rb +66 -0
  28. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/sku_name.rb +1 -1
  29. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/sku_tier.rb +1 -1
  30. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_create_or_update_parameters.rb +237 -0
  31. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_list_result.rb +96 -0
  32. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_resource.rb +248 -0
  33. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_create_or_update_parameters.rb +294 -0
  34. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_list_result.rb +95 -0
  35. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_resource.rb +305 -0
  36. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/tracked_resource.rb +82 -0
  37. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/models/unavailable_reason.rb +1 -1
  38. data/lib/2015-08-01/generated/azure_mgmt_service_bus/module_definition.rb +9 -0
  39. data/lib/2015-08-01/generated/azure_mgmt_service_bus/namespaces.rb +1751 -0
  40. data/lib/2015-08-01/generated/azure_mgmt_service_bus/operations.rb +213 -0
  41. data/lib/2015-08-01/generated/azure_mgmt_service_bus/queues.rb +1267 -0
  42. data/lib/2015-08-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb +147 -0
  43. data/lib/2015-08-01/generated/azure_mgmt_service_bus/subscriptions.rb +545 -0
  44. data/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb +1267 -0
  45. data/lib/{generated → 2015-08-01/generated}/azure_mgmt_service_bus/version.rb +2 -2
  46. data/lib/2017-04-01/generated/azure_mgmt_service_bus.rb +87 -0
  47. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/disaster_recovery_configs.rb +6 -6
  48. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/event_hubs.rb +3 -3
  49. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/access_keys.rb +1 -1
  50. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/access_rights.rb +17 -0
  51. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/action.rb +1 -1
  52. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/arm_disaster_recovery.rb +1 -1
  53. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb +1 -1
  54. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/authorization_rule_properties.rb +1 -1
  55. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/capture_description.rb +1 -1
  56. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/check_name_availability.rb +47 -0
  57. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/check_name_availability_result.rb +1 -1
  58. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/correlation_filter.rb +1 -1
  59. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/destination.rb +1 -1
  60. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/encoding_capture_description.rb +1 -1
  61. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/entity_status.rb +23 -0
  62. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/error_response.rb +1 -1
  63. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/event_hub_list_result.rb +1 -1
  64. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/eventhub.rb +1 -1
  65. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/filter_type.rb +1 -1
  66. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/key_type.rb +1 -1
  67. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/message_count_details.rb +91 -0
  68. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation.rb +56 -0
  69. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation_display.rb +68 -0
  70. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation_list_result.rb +99 -0
  71. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/premium_messaging_regions.rb +1 -1
  72. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb +1 -1
  73. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb +1 -1
  74. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/provisioning_state_dr.rb +1 -1
  75. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb +1 -1
  76. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/resource.rb +1 -1
  77. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/resource_namespace_patch.rb +1 -1
  78. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/role_disaster_recovery.rb +1 -1
  79. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/rule.rb +1 -1
  80. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/rule_list_result.rb +1 -1
  81. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbauthorization_rule.rb +1 -1
  82. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb +1 -1
  83. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbnamespace.rb +1 -1
  84. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbnamespace_list_result.rb +1 -1
  85. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbnamespace_update_parameters.rb +1 -1
  86. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbqueue.rb +1 -1
  87. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbqueue_list_result.rb +1 -1
  88. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbsku.rb +1 -1
  89. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbsubscription.rb +1 -1
  90. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbsubscription_list_result.rb +1 -1
  91. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbtopic.rb +1 -1
  92. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sbtopic_list_result.rb +1 -1
  93. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sku_name.rb +17 -0
  94. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sku_tier.rb +17 -0
  95. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sql_filter.rb +1 -1
  96. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/sql_rule_action.rb +1 -1
  97. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/models/tracked_resource.rb +1 -1
  98. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/unavailable_reason.rb +20 -0
  99. data/lib/2017-04-01/generated/azure_mgmt_service_bus/module_definition.rb +9 -0
  100. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/namespaces.rb +23 -23
  101. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/operations.rb +3 -3
  102. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/premium_messaging_regions_operations.rb +3 -3
  103. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/queues.rb +14 -14
  104. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/regions.rb +3 -3
  105. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/rules.rb +6 -6
  106. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/service_bus_management_client.rb +3 -3
  107. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/subscriptions.rb +6 -6
  108. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_service_bus/topics.rb +14 -14
  109. data/lib/{generated/azure_mgmt_service_bus/module_definition.rb → 2017-04-01/generated/azure_mgmt_service_bus/version.rb} +3 -3
  110. data/lib/azure_mgmt_service_bus.rb +3 -1
  111. data/lib/module_definition.rb +7 -0
  112. data/lib/profiles/common/configurable.rb +73 -0
  113. data/lib/profiles/common/default.rb +68 -0
  114. data/lib/profiles/latest/modules/servicebus_profile_module.rb +260 -0
  115. data/lib/profiles/latest/servicebus_latest_profile_client.rb +33 -0
  116. data/lib/profiles/latest/servicebus_module_definition.rb +9 -0
  117. data/lib/version.rb +7 -0
  118. metadata +117 -66
  119. data/lib/generated/azure_mgmt_service_bus.rb +0 -87
@@ -0,0 +1,1267 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ServiceBus::Mgmt::V2015_08_01
7
+ #
8
+ # Azure Service Bus client
9
+ #
10
+ class Topics
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Topics class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all the topics in a namespace.
26
+ #
27
+ # @param resource_group_name [String] Name of the Resource group within the
28
+ # Azure subscription.
29
+ # @param namespace_name [String] The namespace name
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<TopicResource>] operation results.
34
+ #
35
+ def list_all(resource_group_name, namespace_name, custom_headers = nil)
36
+ first_page = list_all_as_lazy(resource_group_name, namespace_name, custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets all the topics in a namespace.
42
+ #
43
+ # @param resource_group_name [String] Name of the Resource group within the
44
+ # Azure subscription.
45
+ # @param namespace_name [String] The namespace name
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_all_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
52
+ list_all_async(resource_group_name, namespace_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets all the topics in a namespace.
57
+ #
58
+ # @param resource_group_name [String] Name of the Resource group within the
59
+ # Azure subscription.
60
+ # @param namespace_name [String] The namespace name
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_all_async(resource_group_name, namespace_name, custom_headers = nil)
67
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
68
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
69
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+
72
+
73
+ request_headers = {}
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
85
+ query_params: {'api-version' => @client.api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:get, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+ # Deserialize Response
102
+ if status_code == 200
103
+ begin
104
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::TopicListResult.mapper()
106
+ result.body = @client.deserialize(result_mapper, parsed_response)
107
+ rescue Exception => e
108
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
+ end
110
+ end
111
+
112
+ result
113
+ end
114
+
115
+ promise.execute
116
+ end
117
+
118
+ #
119
+ # Creates a topic in the specified namespace.
120
+ #
121
+ # @param resource_group_name [String] Name of the Resource group within the
122
+ # Azure subscription.
123
+ # @param namespace_name [String] The namespace name
124
+ # @param topic_name [String] The topic name.
125
+ # @param parameters [TopicCreateOrUpdateParameters] Parameters supplied to
126
+ # create a topic resource.
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [TopicResource] operation results.
131
+ #
132
+ def create_or_update(resource_group_name, namespace_name, topic_name, parameters, custom_headers = nil)
133
+ response = create_or_update_async(resource_group_name, namespace_name, topic_name, parameters, custom_headers).value!
134
+ response.body unless response.nil?
135
+ end
136
+
137
+ #
138
+ # Creates a topic in the specified namespace.
139
+ #
140
+ # @param resource_group_name [String] Name of the Resource group within the
141
+ # Azure subscription.
142
+ # @param namespace_name [String] The namespace name
143
+ # @param topic_name [String] The topic name.
144
+ # @param parameters [TopicCreateOrUpdateParameters] Parameters supplied to
145
+ # create a topic resource.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def create_or_update_with_http_info(resource_group_name, namespace_name, topic_name, parameters, custom_headers = nil)
152
+ create_or_update_async(resource_group_name, namespace_name, topic_name, parameters, custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Creates a topic in the specified namespace.
157
+ #
158
+ # @param resource_group_name [String] Name of the Resource group within the
159
+ # Azure subscription.
160
+ # @param namespace_name [String] The namespace name
161
+ # @param topic_name [String] The topic name.
162
+ # @param parameters [TopicCreateOrUpdateParameters] Parameters supplied to
163
+ # create a topic resource.
164
+ # @param [Hash{String => String}] A hash of custom headers that will be added
165
+ # to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
168
+ #
169
+ def create_or_update_async(resource_group_name, namespace_name, topic_name, parameters, custom_headers = nil)
170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
172
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
173
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
174
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
175
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
176
+
177
+
178
+ request_headers = {}
179
+
180
+ # Set Headers
181
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
182
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
183
+
184
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
185
+
186
+ # Serialize Request
187
+ request_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::TopicCreateOrUpdateParameters.mapper()
188
+ request_content = @client.serialize(request_mapper, parameters)
189
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
190
+
191
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'
192
+
193
+ request_url = @base_url || @client.base_url
194
+
195
+ options = {
196
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
197
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionId' => @client.subscription_id},
198
+ query_params: {'api-version' => @client.api_version},
199
+ body: request_content,
200
+ headers: request_headers.merge(custom_headers || {}),
201
+ base_url: request_url
202
+ }
203
+ promise = @client.make_request_async(:put, path_template, options)
204
+
205
+ promise = promise.then do |result|
206
+ http_response = result.response
207
+ status_code = http_response.status
208
+ response_content = http_response.body
209
+ unless status_code == 200
210
+ error_model = JSON.load(response_content)
211
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
212
+ end
213
+
214
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
215
+ # Deserialize Response
216
+ if status_code == 200
217
+ begin
218
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
219
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::TopicResource.mapper()
220
+ result.body = @client.deserialize(result_mapper, parsed_response)
221
+ rescue Exception => e
222
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
223
+ end
224
+ end
225
+
226
+ result
227
+ end
228
+
229
+ promise.execute
230
+ end
231
+
232
+ #
233
+ # Deletes a topic from the specified namespace and resource group.
234
+ #
235
+ # @param resource_group_name [String] Name of the Resource group within the
236
+ # Azure subscription.
237
+ # @param namespace_name [String] The namespace name
238
+ # @param topic_name [String] The topic name.
239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
240
+ # will be added to the HTTP request.
241
+ #
242
+ #
243
+ def delete(resource_group_name, namespace_name, topic_name, custom_headers = nil)
244
+ response = delete_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
245
+ nil
246
+ end
247
+
248
+ #
249
+ # Deletes a topic from the specified namespace and resource group.
250
+ #
251
+ # @param resource_group_name [String] Name of the Resource group within the
252
+ # Azure subscription.
253
+ # @param namespace_name [String] The namespace name
254
+ # @param topic_name [String] The topic name.
255
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
256
+ # will be added to the HTTP request.
257
+ #
258
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
259
+ #
260
+ def delete_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers = nil)
261
+ delete_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
262
+ end
263
+
264
+ #
265
+ # Deletes a topic from the specified namespace and resource group.
266
+ #
267
+ # @param resource_group_name [String] Name of the Resource group within the
268
+ # Azure subscription.
269
+ # @param namespace_name [String] The namespace name
270
+ # @param topic_name [String] The topic name.
271
+ # @param [Hash{String => String}] A hash of custom headers that will be added
272
+ # to the HTTP request.
273
+ #
274
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
275
+ #
276
+ def delete_async(resource_group_name, namespace_name, topic_name, custom_headers = nil)
277
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
279
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
280
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
281
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
282
+
283
+
284
+ request_headers = {}
285
+
286
+ # Set Headers
287
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
288
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
289
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'
290
+
291
+ request_url = @base_url || @client.base_url
292
+
293
+ options = {
294
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
295
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionId' => @client.subscription_id},
296
+ query_params: {'api-version' => @client.api_version},
297
+ headers: request_headers.merge(custom_headers || {}),
298
+ base_url: request_url
299
+ }
300
+ promise = @client.make_request_async(:delete, path_template, options)
301
+
302
+ promise = promise.then do |result|
303
+ http_response = result.response
304
+ status_code = http_response.status
305
+ response_content = http_response.body
306
+ unless status_code == 204 || status_code == 200
307
+ error_model = JSON.load(response_content)
308
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
309
+ end
310
+
311
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
312
+
313
+ result
314
+ end
315
+
316
+ promise.execute
317
+ end
318
+
319
+ #
320
+ # Returns a description for the specified topic.
321
+ #
322
+ # @param resource_group_name [String] Name of the Resource group within the
323
+ # Azure subscription.
324
+ # @param namespace_name [String] The namespace name
325
+ # @param topic_name [String] The topic name.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [TopicResource] operation results.
330
+ #
331
+ def get(resource_group_name, namespace_name, topic_name, custom_headers = nil)
332
+ response = get_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
333
+ response.body unless response.nil?
334
+ end
335
+
336
+ #
337
+ # Returns a description for the specified topic.
338
+ #
339
+ # @param resource_group_name [String] Name of the Resource group within the
340
+ # Azure subscription.
341
+ # @param namespace_name [String] The namespace name
342
+ # @param topic_name [String] The topic name.
343
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
344
+ # will be added to the HTTP request.
345
+ #
346
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
347
+ #
348
+ def get_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers = nil)
349
+ get_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
350
+ end
351
+
352
+ #
353
+ # Returns a description for the specified topic.
354
+ #
355
+ # @param resource_group_name [String] Name of the Resource group within the
356
+ # Azure subscription.
357
+ # @param namespace_name [String] The namespace name
358
+ # @param topic_name [String] The topic name.
359
+ # @param [Hash{String => String}] A hash of custom headers that will be added
360
+ # to the HTTP request.
361
+ #
362
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
363
+ #
364
+ def get_async(resource_group_name, namespace_name, topic_name, custom_headers = nil)
365
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
366
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
367
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
368
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
369
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
370
+
371
+
372
+ request_headers = {}
373
+
374
+ # Set Headers
375
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
376
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
377
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'
378
+
379
+ request_url = @base_url || @client.base_url
380
+
381
+ options = {
382
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
383
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionId' => @client.subscription_id},
384
+ query_params: {'api-version' => @client.api_version},
385
+ headers: request_headers.merge(custom_headers || {}),
386
+ base_url: request_url
387
+ }
388
+ promise = @client.make_request_async(:get, path_template, options)
389
+
390
+ promise = promise.then do |result|
391
+ http_response = result.response
392
+ status_code = http_response.status
393
+ response_content = http_response.body
394
+ unless status_code == 200
395
+ error_model = JSON.load(response_content)
396
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
397
+ end
398
+
399
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
400
+ # Deserialize Response
401
+ if status_code == 200
402
+ begin
403
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
404
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::TopicResource.mapper()
405
+ result.body = @client.deserialize(result_mapper, parsed_response)
406
+ rescue Exception => e
407
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
408
+ end
409
+ end
410
+
411
+ result
412
+ end
413
+
414
+ promise.execute
415
+ end
416
+
417
+ #
418
+ # Gets authorization rules for a topic.
419
+ #
420
+ # @param resource_group_name [String] Name of the Resource group within the
421
+ # Azure subscription.
422
+ # @param namespace_name [String] The namespace name
423
+ # @param topic_name [String] The topic name.
424
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
425
+ # will be added to the HTTP request.
426
+ #
427
+ # @return [Array<SharedAccessAuthorizationRuleResource>] operation results.
428
+ #
429
+ def list_authorization_rules(resource_group_name, namespace_name, topic_name, custom_headers = nil)
430
+ first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, topic_name, custom_headers)
431
+ first_page.get_all_items
432
+ end
433
+
434
+ #
435
+ # Gets authorization rules for a topic.
436
+ #
437
+ # @param resource_group_name [String] Name of the Resource group within the
438
+ # Azure subscription.
439
+ # @param namespace_name [String] The namespace name
440
+ # @param topic_name [String] The topic name.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
445
+ #
446
+ def list_authorization_rules_with_http_info(resource_group_name, namespace_name, topic_name, custom_headers = nil)
447
+ list_authorization_rules_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Gets authorization rules for a topic.
452
+ #
453
+ # @param resource_group_name [String] Name of the Resource group within the
454
+ # Azure subscription.
455
+ # @param namespace_name [String] The namespace name
456
+ # @param topic_name [String] The topic name.
457
+ # @param [Hash{String => String}] A hash of custom headers that will be added
458
+ # to the HTTP request.
459
+ #
460
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
461
+ #
462
+ def list_authorization_rules_async(resource_group_name, namespace_name, topic_name, custom_headers = nil)
463
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
464
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
465
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
466
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
467
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
468
+
469
+
470
+ request_headers = {}
471
+
472
+ # Set Headers
473
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
474
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
475
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules'
476
+
477
+ request_url = @base_url || @client.base_url
478
+
479
+ options = {
480
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
481
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'subscriptionId' => @client.subscription_id},
482
+ query_params: {'api-version' => @client.api_version},
483
+ headers: request_headers.merge(custom_headers || {}),
484
+ base_url: request_url
485
+ }
486
+ promise = @client.make_request_async(:get, path_template, options)
487
+
488
+ promise = promise.then do |result|
489
+ http_response = result.response
490
+ status_code = http_response.status
491
+ response_content = http_response.body
492
+ unless status_code == 200
493
+ error_model = JSON.load(response_content)
494
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
495
+ end
496
+
497
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
498
+ # Deserialize Response
499
+ if status_code == 200
500
+ begin
501
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
502
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleListResult.mapper()
503
+ result.body = @client.deserialize(result_mapper, parsed_response)
504
+ rescue Exception => e
505
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
506
+ end
507
+ end
508
+
509
+ result
510
+ end
511
+
512
+ promise.execute
513
+ end
514
+
515
+ #
516
+ # Creates an authorizatio rule for the specified topic.
517
+ #
518
+ # @param resource_group_name [String] Name of the Resource group within the
519
+ # Azure subscription.
520
+ # @param namespace_name [String] The namespace name
521
+ # @param topic_name [String] The topic name.
522
+ # @param authorization_rule_name [String] The authorizationrule name.
523
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
524
+ # shared access authorization rule.
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
529
+ #
530
+ def create_or_update_authorization_rule(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers = nil)
531
+ response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers).value!
532
+ response.body unless response.nil?
533
+ end
534
+
535
+ #
536
+ # Creates an authorizatio rule for the specified topic.
537
+ #
538
+ # @param resource_group_name [String] Name of the Resource group within the
539
+ # Azure subscription.
540
+ # @param namespace_name [String] The namespace name
541
+ # @param topic_name [String] The topic name.
542
+ # @param authorization_rule_name [String] The authorizationrule name.
543
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
544
+ # shared access authorization rule.
545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
546
+ # will be added to the HTTP request.
547
+ #
548
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
549
+ #
550
+ def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers = nil)
551
+ create_or_update_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers).value!
552
+ end
553
+
554
+ #
555
+ # Creates an authorizatio rule for the specified topic.
556
+ #
557
+ # @param resource_group_name [String] Name of the Resource group within the
558
+ # Azure subscription.
559
+ # @param namespace_name [String] The namespace name
560
+ # @param topic_name [String] The topic name.
561
+ # @param authorization_rule_name [String] The authorizationrule name.
562
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
563
+ # shared access authorization rule.
564
+ # @param [Hash{String => String}] A hash of custom headers that will be added
565
+ # to the HTTP request.
566
+ #
567
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
568
+ #
569
+ def create_or_update_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers = nil)
570
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
571
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
572
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
573
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
574
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
575
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
576
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
577
+
578
+
579
+ request_headers = {}
580
+
581
+ # Set Headers
582
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
583
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
584
+
585
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
586
+
587
+ # Serialize Request
588
+ request_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleCreateOrUpdateParameters.mapper()
589
+ request_content = @client.serialize(request_mapper, parameters)
590
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
591
+
592
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
593
+
594
+ request_url = @base_url || @client.base_url
595
+
596
+ options = {
597
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
598
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
599
+ query_params: {'api-version' => @client.api_version},
600
+ body: request_content,
601
+ headers: request_headers.merge(custom_headers || {}),
602
+ base_url: request_url
603
+ }
604
+ promise = @client.make_request_async(:put, path_template, options)
605
+
606
+ promise = promise.then do |result|
607
+ http_response = result.response
608
+ status_code = http_response.status
609
+ response_content = http_response.body
610
+ unless status_code == 200
611
+ error_model = JSON.load(response_content)
612
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
613
+ end
614
+
615
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
616
+ # Deserialize Response
617
+ if status_code == 200
618
+ begin
619
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
620
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleResource.mapper()
621
+ result.body = @client.deserialize(result_mapper, parsed_response)
622
+ rescue Exception => e
623
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
624
+ end
625
+ end
626
+
627
+ result
628
+ end
629
+
630
+ promise.execute
631
+ end
632
+
633
+ #
634
+ # Returns the specified authorization rule.
635
+ #
636
+ # @param resource_group_name [String] Name of the Resource group within the
637
+ # Azure subscription.
638
+ # @param namespace_name [String] The namespace name
639
+ # @param topic_name [String] The topic name.
640
+ # @param authorization_rule_name [String] The authorizationrule name.
641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
642
+ # will be added to the HTTP request.
643
+ #
644
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
645
+ #
646
+ def get_authorization_rule(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
647
+ response = get_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers).value!
648
+ response.body unless response.nil?
649
+ end
650
+
651
+ #
652
+ # Returns the specified authorization rule.
653
+ #
654
+ # @param resource_group_name [String] Name of the Resource group within the
655
+ # Azure subscription.
656
+ # @param namespace_name [String] The namespace name
657
+ # @param topic_name [String] The topic name.
658
+ # @param authorization_rule_name [String] The authorizationrule name.
659
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
660
+ # will be added to the HTTP request.
661
+ #
662
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
663
+ #
664
+ def get_authorization_rule_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
665
+ get_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers).value!
666
+ end
667
+
668
+ #
669
+ # Returns the specified authorization rule.
670
+ #
671
+ # @param resource_group_name [String] Name of the Resource group within the
672
+ # Azure subscription.
673
+ # @param namespace_name [String] The namespace name
674
+ # @param topic_name [String] The topic name.
675
+ # @param authorization_rule_name [String] The authorizationrule name.
676
+ # @param [Hash{String => String}] A hash of custom headers that will be added
677
+ # to the HTTP request.
678
+ #
679
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
680
+ #
681
+ def get_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
682
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
683
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
684
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
685
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
686
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
687
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
688
+
689
+
690
+ request_headers = {}
691
+
692
+ # Set Headers
693
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
694
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
695
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
696
+
697
+ request_url = @base_url || @client.base_url
698
+
699
+ options = {
700
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
701
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
702
+ query_params: {'api-version' => @client.api_version},
703
+ headers: request_headers.merge(custom_headers || {}),
704
+ base_url: request_url
705
+ }
706
+ promise = @client.make_request_async(:get, path_template, options)
707
+
708
+ promise = promise.then do |result|
709
+ http_response = result.response
710
+ status_code = http_response.status
711
+ response_content = http_response.body
712
+ unless status_code == 200
713
+ error_model = JSON.load(response_content)
714
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
715
+ end
716
+
717
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
718
+ # Deserialize Response
719
+ if status_code == 200
720
+ begin
721
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
722
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleResource.mapper()
723
+ result.body = @client.deserialize(result_mapper, parsed_response)
724
+ rescue Exception => e
725
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
726
+ end
727
+ end
728
+
729
+ result
730
+ end
731
+
732
+ promise.execute
733
+ end
734
+
735
+ #
736
+ # Deletes a topic authorization rule.
737
+ #
738
+ # @param resource_group_name [String] Name of the Resource group within the
739
+ # Azure subscription.
740
+ # @param namespace_name [String] The namespace name
741
+ # @param topic_name [String] The topic name.
742
+ # @param authorization_rule_name [String] The authorizationrule name.
743
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
744
+ # will be added to the HTTP request.
745
+ #
746
+ #
747
+ def delete_authorization_rule(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
748
+ response = delete_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers).value!
749
+ nil
750
+ end
751
+
752
+ #
753
+ # Deletes a topic authorization rule.
754
+ #
755
+ # @param resource_group_name [String] Name of the Resource group within the
756
+ # Azure subscription.
757
+ # @param namespace_name [String] The namespace name
758
+ # @param topic_name [String] The topic name.
759
+ # @param authorization_rule_name [String] The authorizationrule name.
760
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
761
+ # will be added to the HTTP request.
762
+ #
763
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
764
+ #
765
+ def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
766
+ delete_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers).value!
767
+ end
768
+
769
+ #
770
+ # Deletes a topic authorization rule.
771
+ #
772
+ # @param resource_group_name [String] Name of the Resource group within the
773
+ # Azure subscription.
774
+ # @param namespace_name [String] The namespace name
775
+ # @param topic_name [String] The topic name.
776
+ # @param authorization_rule_name [String] The authorizationrule name.
777
+ # @param [Hash{String => String}] A hash of custom headers that will be added
778
+ # to the HTTP request.
779
+ #
780
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
781
+ #
782
+ def delete_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
783
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
784
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
785
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
786
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
787
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
788
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
789
+
790
+
791
+ request_headers = {}
792
+
793
+ # Set Headers
794
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
795
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
796
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
797
+
798
+ request_url = @base_url || @client.base_url
799
+
800
+ options = {
801
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
802
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
803
+ query_params: {'api-version' => @client.api_version},
804
+ headers: request_headers.merge(custom_headers || {}),
805
+ base_url: request_url
806
+ }
807
+ promise = @client.make_request_async(:delete, path_template, options)
808
+
809
+ promise = promise.then do |result|
810
+ http_response = result.response
811
+ status_code = http_response.status
812
+ response_content = http_response.body
813
+ unless status_code == 204 || status_code == 200
814
+ error_model = JSON.load(response_content)
815
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
816
+ end
817
+
818
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
819
+
820
+ result
821
+ end
822
+
823
+ promise.execute
824
+ end
825
+
826
+ #
827
+ # Gets the primary and secondary connection strings for the topic.
828
+ #
829
+ # @param resource_group_name [String] Name of the Resource group within the
830
+ # Azure subscription.
831
+ # @param namespace_name [String] The namespace name
832
+ # @param topic_name [String] The topic name.
833
+ # @param authorization_rule_name [String] The authorizationrule name.
834
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
835
+ # will be added to the HTTP request.
836
+ #
837
+ # @return [ResourceListKeys] operation results.
838
+ #
839
+ def list_keys(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
840
+ response = list_keys_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers).value!
841
+ response.body unless response.nil?
842
+ end
843
+
844
+ #
845
+ # Gets the primary and secondary connection strings for the topic.
846
+ #
847
+ # @param resource_group_name [String] Name of the Resource group within the
848
+ # Azure subscription.
849
+ # @param namespace_name [String] The namespace name
850
+ # @param topic_name [String] The topic name.
851
+ # @param authorization_rule_name [String] The authorizationrule name.
852
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
853
+ # will be added to the HTTP request.
854
+ #
855
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
856
+ #
857
+ def list_keys_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
858
+ list_keys_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers).value!
859
+ end
860
+
861
+ #
862
+ # Gets the primary and secondary connection strings for the topic.
863
+ #
864
+ # @param resource_group_name [String] Name of the Resource group within the
865
+ # Azure subscription.
866
+ # @param namespace_name [String] The namespace name
867
+ # @param topic_name [String] The topic name.
868
+ # @param authorization_rule_name [String] The authorizationrule name.
869
+ # @param [Hash{String => String}] A hash of custom headers that will be added
870
+ # to the HTTP request.
871
+ #
872
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
873
+ #
874
+ def list_keys_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers = nil)
875
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
876
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
877
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
878
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
879
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
880
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
881
+
882
+
883
+ request_headers = {}
884
+
885
+ # Set Headers
886
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
887
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
888
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys'
889
+
890
+ request_url = @base_url || @client.base_url
891
+
892
+ options = {
893
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
894
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
895
+ query_params: {'api-version' => @client.api_version},
896
+ headers: request_headers.merge(custom_headers || {}),
897
+ base_url: request_url
898
+ }
899
+ promise = @client.make_request_async(:post, path_template, options)
900
+
901
+ promise = promise.then do |result|
902
+ http_response = result.response
903
+ status_code = http_response.status
904
+ response_content = http_response.body
905
+ unless status_code == 200
906
+ error_model = JSON.load(response_content)
907
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
908
+ end
909
+
910
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
911
+ # Deserialize Response
912
+ if status_code == 200
913
+ begin
914
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
915
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::ResourceListKeys.mapper()
916
+ result.body = @client.deserialize(result_mapper, parsed_response)
917
+ rescue Exception => e
918
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
919
+ end
920
+ end
921
+
922
+ result
923
+ end
924
+
925
+ promise.execute
926
+ end
927
+
928
+ #
929
+ # Regenerates primary or secondary connection strings for the topic.
930
+ #
931
+ # @param resource_group_name [String] Name of the Resource group within the
932
+ # Azure subscription.
933
+ # @param namespace_name [String] The namespace name
934
+ # @param topic_name [String] The topic name.
935
+ # @param authorization_rule_name [String] The authorizationrule name.
936
+ # @param parameters [RegenerateKeysParameters] Parameters supplied to
937
+ # regenerate the authorization rule.
938
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
939
+ # will be added to the HTTP request.
940
+ #
941
+ # @return [ResourceListKeys] operation results.
942
+ #
943
+ def regenerate_keys(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers = nil)
944
+ response = regenerate_keys_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers).value!
945
+ response.body unless response.nil?
946
+ end
947
+
948
+ #
949
+ # Regenerates primary or secondary connection strings for the topic.
950
+ #
951
+ # @param resource_group_name [String] Name of the Resource group within the
952
+ # Azure subscription.
953
+ # @param namespace_name [String] The namespace name
954
+ # @param topic_name [String] The topic name.
955
+ # @param authorization_rule_name [String] The authorizationrule name.
956
+ # @param parameters [RegenerateKeysParameters] Parameters supplied to
957
+ # regenerate the authorization rule.
958
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
959
+ # will be added to the HTTP request.
960
+ #
961
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
962
+ #
963
+ def regenerate_keys_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers = nil)
964
+ regenerate_keys_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers).value!
965
+ end
966
+
967
+ #
968
+ # Regenerates primary or secondary connection strings for the topic.
969
+ #
970
+ # @param resource_group_name [String] Name of the Resource group within the
971
+ # Azure subscription.
972
+ # @param namespace_name [String] The namespace name
973
+ # @param topic_name [String] The topic name.
974
+ # @param authorization_rule_name [String] The authorizationrule name.
975
+ # @param parameters [RegenerateKeysParameters] Parameters supplied to
976
+ # regenerate the authorization rule.
977
+ # @param [Hash{String => String}] A hash of custom headers that will be added
978
+ # to the HTTP request.
979
+ #
980
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
981
+ #
982
+ def regenerate_keys_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, parameters, custom_headers = nil)
983
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
984
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
985
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
986
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
987
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
988
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
989
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
990
+
991
+
992
+ request_headers = {}
993
+
994
+ # Set Headers
995
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
996
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
997
+
998
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
999
+
1000
+ # Serialize Request
1001
+ request_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::RegenerateKeysParameters.mapper()
1002
+ request_content = @client.serialize(request_mapper, parameters)
1003
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1004
+
1005
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
1006
+
1007
+ request_url = @base_url || @client.base_url
1008
+
1009
+ options = {
1010
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1011
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1012
+ query_params: {'api-version' => @client.api_version},
1013
+ body: request_content,
1014
+ headers: request_headers.merge(custom_headers || {}),
1015
+ base_url: request_url
1016
+ }
1017
+ promise = @client.make_request_async(:post, path_template, options)
1018
+
1019
+ promise = promise.then do |result|
1020
+ http_response = result.response
1021
+ status_code = http_response.status
1022
+ response_content = http_response.body
1023
+ unless status_code == 200
1024
+ error_model = JSON.load(response_content)
1025
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1026
+ end
1027
+
1028
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1029
+ # Deserialize Response
1030
+ if status_code == 200
1031
+ begin
1032
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1033
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::ResourceListKeys.mapper()
1034
+ result.body = @client.deserialize(result_mapper, parsed_response)
1035
+ rescue Exception => e
1036
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1037
+ end
1038
+ end
1039
+
1040
+ result
1041
+ end
1042
+
1043
+ promise.execute
1044
+ end
1045
+
1046
+ #
1047
+ # Gets all the topics in a namespace.
1048
+ #
1049
+ # @param next_page_link [String] The NextLink from the previous successful call
1050
+ # to List operation.
1051
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1052
+ # will be added to the HTTP request.
1053
+ #
1054
+ # @return [TopicListResult] operation results.
1055
+ #
1056
+ def list_all_next(next_page_link, custom_headers = nil)
1057
+ response = list_all_next_async(next_page_link, custom_headers).value!
1058
+ response.body unless response.nil?
1059
+ end
1060
+
1061
+ #
1062
+ # Gets all the topics in a namespace.
1063
+ #
1064
+ # @param next_page_link [String] The NextLink from the previous successful call
1065
+ # to List operation.
1066
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1067
+ # will be added to the HTTP request.
1068
+ #
1069
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1070
+ #
1071
+ def list_all_next_with_http_info(next_page_link, custom_headers = nil)
1072
+ list_all_next_async(next_page_link, custom_headers).value!
1073
+ end
1074
+
1075
+ #
1076
+ # Gets all the topics in a namespace.
1077
+ #
1078
+ # @param next_page_link [String] The NextLink from the previous successful call
1079
+ # to List operation.
1080
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1081
+ # to the HTTP request.
1082
+ #
1083
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1084
+ #
1085
+ def list_all_next_async(next_page_link, custom_headers = nil)
1086
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1087
+
1088
+
1089
+ request_headers = {}
1090
+
1091
+ # Set Headers
1092
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1093
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1094
+ path_template = '{nextLink}'
1095
+
1096
+ request_url = @base_url || @client.base_url
1097
+
1098
+ options = {
1099
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1100
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1101
+ headers: request_headers.merge(custom_headers || {}),
1102
+ base_url: request_url
1103
+ }
1104
+ promise = @client.make_request_async(:get, path_template, options)
1105
+
1106
+ promise = promise.then do |result|
1107
+ http_response = result.response
1108
+ status_code = http_response.status
1109
+ response_content = http_response.body
1110
+ unless status_code == 200
1111
+ error_model = JSON.load(response_content)
1112
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1113
+ end
1114
+
1115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1116
+ # Deserialize Response
1117
+ if status_code == 200
1118
+ begin
1119
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1120
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::TopicListResult.mapper()
1121
+ result.body = @client.deserialize(result_mapper, parsed_response)
1122
+ rescue Exception => e
1123
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1124
+ end
1125
+ end
1126
+
1127
+ result
1128
+ end
1129
+
1130
+ promise.execute
1131
+ end
1132
+
1133
+ #
1134
+ # Gets authorization rules for a topic.
1135
+ #
1136
+ # @param next_page_link [String] The NextLink from the previous successful call
1137
+ # to List operation.
1138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1139
+ # will be added to the HTTP request.
1140
+ #
1141
+ # @return [SharedAccessAuthorizationRuleListResult] operation results.
1142
+ #
1143
+ def list_authorization_rules_next(next_page_link, custom_headers = nil)
1144
+ response = list_authorization_rules_next_async(next_page_link, custom_headers).value!
1145
+ response.body unless response.nil?
1146
+ end
1147
+
1148
+ #
1149
+ # Gets authorization rules for a topic.
1150
+ #
1151
+ # @param next_page_link [String] The NextLink from the previous successful call
1152
+ # to List operation.
1153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1154
+ # will be added to the HTTP request.
1155
+ #
1156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1157
+ #
1158
+ def list_authorization_rules_next_with_http_info(next_page_link, custom_headers = nil)
1159
+ list_authorization_rules_next_async(next_page_link, custom_headers).value!
1160
+ end
1161
+
1162
+ #
1163
+ # Gets authorization rules for a topic.
1164
+ #
1165
+ # @param next_page_link [String] The NextLink from the previous successful call
1166
+ # to List operation.
1167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1168
+ # to the HTTP request.
1169
+ #
1170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1171
+ #
1172
+ def list_authorization_rules_next_async(next_page_link, custom_headers = nil)
1173
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1174
+
1175
+
1176
+ request_headers = {}
1177
+
1178
+ # Set Headers
1179
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1180
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1181
+ path_template = '{nextLink}'
1182
+
1183
+ request_url = @base_url || @client.base_url
1184
+
1185
+ options = {
1186
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1187
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1188
+ headers: request_headers.merge(custom_headers || {}),
1189
+ base_url: request_url
1190
+ }
1191
+ promise = @client.make_request_async(:get, path_template, options)
1192
+
1193
+ promise = promise.then do |result|
1194
+ http_response = result.response
1195
+ status_code = http_response.status
1196
+ response_content = http_response.body
1197
+ unless status_code == 200
1198
+ error_model = JSON.load(response_content)
1199
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1200
+ end
1201
+
1202
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1203
+ # Deserialize Response
1204
+ if status_code == 200
1205
+ begin
1206
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1207
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleListResult.mapper()
1208
+ result.body = @client.deserialize(result_mapper, parsed_response)
1209
+ rescue Exception => e
1210
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1211
+ end
1212
+ end
1213
+
1214
+ result
1215
+ end
1216
+
1217
+ promise.execute
1218
+ end
1219
+
1220
+ #
1221
+ # Gets all the topics in a namespace.
1222
+ #
1223
+ # @param resource_group_name [String] Name of the Resource group within the
1224
+ # Azure subscription.
1225
+ # @param namespace_name [String] The namespace name
1226
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1227
+ # will be added to the HTTP request.
1228
+ #
1229
+ # @return [TopicListResult] which provide lazy access to pages of the response.
1230
+ #
1231
+ def list_all_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
1232
+ response = list_all_async(resource_group_name, namespace_name, custom_headers).value!
1233
+ unless response.nil?
1234
+ page = response.body
1235
+ page.next_method = Proc.new do |next_page_link|
1236
+ list_all_next_async(next_page_link, custom_headers)
1237
+ end
1238
+ page
1239
+ end
1240
+ end
1241
+
1242
+ #
1243
+ # Gets authorization rules for a topic.
1244
+ #
1245
+ # @param resource_group_name [String] Name of the Resource group within the
1246
+ # Azure subscription.
1247
+ # @param namespace_name [String] The namespace name
1248
+ # @param topic_name [String] The topic name.
1249
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1250
+ # will be added to the HTTP request.
1251
+ #
1252
+ # @return [SharedAccessAuthorizationRuleListResult] which provide lazy access
1253
+ # to pages of the response.
1254
+ #
1255
+ def list_authorization_rules_as_lazy(resource_group_name, namespace_name, topic_name, custom_headers = nil)
1256
+ response = list_authorization_rules_async(resource_group_name, namespace_name, topic_name, custom_headers).value!
1257
+ unless response.nil?
1258
+ page = response.body
1259
+ page.next_method = Proc.new do |next_page_link|
1260
+ list_authorization_rules_next_async(next_page_link, custom_headers)
1261
+ end
1262
+ page
1263
+ end
1264
+ end
1265
+
1266
+ end
1267
+ end