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,213 @@
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 Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations 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
+ # Lists all of the available ServiceBus REST API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def list(custom_headers = nil)
33
+ first_page = list_as_lazy(custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all of the available ServiceBus REST API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers = nil)
46
+ list_async(custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available ServiceBus REST API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers = nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+
63
+ # Set Headers
64
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
65
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
66
+ path_template = 'providers/Microsoft.ServiceBus/operations'
67
+
68
+ request_url = @base_url || @client.base_url
69
+
70
+ options = {
71
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
72
+ query_params: {'api-version' => @client.api_version},
73
+ headers: request_headers.merge(custom_headers || {}),
74
+ base_url: request_url
75
+ }
76
+ promise = @client.make_request_async(:get, path_template, options)
77
+
78
+ promise = promise.then do |result|
79
+ http_response = result.response
80
+ status_code = http_response.status
81
+ response_content = http_response.body
82
+ unless status_code == 200
83
+ error_model = JSON.load(response_content)
84
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
85
+ end
86
+
87
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
88
+ # Deserialize Response
89
+ if status_code == 200
90
+ begin
91
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
92
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::OperationListResult.mapper()
93
+ result.body = @client.deserialize(result_mapper, parsed_response)
94
+ rescue Exception => e
95
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
96
+ end
97
+ end
98
+
99
+ result
100
+ end
101
+
102
+ promise.execute
103
+ end
104
+
105
+ #
106
+ # Lists all of the available ServiceBus REST API operations.
107
+ #
108
+ # @param next_page_link [String] The NextLink from the previous successful call
109
+ # to List operation.
110
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
111
+ # will be added to the HTTP request.
112
+ #
113
+ # @return [OperationListResult] operation results.
114
+ #
115
+ def list_next(next_page_link, custom_headers = nil)
116
+ response = list_next_async(next_page_link, custom_headers).value!
117
+ response.body unless response.nil?
118
+ end
119
+
120
+ #
121
+ # Lists all of the available ServiceBus REST API operations.
122
+ #
123
+ # @param next_page_link [String] The NextLink from the previous successful call
124
+ # to List operation.
125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
+ # will be added to the HTTP request.
127
+ #
128
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
129
+ #
130
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
131
+ list_next_async(next_page_link, custom_headers).value!
132
+ end
133
+
134
+ #
135
+ # Lists all of the available ServiceBus REST API operations.
136
+ #
137
+ # @param next_page_link [String] The NextLink from the previous successful call
138
+ # to List operation.
139
+ # @param [Hash{String => String}] A hash of custom headers that will be added
140
+ # to the HTTP request.
141
+ #
142
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
143
+ #
144
+ def list_next_async(next_page_link, custom_headers = nil)
145
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
146
+
147
+
148
+ request_headers = {}
149
+
150
+ # Set Headers
151
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
152
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
153
+ path_template = '{nextLink}'
154
+
155
+ request_url = @base_url || @client.base_url
156
+
157
+ options = {
158
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
159
+ skip_encoding_path_params: {'nextLink' => next_page_link},
160
+ headers: request_headers.merge(custom_headers || {}),
161
+ base_url: request_url
162
+ }
163
+ promise = @client.make_request_async(:get, path_template, options)
164
+
165
+ promise = promise.then do |result|
166
+ http_response = result.response
167
+ status_code = http_response.status
168
+ response_content = http_response.body
169
+ unless status_code == 200
170
+ error_model = JSON.load(response_content)
171
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
172
+ end
173
+
174
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
175
+ # Deserialize Response
176
+ if status_code == 200
177
+ begin
178
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
179
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::OperationListResult.mapper()
180
+ result.body = @client.deserialize(result_mapper, parsed_response)
181
+ rescue Exception => e
182
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
183
+ end
184
+ end
185
+
186
+ result
187
+ end
188
+
189
+ promise.execute
190
+ end
191
+
192
+ #
193
+ # Lists all of the available ServiceBus REST API operations.
194
+ #
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [OperationListResult] which provide lazy access to pages of the
199
+ # response.
200
+ #
201
+ def list_as_lazy(custom_headers = nil)
202
+ response = list_async(custom_headers).value!
203
+ unless response.nil?
204
+ page = response.body
205
+ page.next_method = Proc.new do |next_page_link|
206
+ list_next_async(next_page_link, custom_headers)
207
+ end
208
+ page
209
+ end
210
+ end
211
+
212
+ end
213
+ end
@@ -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 Queues
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Queues 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 the queues within 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<QueueResource>] 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 the queues within 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 the queues within 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}/queues'
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::QueueListResult.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 or updates a Service Bus queue. This operation is idempotent.
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 queue_name [String] The queue name.
125
+ # @param parameters [QueueCreateOrUpdateParameters] Parameters supplied to
126
+ # create or update a queue 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 [QueueResource] operation results.
131
+ #
132
+ def create_or_update(resource_group_name, namespace_name, queue_name, parameters, custom_headers = nil)
133
+ response = create_or_update_async(resource_group_name, namespace_name, queue_name, parameters, custom_headers).value!
134
+ response.body unless response.nil?
135
+ end
136
+
137
+ #
138
+ # Creates or updates a Service Bus queue. This operation is idempotent.
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 queue_name [String] The queue name.
144
+ # @param parameters [QueueCreateOrUpdateParameters] Parameters supplied to
145
+ # create or update a queue 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, queue_name, parameters, custom_headers = nil)
152
+ create_or_update_async(resource_group_name, namespace_name, queue_name, parameters, custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Creates or updates a Service Bus queue. This operation is idempotent.
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 queue_name [String] The queue name.
162
+ # @param parameters [QueueCreateOrUpdateParameters] Parameters supplied to
163
+ # create or update a queue 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, queue_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, 'queue_name is nil' if queue_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::QueueCreateOrUpdateParameters.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}/queues/{queueName}'
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,'queueName' => queue_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::QueueResource.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 queue from the specified namespace in a 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 queue_name [String] The queue 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, queue_name, custom_headers = nil)
244
+ response = delete_async(resource_group_name, namespace_name, queue_name, custom_headers).value!
245
+ nil
246
+ end
247
+
248
+ #
249
+ # Deletes a queue from the specified namespace in a 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 queue_name [String] The queue 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, queue_name, custom_headers = nil)
261
+ delete_async(resource_group_name, namespace_name, queue_name, custom_headers).value!
262
+ end
263
+
264
+ #
265
+ # Deletes a queue from the specified namespace in a 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 queue_name [String] The queue 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, queue_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, 'queue_name is nil' if queue_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}/queues/{queueName}'
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,'queueName' => queue_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 queue.
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 queue_name [String] The queue 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 [QueueResource] operation results.
330
+ #
331
+ def get(resource_group_name, namespace_name, queue_name, custom_headers = nil)
332
+ response = get_async(resource_group_name, namespace_name, queue_name, custom_headers).value!
333
+ response.body unless response.nil?
334
+ end
335
+
336
+ #
337
+ # Returns a description for the specified queue.
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 queue_name [String] The queue 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, queue_name, custom_headers = nil)
349
+ get_async(resource_group_name, namespace_name, queue_name, custom_headers).value!
350
+ end
351
+
352
+ #
353
+ # Returns a description for the specified queue.
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 queue_name [String] The queue 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, queue_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, 'queue_name is nil' if queue_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}/queues/{queueName}'
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,'queueName' => queue_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::QueueResource.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 all authorization rules for a queue.
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 queue_name [String] The queue 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, queue_name, custom_headers = nil)
430
+ first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, queue_name, custom_headers)
431
+ first_page.get_all_items
432
+ end
433
+
434
+ #
435
+ # Gets all authorization rules for a queue.
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 queue_name [String] The queue 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, queue_name, custom_headers = nil)
447
+ list_authorization_rules_async(resource_group_name, namespace_name, queue_name, custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Gets all authorization rules for a queue.
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 queue_name [String] The queue 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, queue_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, 'queue_name is nil' if queue_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}/queues/{queueName}/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,'queueName' => queue_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 authorization rule for a queue.
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 queue_name [String] The queue 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, queue_name, authorization_rule_name, parameters, custom_headers = nil)
531
+ response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, parameters, custom_headers).value!
532
+ response.body unless response.nil?
533
+ end
534
+
535
+ #
536
+ # Creates an authorization rule for a queue.
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 queue_name [String] The queue 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, queue_name, authorization_rule_name, parameters, custom_headers = nil)
551
+ create_or_update_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, parameters, custom_headers).value!
552
+ end
553
+
554
+ #
555
+ # Creates an authorization rule for a queue.
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 queue_name [String] The queue 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, queue_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, 'queue_name is nil' if queue_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}/queues/{queueName}/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,'queueName' => queue_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
+ # Deletes a queue 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 queue_name [String] The queue 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
+ #
645
+ def delete_authorization_rule(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers = nil)
646
+ response = delete_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers).value!
647
+ nil
648
+ end
649
+
650
+ #
651
+ # Deletes a queue authorization rule.
652
+ #
653
+ # @param resource_group_name [String] Name of the Resource group within the
654
+ # Azure subscription.
655
+ # @param namespace_name [String] The namespace name
656
+ # @param queue_name [String] The queue name.
657
+ # @param authorization_rule_name [String] The authorizationrule name.
658
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
659
+ # will be added to the HTTP request.
660
+ #
661
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
662
+ #
663
+ def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers = nil)
664
+ delete_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers).value!
665
+ end
666
+
667
+ #
668
+ # Deletes a queue authorization rule.
669
+ #
670
+ # @param resource_group_name [String] Name of the Resource group within the
671
+ # Azure subscription.
672
+ # @param namespace_name [String] The namespace name
673
+ # @param queue_name [String] The queue name.
674
+ # @param authorization_rule_name [String] The authorizationrule name.
675
+ # @param [Hash{String => String}] A hash of custom headers that will be added
676
+ # to the HTTP request.
677
+ #
678
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
679
+ #
680
+ def delete_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers = nil)
681
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
682
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
683
+ fail ArgumentError, 'queue_name is nil' if queue_name.nil?
684
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
685
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
686
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
687
+
688
+
689
+ request_headers = {}
690
+
691
+ # Set Headers
692
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
693
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
694
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'
695
+
696
+ request_url = @base_url || @client.base_url
697
+
698
+ options = {
699
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
700
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'queueName' => queue_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
701
+ query_params: {'api-version' => @client.api_version},
702
+ headers: request_headers.merge(custom_headers || {}),
703
+ base_url: request_url
704
+ }
705
+ promise = @client.make_request_async(:delete, path_template, options)
706
+
707
+ promise = promise.then do |result|
708
+ http_response = result.response
709
+ status_code = http_response.status
710
+ response_content = http_response.body
711
+ unless status_code == 204 || status_code == 200
712
+ error_model = JSON.load(response_content)
713
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
714
+ end
715
+
716
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
717
+
718
+ result
719
+ end
720
+
721
+ promise.execute
722
+ end
723
+
724
+ #
725
+ # Gets an authorization rule for a queue by rule name.
726
+ #
727
+ # @param resource_group_name [String] Name of the Resource group within the
728
+ # Azure subscription.
729
+ # @param namespace_name [String] The namespace name
730
+ # @param queue_name [String] The queue name.
731
+ # @param authorization_rule_name [String] The authorizationrule name.
732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
733
+ # will be added to the HTTP request.
734
+ #
735
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
736
+ #
737
+ def get_authorization_rule(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers = nil)
738
+ response = get_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers).value!
739
+ response.body unless response.nil?
740
+ end
741
+
742
+ #
743
+ # Gets an authorization rule for a queue by rule name.
744
+ #
745
+ # @param resource_group_name [String] Name of the Resource group within the
746
+ # Azure subscription.
747
+ # @param namespace_name [String] The namespace name
748
+ # @param queue_name [String] The queue name.
749
+ # @param authorization_rule_name [String] The authorizationrule name.
750
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
751
+ # will be added to the HTTP request.
752
+ #
753
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
754
+ #
755
+ def get_authorization_rule_with_http_info(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers = nil)
756
+ get_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers).value!
757
+ end
758
+
759
+ #
760
+ # Gets an authorization rule for a queue by rule name.
761
+ #
762
+ # @param resource_group_name [String] Name of the Resource group within the
763
+ # Azure subscription.
764
+ # @param namespace_name [String] The namespace name
765
+ # @param queue_name [String] The queue name.
766
+ # @param authorization_rule_name [String] The authorizationrule name.
767
+ # @param [Hash{String => String}] A hash of custom headers that will be added
768
+ # to the HTTP request.
769
+ #
770
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
771
+ #
772
+ def get_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers = nil)
773
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
774
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
775
+ fail ArgumentError, 'queue_name is nil' if queue_name.nil?
776
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
777
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
778
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
779
+
780
+
781
+ request_headers = {}
782
+
783
+ # Set Headers
784
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
785
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
786
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'
787
+
788
+ request_url = @base_url || @client.base_url
789
+
790
+ options = {
791
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
792
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'queueName' => queue_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
793
+ query_params: {'api-version' => @client.api_version},
794
+ headers: request_headers.merge(custom_headers || {}),
795
+ base_url: request_url
796
+ }
797
+ promise = @client.make_request_async(:get, path_template, options)
798
+
799
+ promise = promise.then do |result|
800
+ http_response = result.response
801
+ status_code = http_response.status
802
+ response_content = http_response.body
803
+ unless status_code == 200
804
+ error_model = JSON.load(response_content)
805
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
806
+ end
807
+
808
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
809
+ # Deserialize Response
810
+ if status_code == 200
811
+ begin
812
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
813
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleResource.mapper()
814
+ result.body = @client.deserialize(result_mapper, parsed_response)
815
+ rescue Exception => e
816
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
817
+ end
818
+ end
819
+
820
+ result
821
+ end
822
+
823
+ promise.execute
824
+ end
825
+
826
+ #
827
+ # Primary and secondary connection strings to the queue.
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 queue_name [String] The queue 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, queue_name, authorization_rule_name, custom_headers = nil)
840
+ response = list_keys_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers).value!
841
+ response.body unless response.nil?
842
+ end
843
+
844
+ #
845
+ # Primary and secondary connection strings to the queue.
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 queue_name [String] The queue 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, queue_name, authorization_rule_name, custom_headers = nil)
858
+ list_keys_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers).value!
859
+ end
860
+
861
+ #
862
+ # Primary and secondary connection strings to the queue.
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 queue_name [String] The queue 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, queue_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, 'queue_name is nil' if queue_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}/queues/{queueName}/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,'queueName' => queue_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 the primary or secondary connection strings to the queue.
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 queue_name [String] The queue 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, queue_name, authorization_rule_name, parameters, custom_headers = nil)
944
+ response = regenerate_keys_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, parameters, custom_headers).value!
945
+ response.body unless response.nil?
946
+ end
947
+
948
+ #
949
+ # Regenerates the primary or secondary connection strings to the queue.
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 queue_name [String] The queue 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, queue_name, authorization_rule_name, parameters, custom_headers = nil)
964
+ regenerate_keys_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, parameters, custom_headers).value!
965
+ end
966
+
967
+ #
968
+ # Regenerates the primary or secondary connection strings to the queue.
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 queue_name [String] The queue 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, queue_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, 'queue_name is nil' if queue_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}/queues/{queueName}/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,'queueName' => queue_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 the queues within 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 [QueueListResult] 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 the queues within 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 the queues within 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::QueueListResult.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 all authorization rules for a queue.
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 all authorization rules for a queue.
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 all authorization rules for a queue.
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 the queues within 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 [QueueListResult] 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 all authorization rules for a queue.
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 queue_name [String] The queue 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, queue_name, custom_headers = nil)
1256
+ response = list_authorization_rules_async(resource_group_name, namespace_name, queue_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