azure_mgmt_service_bus 0.16.0 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/check_name_availability.rb +1 -1
  3. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/namespace_list_result.rb +1 -1
  4. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/operation_list_result.rb +1 -1
  5. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/queue_list_result.rb +1 -1
  6. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/resource.rb +9 -0
  7. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/shared_access_authorization_rule_list_result.rb +1 -1
  8. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_list_result.rb +1 -1
  9. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_create_or_update_parameters.rb +0 -12
  10. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_list_result.rb +1 -1
  11. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_resource.rb +0 -12
  12. data/lib/2015-08-01/generated/azure_mgmt_service_bus/namespaces.rb +15 -15
  13. data/lib/2015-08-01/generated/azure_mgmt_service_bus/queues.rb +126 -15
  14. data/lib/2015-08-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb +7 -6
  15. data/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb +129 -18
  16. data/lib/2017-04-01/generated/azure_mgmt_service_bus.rb +31 -20
  17. data/lib/2017-04-01/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb +9 -9
  18. data/lib/2017-04-01/generated/azure_mgmt_service_bus/migration_configs.rb +777 -0
  19. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/arm_disaster_recovery.rb +14 -2
  20. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb +1 -1
  21. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/check_name_availability.rb +1 -1
  22. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/correlation_filter.rb +19 -0
  23. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/default_action.rb +16 -0
  24. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/error_response.rb +1 -1
  25. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/event_hub_list_result.rb +1 -1
  26. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/migration_config_list_result.rb +100 -0
  27. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/migration_config_properties.rb +123 -0
  28. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/name_space_type.rb +19 -0
  29. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/network_rule_ipaction.rb +15 -0
  30. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/network_rule_set.rb +114 -0
  31. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/nwrule_set_ip_rules.rb +59 -0
  32. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/nwrule_set_virtual_network_rules.rb +59 -0
  33. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/operation_list_result.rb +1 -1
  34. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb +1 -1
  35. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb +1 -1
  36. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/resource.rb +9 -0
  37. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/rule_list_result.rb +1 -1
  38. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb +1 -1
  39. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace.rb +1 -1
  40. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb +1 -1
  41. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace_migrate.rb +48 -0
  42. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace_update_parameters.rb +1 -1
  43. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbqueue.rb +12 -0
  44. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbqueue_list_result.rb +1 -1
  45. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbsubscription_list_result.rb +1 -1
  46. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbtopic.rb +1 -1
  47. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbtopic_list_result.rb +1 -1
  48. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/subnet.rb +46 -0
  49. data/lib/2017-04-01/generated/azure_mgmt_service_bus/namespaces.rb +326 -15
  50. data/lib/2017-04-01/generated/azure_mgmt_service_bus/queues.rb +51 -23
  51. data/lib/2017-04-01/generated/azure_mgmt_service_bus/rules.rb +36 -8
  52. data/lib/2017-04-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb +11 -6
  53. data/lib/2017-04-01/generated/azure_mgmt_service_bus/subscriptions.rb +36 -8
  54. data/lib/2017-04-01/generated/azure_mgmt_service_bus/topics.rb +54 -26
  55. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus.rb +53 -0
  56. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/default_action.rb +16 -0
  57. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/error_response.rb +58 -0
  58. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/ip_filter_rule.rb +96 -0
  59. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/ip_filter_rule_list_result.rb +100 -0
  60. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/ipaction.rb +16 -0
  61. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/network_rule_ipaction.rb +15 -0
  62. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/network_rule_set.rb +114 -0
  63. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/nwrule_set_ip_rules.rb +58 -0
  64. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/nwrule_set_virtual_network_rules.rb +59 -0
  65. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/operation.rb +59 -0
  66. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/operation_display.rb +72 -0
  67. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/operation_list_result.rb +103 -0
  68. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/resource.rb +80 -0
  69. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/resource_namespace_patch.rb +92 -0
  70. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/sbnamespace.rb +171 -0
  71. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb +99 -0
  72. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/sbnamespace_update_parameters.rb +171 -0
  73. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/sbsku.rb +73 -0
  74. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/sku_name.rb +17 -0
  75. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/sku_tier.rb +17 -0
  76. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/subnet.rb +46 -0
  77. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/tracked_resource.rb +92 -0
  78. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/virtual_network_rule.rb +73 -0
  79. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/models/virtual_network_rule_list_result.rb +100 -0
  80. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/module_definition.rb +9 -0
  81. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/namespaces.rb +2211 -0
  82. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/operations.rb +216 -0
  83. data/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/service_bus_management_client.rb +137 -0
  84. data/lib/azure_mgmt_service_bus.rb +2 -1
  85. data/lib/profiles/latest/modules/servicebus_profile_module.rb +107 -65
  86. data/lib/version.rb +1 -1
  87. metadata +45 -5
@@ -0,0 +1,100 @@
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::V2018_01_01_preview
7
+ module Models
8
+ #
9
+ # The response from the List namespace operation.
10
+ #
11
+ class VirtualNetworkRuleListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<VirtualNetworkRule>] Result of the List VirtualNetwork
17
+ # Rules operation.
18
+ attr_accessor :value
19
+
20
+ # @return [String] Link to the next set of results. Not empty if Value
21
+ # contains an incomplete list of VirtualNetwork Rules
22
+ attr_accessor :next_link
23
+
24
+ # return [Proc] with next page method call.
25
+ attr_accessor :next_method
26
+
27
+ #
28
+ # Gets the rest of the items for the request, enabling auto-pagination.
29
+ #
30
+ # @return [Array<VirtualNetworkRule>] operation results.
31
+ #
32
+ def get_all_items
33
+ items = @value
34
+ page = self
35
+ while page.next_link != nil && !page.next_link.strip.empty? do
36
+ page = page.get_next_page
37
+ items.concat(page.value)
38
+ end
39
+ items
40
+ end
41
+
42
+ #
43
+ # Gets the next page of results.
44
+ #
45
+ # @return [VirtualNetworkRuleListResult] with next page content.
46
+ #
47
+ def get_next_page
48
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
49
+ unless response.nil?
50
+ @next_link = response.body.next_link
51
+ @value = response.body.value
52
+ self
53
+ end
54
+ end
55
+
56
+ #
57
+ # Mapper for VirtualNetworkRuleListResult class as Ruby Hash.
58
+ # This will be used for serialization/deserialization.
59
+ #
60
+ def self.mapper()
61
+ {
62
+ client_side_validation: true,
63
+ required: false,
64
+ serialized_name: 'VirtualNetworkRuleListResult',
65
+ type: {
66
+ name: 'Composite',
67
+ class_name: 'VirtualNetworkRuleListResult',
68
+ model_properties: {
69
+ value: {
70
+ client_side_validation: true,
71
+ required: false,
72
+ serialized_name: 'value',
73
+ type: {
74
+ name: 'Sequence',
75
+ element: {
76
+ client_side_validation: true,
77
+ required: false,
78
+ serialized_name: 'VirtualNetworkRuleElementType',
79
+ type: {
80
+ name: 'Composite',
81
+ class_name: 'VirtualNetworkRule'
82
+ }
83
+ }
84
+ }
85
+ },
86
+ next_link: {
87
+ client_side_validation: true,
88
+ required: false,
89
+ serialized_name: 'nextLink',
90
+ type: {
91
+ name: 'String'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::ServiceBus end
8
+ module Azure::ServiceBus::Mgmt end
9
+ module Azure::ServiceBus::Mgmt::V2018_01_01_preview end
@@ -0,0 +1,2211 @@
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::V2018_01_01_preview
7
+ #
8
+ # Azure Service Bus client for managing Namespace, IPFilter Rules,
9
+ # VirtualNetworkRules and Zone Redundant
10
+ #
11
+ class Namespaces
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Namespaces class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets all the available namespaces within the subscription, irrespective of
27
+ # the resource groups.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<SBNamespace>] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ first_page = list_as_lazy(custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Gets all the available namespaces within the subscription, irrespective of
41
+ # the resource groups.
42
+ #
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def list_with_http_info(custom_headers:nil)
49
+ list_async(custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # Gets all the available namespaces within the subscription, irrespective of
54
+ # the resource groups.
55
+ #
56
+ # @param [Hash{String => String}] A hash of custom headers that will be added
57
+ # to the HTTP request.
58
+ #
59
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
60
+ #
61
+ def list_async(custom_headers:nil)
62
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
64
+
65
+
66
+ request_headers = {}
67
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
68
+
69
+ # Set Headers
70
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
71
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
72
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces'
73
+
74
+ request_url = @base_url || @client.base_url
75
+
76
+ options = {
77
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
+ path_params: {'subscriptionId' => @client.subscription_id},
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ # Deserialize Response
96
+ if status_code == 200
97
+ begin
98
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespaceListResult.mapper()
100
+ result.body = @client.deserialize(result_mapper, parsed_response)
101
+ rescue Exception => e
102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
103
+ end
104
+ end
105
+
106
+ result
107
+ end
108
+
109
+ promise.execute
110
+ end
111
+
112
+ #
113
+ # Gets the available namespaces within a resource group.
114
+ #
115
+ # @param resource_group_name [String] Name of the Resource group within the
116
+ # Azure subscription.
117
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
118
+ # will be added to the HTTP request.
119
+ #
120
+ # @return [Array<SBNamespace>] operation results.
121
+ #
122
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
123
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
124
+ first_page.get_all_items
125
+ end
126
+
127
+ #
128
+ # Gets the available namespaces within a resource group.
129
+ #
130
+ # @param resource_group_name [String] Name of the Resource group within the
131
+ # Azure subscription.
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
136
+ #
137
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
138
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
139
+ end
140
+
141
+ #
142
+ # Gets the available namespaces within a resource group.
143
+ #
144
+ # @param resource_group_name [String] Name of the Resource group within the
145
+ # Azure subscription.
146
+ # @param [Hash{String => String}] A hash of custom headers that will be added
147
+ # to the HTTP request.
148
+ #
149
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
150
+ #
151
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
152
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
153
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
154
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
155
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
156
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
157
+
158
+
159
+ request_headers = {}
160
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
161
+
162
+ # Set Headers
163
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
164
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
165
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces'
166
+
167
+ request_url = @base_url || @client.base_url
168
+
169
+ options = {
170
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
171
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
172
+ query_params: {'api-version' => @client.api_version},
173
+ headers: request_headers.merge(custom_headers || {}),
174
+ base_url: request_url
175
+ }
176
+ promise = @client.make_request_async(:get, path_template, options)
177
+
178
+ promise = promise.then do |result|
179
+ http_response = result.response
180
+ status_code = http_response.status
181
+ response_content = http_response.body
182
+ unless status_code == 200
183
+ error_model = JSON.load(response_content)
184
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
185
+ end
186
+
187
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
188
+ # Deserialize Response
189
+ if status_code == 200
190
+ begin
191
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
192
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespaceListResult.mapper()
193
+ result.body = @client.deserialize(result_mapper, parsed_response)
194
+ rescue Exception => e
195
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
196
+ end
197
+ end
198
+
199
+ result
200
+ end
201
+
202
+ promise.execute
203
+ end
204
+
205
+ #
206
+ # Creates or updates a service namespace. Once created, this namespace's
207
+ # resource manifest is immutable. This operation is idempotent.
208
+ #
209
+ # @param resource_group_name [String] Name of the Resource group within the
210
+ # Azure subscription.
211
+ # @param namespace_name [String] The namespace name.
212
+ # @param parameters [SBNamespace] Parameters supplied to create a namespace
213
+ # resource.
214
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
215
+ # will be added to the HTTP request.
216
+ #
217
+ # @return [SBNamespace] operation results.
218
+ #
219
+ def create_or_update(resource_group_name, namespace_name, parameters, custom_headers:nil)
220
+ response = create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
221
+ response.body unless response.nil?
222
+ end
223
+
224
+ #
225
+ # @param resource_group_name [String] Name of the Resource group within the
226
+ # Azure subscription.
227
+ # @param namespace_name [String] The namespace name.
228
+ # @param parameters [SBNamespace] Parameters supplied to create a namespace
229
+ # resource.
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [Concurrent::Promise] promise which provides async access to http
234
+ # response.
235
+ #
236
+ def create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
237
+ # Send request
238
+ promise = begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers)
239
+
240
+ promise = promise.then do |response|
241
+ # Defining deserialization method.
242
+ deserialize_method = lambda do |parsed_response|
243
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
244
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
245
+ end
246
+
247
+ # Waiting for response.
248
+ @client.get_long_running_operation_result(response, deserialize_method)
249
+ end
250
+
251
+ promise
252
+ end
253
+
254
+ #
255
+ # Deletes an existing namespace. This operation also removes all associated
256
+ # resources under the namespace.
257
+ #
258
+ # @param resource_group_name [String] Name of the Resource group within the
259
+ # Azure subscription.
260
+ # @param namespace_name [String] The namespace name
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ def delete(resource_group_name, namespace_name, custom_headers:nil)
265
+ response = delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
266
+ nil
267
+ end
268
+
269
+ #
270
+ # @param resource_group_name [String] Name of the Resource group within the
271
+ # Azure subscription.
272
+ # @param namespace_name [String] The namespace name
273
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
274
+ # will be added to the HTTP request.
275
+ #
276
+ # @return [Concurrent::Promise] promise which provides async access to http
277
+ # response.
278
+ #
279
+ def delete_async(resource_group_name, namespace_name, custom_headers:nil)
280
+ # Send request
281
+ promise = begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers)
282
+
283
+ promise = promise.then do |response|
284
+ # Defining deserialization method.
285
+ deserialize_method = lambda do |parsed_response|
286
+ end
287
+
288
+ # Waiting for response.
289
+ @client.get_long_running_operation_result(response, deserialize_method)
290
+ end
291
+
292
+ promise
293
+ end
294
+
295
+ #
296
+ # Gets a description for the specified namespace.
297
+ #
298
+ # @param resource_group_name [String] Name of the Resource group within the
299
+ # Azure subscription.
300
+ # @param namespace_name [String] The namespace name
301
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
302
+ # will be added to the HTTP request.
303
+ #
304
+ # @return [SBNamespace] operation results.
305
+ #
306
+ def get(resource_group_name, namespace_name, custom_headers:nil)
307
+ response = get_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
308
+ response.body unless response.nil?
309
+ end
310
+
311
+ #
312
+ # Gets a description for the specified namespace.
313
+ #
314
+ # @param resource_group_name [String] Name of the Resource group within the
315
+ # Azure subscription.
316
+ # @param namespace_name [String] The namespace name
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
321
+ #
322
+ def get_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
323
+ get_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
324
+ end
325
+
326
+ #
327
+ # Gets a description for the specified namespace.
328
+ #
329
+ # @param resource_group_name [String] Name of the Resource group within the
330
+ # Azure subscription.
331
+ # @param namespace_name [String] The namespace name
332
+ # @param [Hash{String => String}] A hash of custom headers that will be added
333
+ # to the HTTP request.
334
+ #
335
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
336
+ #
337
+ def get_async(resource_group_name, namespace_name, custom_headers:nil)
338
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
339
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
340
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
341
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
342
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
343
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
344
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
345
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
346
+
347
+
348
+ request_headers = {}
349
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
350
+
351
+ # Set Headers
352
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
353
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
354
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
355
+
356
+ request_url = @base_url || @client.base_url
357
+
358
+ options = {
359
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
360
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
361
+ query_params: {'api-version' => @client.api_version},
362
+ headers: request_headers.merge(custom_headers || {}),
363
+ base_url: request_url
364
+ }
365
+ promise = @client.make_request_async(:get, path_template, options)
366
+
367
+ promise = promise.then do |result|
368
+ http_response = result.response
369
+ status_code = http_response.status
370
+ response_content = http_response.body
371
+ unless status_code == 200
372
+ error_model = JSON.load(response_content)
373
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
374
+ end
375
+
376
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
377
+ # Deserialize Response
378
+ if status_code == 200
379
+ begin
380
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
381
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
382
+ result.body = @client.deserialize(result_mapper, parsed_response)
383
+ rescue Exception => e
384
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
385
+ end
386
+ end
387
+
388
+ result
389
+ end
390
+
391
+ promise.execute
392
+ end
393
+
394
+ #
395
+ # Updates a service namespace. Once created, this namespace's resource manifest
396
+ # is immutable. This operation is idempotent.
397
+ #
398
+ # @param resource_group_name [String] Name of the Resource group within the
399
+ # Azure subscription.
400
+ # @param namespace_name [String] The namespace name
401
+ # @param parameters [SBNamespaceUpdateParameters] Parameters supplied to update
402
+ # a namespace resource.
403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
404
+ # will be added to the HTTP request.
405
+ #
406
+ # @return [SBNamespace] operation results.
407
+ #
408
+ def update(resource_group_name, namespace_name, parameters, custom_headers:nil)
409
+ response = update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
410
+ response.body unless response.nil?
411
+ end
412
+
413
+ #
414
+ # Updates a service namespace. Once created, this namespace's resource manifest
415
+ # is immutable. This operation is idempotent.
416
+ #
417
+ # @param resource_group_name [String] Name of the Resource group within the
418
+ # Azure subscription.
419
+ # @param namespace_name [String] The namespace name
420
+ # @param parameters [SBNamespaceUpdateParameters] Parameters supplied to update
421
+ # a namespace resource.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
+ #
427
+ def update_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
428
+ update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
429
+ end
430
+
431
+ #
432
+ # Updates a service namespace. Once created, this namespace's resource manifest
433
+ # is immutable. This operation is idempotent.
434
+ #
435
+ # @param resource_group_name [String] Name of the Resource group within the
436
+ # Azure subscription.
437
+ # @param namespace_name [String] The namespace name
438
+ # @param parameters [SBNamespaceUpdateParameters] Parameters supplied to update
439
+ # a namespace resource.
440
+ # @param [Hash{String => String}] A hash of custom headers that will be added
441
+ # to the HTTP request.
442
+ #
443
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
444
+ #
445
+ def update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
446
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
447
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
448
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
449
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
450
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
451
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
452
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
453
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
454
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
455
+
456
+
457
+ request_headers = {}
458
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
459
+
460
+ # Set Headers
461
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
462
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
463
+
464
+ # Serialize Request
465
+ request_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespaceUpdateParameters.mapper()
466
+ request_content = @client.serialize(request_mapper, parameters)
467
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
468
+
469
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
470
+
471
+ request_url = @base_url || @client.base_url
472
+
473
+ options = {
474
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
475
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
476
+ query_params: {'api-version' => @client.api_version},
477
+ body: request_content,
478
+ headers: request_headers.merge(custom_headers || {}),
479
+ base_url: request_url
480
+ }
481
+ promise = @client.make_request_async(:patch, path_template, options)
482
+
483
+ promise = promise.then do |result|
484
+ http_response = result.response
485
+ status_code = http_response.status
486
+ response_content = http_response.body
487
+ unless status_code == 201 || status_code == 200 || status_code == 202
488
+ error_model = JSON.load(response_content)
489
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
490
+ end
491
+
492
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
493
+ # Deserialize Response
494
+ if status_code == 201
495
+ begin
496
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
497
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
498
+ result.body = @client.deserialize(result_mapper, parsed_response)
499
+ rescue Exception => e
500
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
501
+ end
502
+ end
503
+ # Deserialize Response
504
+ if status_code == 200
505
+ begin
506
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
507
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
508
+ result.body = @client.deserialize(result_mapper, parsed_response)
509
+ rescue Exception => e
510
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
511
+ end
512
+ end
513
+
514
+ result
515
+ end
516
+
517
+ promise.execute
518
+ end
519
+
520
+ #
521
+ # Gets a list of IP Filter rules for a Namespace.
522
+ #
523
+ # @param resource_group_name [String] Name of the Resource group within the
524
+ # Azure subscription.
525
+ # @param namespace_name [String] The namespace name
526
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
527
+ # will be added to the HTTP request.
528
+ #
529
+ # @return [Array<IpFilterRule>] operation results.
530
+ #
531
+ def list_ip_filter_rules(resource_group_name, namespace_name, custom_headers:nil)
532
+ first_page = list_ip_filter_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
533
+ first_page.get_all_items
534
+ end
535
+
536
+ #
537
+ # Gets a list of IP Filter rules for a Namespace.
538
+ #
539
+ # @param resource_group_name [String] Name of the Resource group within the
540
+ # Azure subscription.
541
+ # @param namespace_name [String] The namespace name
542
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
543
+ # will be added to the HTTP request.
544
+ #
545
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
546
+ #
547
+ def list_ip_filter_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
548
+ list_ip_filter_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
549
+ end
550
+
551
+ #
552
+ # Gets a list of IP Filter rules for a Namespace.
553
+ #
554
+ # @param resource_group_name [String] Name of the Resource group within the
555
+ # Azure subscription.
556
+ # @param namespace_name [String] The namespace name
557
+ # @param [Hash{String => String}] A hash of custom headers that will be added
558
+ # to the HTTP request.
559
+ #
560
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
561
+ #
562
+ def list_ip_filter_rules_async(resource_group_name, namespace_name, custom_headers:nil)
563
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
564
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
565
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
566
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
567
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
568
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
569
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
570
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
571
+
572
+
573
+ request_headers = {}
574
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
575
+
576
+ # Set Headers
577
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
578
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
579
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules'
580
+
581
+ request_url = @base_url || @client.base_url
582
+
583
+ options = {
584
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
585
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
586
+ query_params: {'api-version' => @client.api_version},
587
+ headers: request_headers.merge(custom_headers || {}),
588
+ base_url: request_url
589
+ }
590
+ promise = @client.make_request_async(:get, path_template, options)
591
+
592
+ promise = promise.then do |result|
593
+ http_response = result.response
594
+ status_code = http_response.status
595
+ response_content = http_response.body
596
+ unless status_code == 200
597
+ error_model = JSON.load(response_content)
598
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
599
+ end
600
+
601
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
602
+ # Deserialize Response
603
+ if status_code == 200
604
+ begin
605
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
606
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::IpFilterRuleListResult.mapper()
607
+ result.body = @client.deserialize(result_mapper, parsed_response)
608
+ rescue Exception => e
609
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
610
+ end
611
+ end
612
+
613
+ result
614
+ end
615
+
616
+ promise.execute
617
+ end
618
+
619
+ #
620
+ # Creates or updates an IpFilterRule for a Namespace.
621
+ #
622
+ # @param resource_group_name [String] Name of the Resource group within the
623
+ # Azure subscription.
624
+ # @param namespace_name [String] The namespace name
625
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
626
+ # @param parameters [IpFilterRule] The Namespace IpFilterRule.
627
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
628
+ # will be added to the HTTP request.
629
+ #
630
+ # @return [IpFilterRule] operation results.
631
+ #
632
+ def create_or_update_ip_filter_rule(resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers:nil)
633
+ response = create_or_update_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers:custom_headers).value!
634
+ response.body unless response.nil?
635
+ end
636
+
637
+ #
638
+ # Creates or updates an IpFilterRule for a Namespace.
639
+ #
640
+ # @param resource_group_name [String] Name of the Resource group within the
641
+ # Azure subscription.
642
+ # @param namespace_name [String] The namespace name
643
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
644
+ # @param parameters [IpFilterRule] The Namespace IpFilterRule.
645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
646
+ # will be added to the HTTP request.
647
+ #
648
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
649
+ #
650
+ def create_or_update_ip_filter_rule_with_http_info(resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers:nil)
651
+ create_or_update_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers:custom_headers).value!
652
+ end
653
+
654
+ #
655
+ # Creates or updates an IpFilterRule for a Namespace.
656
+ #
657
+ # @param resource_group_name [String] Name of the Resource group within the
658
+ # Azure subscription.
659
+ # @param namespace_name [String] The namespace name
660
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
661
+ # @param parameters [IpFilterRule] The Namespace IpFilterRule.
662
+ # @param [Hash{String => String}] A hash of custom headers that will be added
663
+ # to the HTTP request.
664
+ #
665
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
666
+ #
667
+ def create_or_update_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, parameters, custom_headers:nil)
668
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
669
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
670
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
671
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
672
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
673
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
674
+ fail ArgumentError, 'ip_filter_rule_name is nil' if ip_filter_rule_name.nil?
675
+ fail ArgumentError, "'ip_filter_rule_name' should satisfy the constraint - 'MinLength': '1'" if !ip_filter_rule_name.nil? && ip_filter_rule_name.length < 1
676
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
677
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
678
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
679
+
680
+
681
+ request_headers = {}
682
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
683
+
684
+ # Set Headers
685
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
686
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
687
+
688
+ # Serialize Request
689
+ request_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::IpFilterRule.mapper()
690
+ request_content = @client.serialize(request_mapper, parameters)
691
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
692
+
693
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'
694
+
695
+ request_url = @base_url || @client.base_url
696
+
697
+ options = {
698
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
699
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'ipFilterRuleName' => ip_filter_rule_name,'subscriptionId' => @client.subscription_id},
700
+ query_params: {'api-version' => @client.api_version},
701
+ body: request_content,
702
+ headers: request_headers.merge(custom_headers || {}),
703
+ base_url: request_url
704
+ }
705
+ promise = @client.make_request_async(:put, 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 == 200
712
+ error_model = JSON.load(response_content)
713
+ fail MsRest::HttpOperationError.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
+ # Deserialize Response
718
+ if status_code == 200
719
+ begin
720
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
721
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::IpFilterRule.mapper()
722
+ result.body = @client.deserialize(result_mapper, parsed_response)
723
+ rescue Exception => e
724
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
725
+ end
726
+ end
727
+
728
+ result
729
+ end
730
+
731
+ promise.execute
732
+ end
733
+
734
+ #
735
+ # Deletes an IpFilterRule for a Namespace.
736
+ #
737
+ # @param resource_group_name [String] Name of the Resource group within the
738
+ # Azure subscription.
739
+ # @param namespace_name [String] The namespace name
740
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
741
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
742
+ # will be added to the HTTP request.
743
+ #
744
+ #
745
+ def delete_ip_filter_rule(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
746
+ response = delete_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:custom_headers).value!
747
+ nil
748
+ end
749
+
750
+ #
751
+ # Deletes an IpFilterRule for a Namespace.
752
+ #
753
+ # @param resource_group_name [String] Name of the Resource group within the
754
+ # Azure subscription.
755
+ # @param namespace_name [String] The namespace name
756
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
757
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
758
+ # will be added to the HTTP request.
759
+ #
760
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
761
+ #
762
+ def delete_ip_filter_rule_with_http_info(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
763
+ delete_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:custom_headers).value!
764
+ end
765
+
766
+ #
767
+ # Deletes an IpFilterRule for a Namespace.
768
+ #
769
+ # @param resource_group_name [String] Name of the Resource group within the
770
+ # Azure subscription.
771
+ # @param namespace_name [String] The namespace name
772
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
773
+ # @param [Hash{String => String}] A hash of custom headers that will be added
774
+ # to the HTTP request.
775
+ #
776
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
777
+ #
778
+ def delete_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
779
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
780
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
781
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
782
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
783
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
784
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
785
+ fail ArgumentError, 'ip_filter_rule_name is nil' if ip_filter_rule_name.nil?
786
+ fail ArgumentError, "'ip_filter_rule_name' should satisfy the constraint - 'MinLength': '1'" if !ip_filter_rule_name.nil? && ip_filter_rule_name.length < 1
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
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
793
+
794
+ # Set Headers
795
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
796
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
797
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'
798
+
799
+ request_url = @base_url || @client.base_url
800
+
801
+ options = {
802
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
803
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'ipFilterRuleName' => ip_filter_rule_name,'subscriptionId' => @client.subscription_id},
804
+ query_params: {'api-version' => @client.api_version},
805
+ headers: request_headers.merge(custom_headers || {}),
806
+ base_url: request_url
807
+ }
808
+ promise = @client.make_request_async(:delete, path_template, options)
809
+
810
+ promise = promise.then do |result|
811
+ http_response = result.response
812
+ status_code = http_response.status
813
+ response_content = http_response.body
814
+ unless status_code == 204 || status_code == 200
815
+ error_model = JSON.load(response_content)
816
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
817
+ end
818
+
819
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
820
+
821
+ result
822
+ end
823
+
824
+ promise.execute
825
+ end
826
+
827
+ #
828
+ # Gets an IpFilterRule for a Namespace by rule name.
829
+ #
830
+ # @param resource_group_name [String] Name of the Resource group within the
831
+ # Azure subscription.
832
+ # @param namespace_name [String] The namespace name
833
+ # @param ip_filter_rule_name [String] The IP Filter Rule 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 [IpFilterRule] operation results.
838
+ #
839
+ def get_ip_filter_rule(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
840
+ response = get_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:custom_headers).value!
841
+ response.body unless response.nil?
842
+ end
843
+
844
+ #
845
+ # Gets an IpFilterRule for a Namespace by rule name.
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 ip_filter_rule_name [String] The IP Filter Rule name.
851
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
852
+ # will be added to the HTTP request.
853
+ #
854
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
855
+ #
856
+ def get_ip_filter_rule_with_http_info(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
857
+ get_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:custom_headers).value!
858
+ end
859
+
860
+ #
861
+ # Gets an IpFilterRule for a Namespace by rule name.
862
+ #
863
+ # @param resource_group_name [String] Name of the Resource group within the
864
+ # Azure subscription.
865
+ # @param namespace_name [String] The namespace name
866
+ # @param ip_filter_rule_name [String] The IP Filter Rule name.
867
+ # @param [Hash{String => String}] A hash of custom headers that will be added
868
+ # to the HTTP request.
869
+ #
870
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
871
+ #
872
+ def get_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
873
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
874
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
875
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
876
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
877
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
878
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
879
+ fail ArgumentError, 'ip_filter_rule_name is nil' if ip_filter_rule_name.nil?
880
+ fail ArgumentError, "'ip_filter_rule_name' should satisfy the constraint - 'MinLength': '1'" if !ip_filter_rule_name.nil? && ip_filter_rule_name.length < 1
881
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
882
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
883
+
884
+
885
+ request_headers = {}
886
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
887
+
888
+ # Set Headers
889
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
890
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
891
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/ipfilterrules/{ipFilterRuleName}'
892
+
893
+ request_url = @base_url || @client.base_url
894
+
895
+ options = {
896
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
897
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'ipFilterRuleName' => ip_filter_rule_name,'subscriptionId' => @client.subscription_id},
898
+ query_params: {'api-version' => @client.api_version},
899
+ headers: request_headers.merge(custom_headers || {}),
900
+ base_url: request_url
901
+ }
902
+ promise = @client.make_request_async(:get, path_template, options)
903
+
904
+ promise = promise.then do |result|
905
+ http_response = result.response
906
+ status_code = http_response.status
907
+ response_content = http_response.body
908
+ unless status_code == 200
909
+ error_model = JSON.load(response_content)
910
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
911
+ end
912
+
913
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
914
+ # Deserialize Response
915
+ if status_code == 200
916
+ begin
917
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
918
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::IpFilterRule.mapper()
919
+ result.body = @client.deserialize(result_mapper, parsed_response)
920
+ rescue Exception => e
921
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
922
+ end
923
+ end
924
+
925
+ result
926
+ end
927
+
928
+ promise.execute
929
+ end
930
+
931
+ #
932
+ # Gets a list of VirtualNetwork rules for a Namespace.
933
+ #
934
+ # @param resource_group_name [String] Name of the Resource group within the
935
+ # Azure subscription.
936
+ # @param namespace_name [String] The namespace name
937
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
938
+ # will be added to the HTTP request.
939
+ #
940
+ # @return [Array<VirtualNetworkRule>] operation results.
941
+ #
942
+ def list_virtual_network_rules(resource_group_name, namespace_name, custom_headers:nil)
943
+ first_page = list_virtual_network_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
944
+ first_page.get_all_items
945
+ end
946
+
947
+ #
948
+ # Gets a list of VirtualNetwork rules for a Namespace.
949
+ #
950
+ # @param resource_group_name [String] Name of the Resource group within the
951
+ # Azure subscription.
952
+ # @param namespace_name [String] The namespace name
953
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
954
+ # will be added to the HTTP request.
955
+ #
956
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
957
+ #
958
+ def list_virtual_network_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
959
+ list_virtual_network_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
960
+ end
961
+
962
+ #
963
+ # Gets a list of VirtualNetwork rules for a Namespace.
964
+ #
965
+ # @param resource_group_name [String] Name of the Resource group within the
966
+ # Azure subscription.
967
+ # @param namespace_name [String] The namespace name
968
+ # @param [Hash{String => String}] A hash of custom headers that will be added
969
+ # to the HTTP request.
970
+ #
971
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
972
+ #
973
+ def list_virtual_network_rules_async(resource_group_name, namespace_name, custom_headers:nil)
974
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
975
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
976
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
977
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
978
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
979
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
980
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
981
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
982
+
983
+
984
+ request_headers = {}
985
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
986
+
987
+ # Set Headers
988
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
989
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
990
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules'
991
+
992
+ request_url = @base_url || @client.base_url
993
+
994
+ options = {
995
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
996
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
997
+ query_params: {'api-version' => @client.api_version},
998
+ headers: request_headers.merge(custom_headers || {}),
999
+ base_url: request_url
1000
+ }
1001
+ promise = @client.make_request_async(:get, path_template, options)
1002
+
1003
+ promise = promise.then do |result|
1004
+ http_response = result.response
1005
+ status_code = http_response.status
1006
+ response_content = http_response.body
1007
+ unless status_code == 200
1008
+ error_model = JSON.load(response_content)
1009
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1010
+ end
1011
+
1012
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1013
+ # Deserialize Response
1014
+ if status_code == 200
1015
+ begin
1016
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1017
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::VirtualNetworkRuleListResult.mapper()
1018
+ result.body = @client.deserialize(result_mapper, parsed_response)
1019
+ rescue Exception => e
1020
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1021
+ end
1022
+ end
1023
+
1024
+ result
1025
+ end
1026
+
1027
+ promise.execute
1028
+ end
1029
+
1030
+ #
1031
+ # Creates or updates an VirtualNetworkRule for a Namespace.
1032
+ #
1033
+ # @param resource_group_name [String] Name of the Resource group within the
1034
+ # Azure subscription.
1035
+ # @param namespace_name [String] The namespace name
1036
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1037
+ # @param parameters [VirtualNetworkRule] The Namespace VirtualNetworkRule.
1038
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1039
+ # will be added to the HTTP request.
1040
+ #
1041
+ # @return [VirtualNetworkRule] operation results.
1042
+ #
1043
+ def create_or_update_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:nil)
1044
+ response = create_or_update_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
1045
+ response.body unless response.nil?
1046
+ end
1047
+
1048
+ #
1049
+ # Creates or updates an VirtualNetworkRule for a Namespace.
1050
+ #
1051
+ # @param resource_group_name [String] Name of the Resource group within the
1052
+ # Azure subscription.
1053
+ # @param namespace_name [String] The namespace name
1054
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1055
+ # @param parameters [VirtualNetworkRule] The Namespace VirtualNetworkRule.
1056
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1057
+ # will be added to the HTTP request.
1058
+ #
1059
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1060
+ #
1061
+ def create_or_update_virtual_network_rule_with_http_info(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:nil)
1062
+ create_or_update_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
1063
+ end
1064
+
1065
+ #
1066
+ # Creates or updates an VirtualNetworkRule for a Namespace.
1067
+ #
1068
+ # @param resource_group_name [String] Name of the Resource group within the
1069
+ # Azure subscription.
1070
+ # @param namespace_name [String] The namespace name
1071
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1072
+ # @param parameters [VirtualNetworkRule] The Namespace VirtualNetworkRule.
1073
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1074
+ # to the HTTP request.
1075
+ #
1076
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1077
+ #
1078
+ def create_or_update_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:nil)
1079
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1080
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1081
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1082
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1083
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1084
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1085
+ fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
1086
+ fail ArgumentError, "'virtual_network_rule_name' should satisfy the constraint - 'MinLength': '1'" if !virtual_network_rule_name.nil? && virtual_network_rule_name.length < 1
1087
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1088
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1089
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1090
+
1091
+
1092
+ request_headers = {}
1093
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1094
+
1095
+ # Set Headers
1096
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1097
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1098
+
1099
+ # Serialize Request
1100
+ request_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::VirtualNetworkRule.mapper()
1101
+ request_content = @client.serialize(request_mapper, parameters)
1102
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1103
+
1104
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'
1105
+
1106
+ request_url = @base_url || @client.base_url
1107
+
1108
+ options = {
1109
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1110
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'virtualNetworkRuleName' => virtual_network_rule_name,'subscriptionId' => @client.subscription_id},
1111
+ query_params: {'api-version' => @client.api_version},
1112
+ body: request_content,
1113
+ headers: request_headers.merge(custom_headers || {}),
1114
+ base_url: request_url
1115
+ }
1116
+ promise = @client.make_request_async(:put, path_template, options)
1117
+
1118
+ promise = promise.then do |result|
1119
+ http_response = result.response
1120
+ status_code = http_response.status
1121
+ response_content = http_response.body
1122
+ unless status_code == 200
1123
+ error_model = JSON.load(response_content)
1124
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1125
+ end
1126
+
1127
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1128
+ # Deserialize Response
1129
+ if status_code == 200
1130
+ begin
1131
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1132
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::VirtualNetworkRule.mapper()
1133
+ result.body = @client.deserialize(result_mapper, parsed_response)
1134
+ rescue Exception => e
1135
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1136
+ end
1137
+ end
1138
+
1139
+ result
1140
+ end
1141
+
1142
+ promise.execute
1143
+ end
1144
+
1145
+ #
1146
+ # Deletes an VirtualNetworkRule for a Namespace.
1147
+ #
1148
+ # @param resource_group_name [String] Name of the Resource group within the
1149
+ # Azure subscription.
1150
+ # @param namespace_name [String] The namespace name
1151
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1153
+ # will be added to the HTTP request.
1154
+ #
1155
+ #
1156
+ def delete_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil)
1157
+ response = delete_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:custom_headers).value!
1158
+ nil
1159
+ end
1160
+
1161
+ #
1162
+ # Deletes an VirtualNetworkRule for a Namespace.
1163
+ #
1164
+ # @param resource_group_name [String] Name of the Resource group within the
1165
+ # Azure subscription.
1166
+ # @param namespace_name [String] The namespace name
1167
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1168
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1169
+ # will be added to the HTTP request.
1170
+ #
1171
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1172
+ #
1173
+ def delete_virtual_network_rule_with_http_info(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil)
1174
+ delete_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:custom_headers).value!
1175
+ end
1176
+
1177
+ #
1178
+ # Deletes an VirtualNetworkRule for a Namespace.
1179
+ #
1180
+ # @param resource_group_name [String] Name of the Resource group within the
1181
+ # Azure subscription.
1182
+ # @param namespace_name [String] The namespace name
1183
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1184
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1185
+ # to the HTTP request.
1186
+ #
1187
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1188
+ #
1189
+ def delete_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil)
1190
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1191
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1192
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1193
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1194
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1195
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1196
+ fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
1197
+ fail ArgumentError, "'virtual_network_rule_name' should satisfy the constraint - 'MinLength': '1'" if !virtual_network_rule_name.nil? && virtual_network_rule_name.length < 1
1198
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1199
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1200
+
1201
+
1202
+ request_headers = {}
1203
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1204
+
1205
+ # Set Headers
1206
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1207
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1208
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'
1209
+
1210
+ request_url = @base_url || @client.base_url
1211
+
1212
+ options = {
1213
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1214
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'virtualNetworkRuleName' => virtual_network_rule_name,'subscriptionId' => @client.subscription_id},
1215
+ query_params: {'api-version' => @client.api_version},
1216
+ headers: request_headers.merge(custom_headers || {}),
1217
+ base_url: request_url
1218
+ }
1219
+ promise = @client.make_request_async(:delete, path_template, options)
1220
+
1221
+ promise = promise.then do |result|
1222
+ http_response = result.response
1223
+ status_code = http_response.status
1224
+ response_content = http_response.body
1225
+ unless status_code == 204 || status_code == 200
1226
+ error_model = JSON.load(response_content)
1227
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1228
+ end
1229
+
1230
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1231
+
1232
+ result
1233
+ end
1234
+
1235
+ promise.execute
1236
+ end
1237
+
1238
+ #
1239
+ # Gets an VirtualNetworkRule for a Namespace by rule name.
1240
+ #
1241
+ # @param resource_group_name [String] Name of the Resource group within the
1242
+ # Azure subscription.
1243
+ # @param namespace_name [String] The namespace name
1244
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1246
+ # will be added to the HTTP request.
1247
+ #
1248
+ # @return [VirtualNetworkRule] operation results.
1249
+ #
1250
+ def get_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil)
1251
+ response = get_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:custom_headers).value!
1252
+ response.body unless response.nil?
1253
+ end
1254
+
1255
+ #
1256
+ # Gets an VirtualNetworkRule for a Namespace by rule name.
1257
+ #
1258
+ # @param resource_group_name [String] Name of the Resource group within the
1259
+ # Azure subscription.
1260
+ # @param namespace_name [String] The namespace name
1261
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1263
+ # will be added to the HTTP request.
1264
+ #
1265
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1266
+ #
1267
+ def get_virtual_network_rule_with_http_info(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil)
1268
+ get_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:custom_headers).value!
1269
+ end
1270
+
1271
+ #
1272
+ # Gets an VirtualNetworkRule for a Namespace by rule name.
1273
+ #
1274
+ # @param resource_group_name [String] Name of the Resource group within the
1275
+ # Azure subscription.
1276
+ # @param namespace_name [String] The namespace name
1277
+ # @param virtual_network_rule_name [String] The Virtual Network Rule name.
1278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1279
+ # to the HTTP request.
1280
+ #
1281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1282
+ #
1283
+ def get_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil)
1284
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1285
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1286
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1287
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1288
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1289
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1290
+ fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
1291
+ fail ArgumentError, "'virtual_network_rule_name' should satisfy the constraint - 'MinLength': '1'" if !virtual_network_rule_name.nil? && virtual_network_rule_name.length < 1
1292
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1293
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1294
+
1295
+
1296
+ request_headers = {}
1297
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1298
+
1299
+ # Set Headers
1300
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1301
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1302
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/virtualnetworkrules/{virtualNetworkRuleName}'
1303
+
1304
+ request_url = @base_url || @client.base_url
1305
+
1306
+ options = {
1307
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1308
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'virtualNetworkRuleName' => virtual_network_rule_name,'subscriptionId' => @client.subscription_id},
1309
+ query_params: {'api-version' => @client.api_version},
1310
+ headers: request_headers.merge(custom_headers || {}),
1311
+ base_url: request_url
1312
+ }
1313
+ promise = @client.make_request_async(:get, path_template, options)
1314
+
1315
+ promise = promise.then do |result|
1316
+ http_response = result.response
1317
+ status_code = http_response.status
1318
+ response_content = http_response.body
1319
+ unless status_code == 200
1320
+ error_model = JSON.load(response_content)
1321
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1322
+ end
1323
+
1324
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1325
+ # Deserialize Response
1326
+ if status_code == 200
1327
+ begin
1328
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1329
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::VirtualNetworkRule.mapper()
1330
+ result.body = @client.deserialize(result_mapper, parsed_response)
1331
+ rescue Exception => e
1332
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1333
+ end
1334
+ end
1335
+
1336
+ result
1337
+ end
1338
+
1339
+ promise.execute
1340
+ end
1341
+
1342
+ #
1343
+ # Gets NetworkRuleSet for a Namespace.
1344
+ #
1345
+ # @param resource_group_name [String] Name of the Resource group within the
1346
+ # Azure subscription.
1347
+ # @param namespace_name [String] The namespace name
1348
+ # @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
1349
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1350
+ # will be added to the HTTP request.
1351
+ #
1352
+ # @return [NetworkRuleSet] operation results.
1353
+ #
1354
+ def create_or_update_network_rule_set(resource_group_name, namespace_name, parameters, custom_headers:nil)
1355
+ response = create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1356
+ response.body unless response.nil?
1357
+ end
1358
+
1359
+ #
1360
+ # Gets NetworkRuleSet for a Namespace.
1361
+ #
1362
+ # @param resource_group_name [String] Name of the Resource group within the
1363
+ # Azure subscription.
1364
+ # @param namespace_name [String] The namespace name
1365
+ # @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
1366
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1367
+ # will be added to the HTTP request.
1368
+ #
1369
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1370
+ #
1371
+ def create_or_update_network_rule_set_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
1372
+ create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1373
+ end
1374
+
1375
+ #
1376
+ # Gets NetworkRuleSet for a Namespace.
1377
+ #
1378
+ # @param resource_group_name [String] Name of the Resource group within the
1379
+ # Azure subscription.
1380
+ # @param namespace_name [String] The namespace name
1381
+ # @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
1382
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1383
+ # to the HTTP request.
1384
+ #
1385
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1386
+ #
1387
+ def create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
1388
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1389
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1390
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1391
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1392
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1393
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1394
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1395
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1396
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1397
+
1398
+
1399
+ request_headers = {}
1400
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1401
+
1402
+ # Set Headers
1403
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1404
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1405
+
1406
+ # Serialize Request
1407
+ request_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::NetworkRuleSet.mapper()
1408
+ request_content = @client.serialize(request_mapper, parameters)
1409
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1410
+
1411
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkrulesets/default'
1412
+
1413
+ request_url = @base_url || @client.base_url
1414
+
1415
+ options = {
1416
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1417
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1418
+ query_params: {'api-version' => @client.api_version},
1419
+ body: request_content,
1420
+ headers: request_headers.merge(custom_headers || {}),
1421
+ base_url: request_url
1422
+ }
1423
+ promise = @client.make_request_async(:put, path_template, options)
1424
+
1425
+ promise = promise.then do |result|
1426
+ http_response = result.response
1427
+ status_code = http_response.status
1428
+ response_content = http_response.body
1429
+ unless status_code == 200
1430
+ error_model = JSON.load(response_content)
1431
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1432
+ end
1433
+
1434
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1435
+ # Deserialize Response
1436
+ if status_code == 200
1437
+ begin
1438
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1439
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::NetworkRuleSet.mapper()
1440
+ result.body = @client.deserialize(result_mapper, parsed_response)
1441
+ rescue Exception => e
1442
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1443
+ end
1444
+ end
1445
+
1446
+ result
1447
+ end
1448
+
1449
+ promise.execute
1450
+ end
1451
+
1452
+ #
1453
+ # Gets NetworkRuleSet for a Namespace.
1454
+ #
1455
+ # @param resource_group_name [String] Name of the Resource group within the
1456
+ # Azure subscription.
1457
+ # @param namespace_name [String] The namespace name
1458
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1459
+ # will be added to the HTTP request.
1460
+ #
1461
+ # @return [NetworkRuleSet] operation results.
1462
+ #
1463
+ def get_network_rule_set(resource_group_name, namespace_name, custom_headers:nil)
1464
+ response = get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1465
+ response.body unless response.nil?
1466
+ end
1467
+
1468
+ #
1469
+ # Gets NetworkRuleSet for a Namespace.
1470
+ #
1471
+ # @param resource_group_name [String] Name of the Resource group within the
1472
+ # Azure subscription.
1473
+ # @param namespace_name [String] The namespace name
1474
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1475
+ # will be added to the HTTP request.
1476
+ #
1477
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1478
+ #
1479
+ def get_network_rule_set_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
1480
+ get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1481
+ end
1482
+
1483
+ #
1484
+ # Gets NetworkRuleSet for a Namespace.
1485
+ #
1486
+ # @param resource_group_name [String] Name of the Resource group within the
1487
+ # Azure subscription.
1488
+ # @param namespace_name [String] The namespace name
1489
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1490
+ # to the HTTP request.
1491
+ #
1492
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1493
+ #
1494
+ def get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:nil)
1495
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1496
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1497
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1498
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1499
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1500
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1501
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1502
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1503
+
1504
+
1505
+ request_headers = {}
1506
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1507
+
1508
+ # Set Headers
1509
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1510
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1511
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkrulesets/default'
1512
+
1513
+ request_url = @base_url || @client.base_url
1514
+
1515
+ options = {
1516
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1517
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1518
+ query_params: {'api-version' => @client.api_version},
1519
+ headers: request_headers.merge(custom_headers || {}),
1520
+ base_url: request_url
1521
+ }
1522
+ promise = @client.make_request_async(:get, path_template, options)
1523
+
1524
+ promise = promise.then do |result|
1525
+ http_response = result.response
1526
+ status_code = http_response.status
1527
+ response_content = http_response.body
1528
+ unless status_code == 200
1529
+ error_model = JSON.load(response_content)
1530
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1531
+ end
1532
+
1533
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1534
+ # Deserialize Response
1535
+ if status_code == 200
1536
+ begin
1537
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1538
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::NetworkRuleSet.mapper()
1539
+ result.body = @client.deserialize(result_mapper, parsed_response)
1540
+ rescue Exception => e
1541
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1542
+ end
1543
+ end
1544
+
1545
+ result
1546
+ end
1547
+
1548
+ promise.execute
1549
+ end
1550
+
1551
+ #
1552
+ # Creates or updates a service namespace. Once created, this namespace's
1553
+ # resource manifest is immutable. This operation is idempotent.
1554
+ #
1555
+ # @param resource_group_name [String] Name of the Resource group within the
1556
+ # Azure subscription.
1557
+ # @param namespace_name [String] The namespace name.
1558
+ # @param parameters [SBNamespace] Parameters supplied to create a namespace
1559
+ # resource.
1560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1561
+ # will be added to the HTTP request.
1562
+ #
1563
+ # @return [SBNamespace] operation results.
1564
+ #
1565
+ def begin_create_or_update(resource_group_name, namespace_name, parameters, custom_headers:nil)
1566
+ response = begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1567
+ response.body unless response.nil?
1568
+ end
1569
+
1570
+ #
1571
+ # Creates or updates a service namespace. Once created, this namespace's
1572
+ # resource manifest is immutable. This operation is idempotent.
1573
+ #
1574
+ # @param resource_group_name [String] Name of the Resource group within the
1575
+ # Azure subscription.
1576
+ # @param namespace_name [String] The namespace name.
1577
+ # @param parameters [SBNamespace] Parameters supplied to create a namespace
1578
+ # resource.
1579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1580
+ # will be added to the HTTP request.
1581
+ #
1582
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1583
+ #
1584
+ def begin_create_or_update_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
1585
+ begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1586
+ end
1587
+
1588
+ #
1589
+ # Creates or updates a service namespace. Once created, this namespace's
1590
+ # resource manifest is immutable. This operation is idempotent.
1591
+ #
1592
+ # @param resource_group_name [String] Name of the Resource group within the
1593
+ # Azure subscription.
1594
+ # @param namespace_name [String] The namespace name.
1595
+ # @param parameters [SBNamespace] Parameters supplied to create a namespace
1596
+ # resource.
1597
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1598
+ # to the HTTP request.
1599
+ #
1600
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1601
+ #
1602
+ def begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
1603
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1604
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1605
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1606
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1607
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1608
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1609
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1610
+
1611
+
1612
+ request_headers = {}
1613
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1614
+
1615
+ # Set Headers
1616
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1617
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1618
+
1619
+ # Serialize Request
1620
+ request_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
1621
+ request_content = @client.serialize(request_mapper, parameters)
1622
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1623
+
1624
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
1625
+
1626
+ request_url = @base_url || @client.base_url
1627
+
1628
+ options = {
1629
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1630
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1631
+ query_params: {'api-version' => @client.api_version},
1632
+ body: request_content,
1633
+ headers: request_headers.merge(custom_headers || {}),
1634
+ base_url: request_url
1635
+ }
1636
+ promise = @client.make_request_async(:put, path_template, options)
1637
+
1638
+ promise = promise.then do |result|
1639
+ http_response = result.response
1640
+ status_code = http_response.status
1641
+ response_content = http_response.body
1642
+ unless status_code == 201 || status_code == 200 || status_code == 202
1643
+ error_model = JSON.load(response_content)
1644
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1645
+ end
1646
+
1647
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1648
+ # Deserialize Response
1649
+ if status_code == 201
1650
+ begin
1651
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1652
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
1653
+ result.body = @client.deserialize(result_mapper, parsed_response)
1654
+ rescue Exception => e
1655
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1656
+ end
1657
+ end
1658
+ # Deserialize Response
1659
+ if status_code == 200
1660
+ begin
1661
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1662
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespace.mapper()
1663
+ result.body = @client.deserialize(result_mapper, parsed_response)
1664
+ rescue Exception => e
1665
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1666
+ end
1667
+ end
1668
+
1669
+ result
1670
+ end
1671
+
1672
+ promise.execute
1673
+ end
1674
+
1675
+ #
1676
+ # Deletes an existing namespace. This operation also removes all associated
1677
+ # resources under the namespace.
1678
+ #
1679
+ # @param resource_group_name [String] Name of the Resource group within the
1680
+ # Azure subscription.
1681
+ # @param namespace_name [String] The namespace name
1682
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1683
+ # will be added to the HTTP request.
1684
+ #
1685
+ #
1686
+ def begin_delete(resource_group_name, namespace_name, custom_headers:nil)
1687
+ response = begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1688
+ nil
1689
+ end
1690
+
1691
+ #
1692
+ # Deletes an existing namespace. This operation also removes all associated
1693
+ # resources under the namespace.
1694
+ #
1695
+ # @param resource_group_name [String] Name of the Resource group within the
1696
+ # Azure subscription.
1697
+ # @param namespace_name [String] The namespace name
1698
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1699
+ # will be added to the HTTP request.
1700
+ #
1701
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1702
+ #
1703
+ def begin_delete_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
1704
+ begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1705
+ end
1706
+
1707
+ #
1708
+ # Deletes an existing namespace. This operation also removes all associated
1709
+ # resources under the namespace.
1710
+ #
1711
+ # @param resource_group_name [String] Name of the Resource group within the
1712
+ # Azure subscription.
1713
+ # @param namespace_name [String] The namespace name
1714
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1715
+ # to the HTTP request.
1716
+ #
1717
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1718
+ #
1719
+ def begin_delete_async(resource_group_name, namespace_name, custom_headers:nil)
1720
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1721
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1722
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1723
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1724
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1725
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1726
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1727
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1728
+
1729
+
1730
+ request_headers = {}
1731
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1732
+
1733
+ # Set Headers
1734
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1735
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1736
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
1737
+
1738
+ request_url = @base_url || @client.base_url
1739
+
1740
+ options = {
1741
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1742
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1743
+ query_params: {'api-version' => @client.api_version},
1744
+ headers: request_headers.merge(custom_headers || {}),
1745
+ base_url: request_url
1746
+ }
1747
+ promise = @client.make_request_async(:delete, path_template, options)
1748
+
1749
+ promise = promise.then do |result|
1750
+ http_response = result.response
1751
+ status_code = http_response.status
1752
+ response_content = http_response.body
1753
+ unless status_code == 204 || status_code == 200 || status_code == 202
1754
+ error_model = JSON.load(response_content)
1755
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1756
+ end
1757
+
1758
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1759
+
1760
+ result
1761
+ end
1762
+
1763
+ promise.execute
1764
+ end
1765
+
1766
+ #
1767
+ # Gets all the available namespaces within the subscription, irrespective of
1768
+ # the resource groups.
1769
+ #
1770
+ # @param next_page_link [String] The NextLink from the previous successful call
1771
+ # to List operation.
1772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1773
+ # will be added to the HTTP request.
1774
+ #
1775
+ # @return [SBNamespaceListResult] operation results.
1776
+ #
1777
+ def list_next(next_page_link, custom_headers:nil)
1778
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1779
+ response.body unless response.nil?
1780
+ end
1781
+
1782
+ #
1783
+ # Gets all the available namespaces within the subscription, irrespective of
1784
+ # the resource groups.
1785
+ #
1786
+ # @param next_page_link [String] The NextLink from the previous successful call
1787
+ # to List operation.
1788
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1789
+ # will be added to the HTTP request.
1790
+ #
1791
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1792
+ #
1793
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1794
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1795
+ end
1796
+
1797
+ #
1798
+ # Gets all the available namespaces within the subscription, irrespective of
1799
+ # the resource groups.
1800
+ #
1801
+ # @param next_page_link [String] The NextLink from the previous successful call
1802
+ # to List operation.
1803
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1804
+ # to the HTTP request.
1805
+ #
1806
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1807
+ #
1808
+ def list_next_async(next_page_link, custom_headers:nil)
1809
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1810
+
1811
+
1812
+ request_headers = {}
1813
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1814
+
1815
+ # Set Headers
1816
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1817
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1818
+ path_template = '{nextLink}'
1819
+
1820
+ request_url = @base_url || @client.base_url
1821
+
1822
+ options = {
1823
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1824
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1825
+ headers: request_headers.merge(custom_headers || {}),
1826
+ base_url: request_url
1827
+ }
1828
+ promise = @client.make_request_async(:get, path_template, options)
1829
+
1830
+ promise = promise.then do |result|
1831
+ http_response = result.response
1832
+ status_code = http_response.status
1833
+ response_content = http_response.body
1834
+ unless status_code == 200
1835
+ error_model = JSON.load(response_content)
1836
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1837
+ end
1838
+
1839
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1840
+ # Deserialize Response
1841
+ if status_code == 200
1842
+ begin
1843
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1844
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespaceListResult.mapper()
1845
+ result.body = @client.deserialize(result_mapper, parsed_response)
1846
+ rescue Exception => e
1847
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1848
+ end
1849
+ end
1850
+
1851
+ result
1852
+ end
1853
+
1854
+ promise.execute
1855
+ end
1856
+
1857
+ #
1858
+ # Gets the available namespaces within a resource group.
1859
+ #
1860
+ # @param next_page_link [String] The NextLink from the previous successful call
1861
+ # to List operation.
1862
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1863
+ # will be added to the HTTP request.
1864
+ #
1865
+ # @return [SBNamespaceListResult] operation results.
1866
+ #
1867
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1868
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1869
+ response.body unless response.nil?
1870
+ end
1871
+
1872
+ #
1873
+ # Gets the available namespaces within a resource group.
1874
+ #
1875
+ # @param next_page_link [String] The NextLink from the previous successful call
1876
+ # to List operation.
1877
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1878
+ # will be added to the HTTP request.
1879
+ #
1880
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1881
+ #
1882
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1883
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1884
+ end
1885
+
1886
+ #
1887
+ # Gets the available namespaces within a resource group.
1888
+ #
1889
+ # @param next_page_link [String] The NextLink from the previous successful call
1890
+ # to List operation.
1891
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1892
+ # to the HTTP request.
1893
+ #
1894
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1895
+ #
1896
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1897
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1898
+
1899
+
1900
+ request_headers = {}
1901
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1902
+
1903
+ # Set Headers
1904
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1905
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1906
+ path_template = '{nextLink}'
1907
+
1908
+ request_url = @base_url || @client.base_url
1909
+
1910
+ options = {
1911
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1912
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1913
+ headers: request_headers.merge(custom_headers || {}),
1914
+ base_url: request_url
1915
+ }
1916
+ promise = @client.make_request_async(:get, path_template, options)
1917
+
1918
+ promise = promise.then do |result|
1919
+ http_response = result.response
1920
+ status_code = http_response.status
1921
+ response_content = http_response.body
1922
+ unless status_code == 200
1923
+ error_model = JSON.load(response_content)
1924
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1925
+ end
1926
+
1927
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1928
+ # Deserialize Response
1929
+ if status_code == 200
1930
+ begin
1931
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1932
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::SBNamespaceListResult.mapper()
1933
+ result.body = @client.deserialize(result_mapper, parsed_response)
1934
+ rescue Exception => e
1935
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1936
+ end
1937
+ end
1938
+
1939
+ result
1940
+ end
1941
+
1942
+ promise.execute
1943
+ end
1944
+
1945
+ #
1946
+ # Gets a list of IP Filter rules for a Namespace.
1947
+ #
1948
+ # @param next_page_link [String] The NextLink from the previous successful call
1949
+ # to List operation.
1950
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1951
+ # will be added to the HTTP request.
1952
+ #
1953
+ # @return [IpFilterRuleListResult] operation results.
1954
+ #
1955
+ def list_ip_filter_rules_next(next_page_link, custom_headers:nil)
1956
+ response = list_ip_filter_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1957
+ response.body unless response.nil?
1958
+ end
1959
+
1960
+ #
1961
+ # Gets a list of IP Filter rules for a Namespace.
1962
+ #
1963
+ # @param next_page_link [String] The NextLink from the previous successful call
1964
+ # to List operation.
1965
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1966
+ # will be added to the HTTP request.
1967
+ #
1968
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1969
+ #
1970
+ def list_ip_filter_rules_next_with_http_info(next_page_link, custom_headers:nil)
1971
+ list_ip_filter_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1972
+ end
1973
+
1974
+ #
1975
+ # Gets a list of IP Filter rules for a Namespace.
1976
+ #
1977
+ # @param next_page_link [String] The NextLink from the previous successful call
1978
+ # to List operation.
1979
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1980
+ # to the HTTP request.
1981
+ #
1982
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1983
+ #
1984
+ def list_ip_filter_rules_next_async(next_page_link, custom_headers:nil)
1985
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1986
+
1987
+
1988
+ request_headers = {}
1989
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1990
+
1991
+ # Set Headers
1992
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1993
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1994
+ path_template = '{nextLink}'
1995
+
1996
+ request_url = @base_url || @client.base_url
1997
+
1998
+ options = {
1999
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2000
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2001
+ headers: request_headers.merge(custom_headers || {}),
2002
+ base_url: request_url
2003
+ }
2004
+ promise = @client.make_request_async(:get, path_template, options)
2005
+
2006
+ promise = promise.then do |result|
2007
+ http_response = result.response
2008
+ status_code = http_response.status
2009
+ response_content = http_response.body
2010
+ unless status_code == 200
2011
+ error_model = JSON.load(response_content)
2012
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2013
+ end
2014
+
2015
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2016
+ # Deserialize Response
2017
+ if status_code == 200
2018
+ begin
2019
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2020
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::IpFilterRuleListResult.mapper()
2021
+ result.body = @client.deserialize(result_mapper, parsed_response)
2022
+ rescue Exception => e
2023
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2024
+ end
2025
+ end
2026
+
2027
+ result
2028
+ end
2029
+
2030
+ promise.execute
2031
+ end
2032
+
2033
+ #
2034
+ # Gets a list of VirtualNetwork rules for a Namespace.
2035
+ #
2036
+ # @param next_page_link [String] The NextLink from the previous successful call
2037
+ # to List operation.
2038
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2039
+ # will be added to the HTTP request.
2040
+ #
2041
+ # @return [VirtualNetworkRuleListResult] operation results.
2042
+ #
2043
+ def list_virtual_network_rules_next(next_page_link, custom_headers:nil)
2044
+ response = list_virtual_network_rules_next_async(next_page_link, custom_headers:custom_headers).value!
2045
+ response.body unless response.nil?
2046
+ end
2047
+
2048
+ #
2049
+ # Gets a list of VirtualNetwork rules for a Namespace.
2050
+ #
2051
+ # @param next_page_link [String] The NextLink from the previous successful call
2052
+ # to List operation.
2053
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2054
+ # will be added to the HTTP request.
2055
+ #
2056
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2057
+ #
2058
+ def list_virtual_network_rules_next_with_http_info(next_page_link, custom_headers:nil)
2059
+ list_virtual_network_rules_next_async(next_page_link, custom_headers:custom_headers).value!
2060
+ end
2061
+
2062
+ #
2063
+ # Gets a list of VirtualNetwork rules for a Namespace.
2064
+ #
2065
+ # @param next_page_link [String] The NextLink from the previous successful call
2066
+ # to List operation.
2067
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2068
+ # to the HTTP request.
2069
+ #
2070
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2071
+ #
2072
+ def list_virtual_network_rules_next_async(next_page_link, custom_headers:nil)
2073
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2074
+
2075
+
2076
+ request_headers = {}
2077
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2078
+
2079
+ # Set Headers
2080
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2081
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2082
+ path_template = '{nextLink}'
2083
+
2084
+ request_url = @base_url || @client.base_url
2085
+
2086
+ options = {
2087
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2088
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2089
+ headers: request_headers.merge(custom_headers || {}),
2090
+ base_url: request_url
2091
+ }
2092
+ promise = @client.make_request_async(:get, path_template, options)
2093
+
2094
+ promise = promise.then do |result|
2095
+ http_response = result.response
2096
+ status_code = http_response.status
2097
+ response_content = http_response.body
2098
+ unless status_code == 200
2099
+ error_model = JSON.load(response_content)
2100
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2101
+ end
2102
+
2103
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2104
+ # Deserialize Response
2105
+ if status_code == 200
2106
+ begin
2107
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2108
+ result_mapper = Azure::ServiceBus::Mgmt::V2018_01_01_preview::Models::VirtualNetworkRuleListResult.mapper()
2109
+ result.body = @client.deserialize(result_mapper, parsed_response)
2110
+ rescue Exception => e
2111
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2112
+ end
2113
+ end
2114
+
2115
+ result
2116
+ end
2117
+
2118
+ promise.execute
2119
+ end
2120
+
2121
+ #
2122
+ # Gets all the available namespaces within the subscription, irrespective of
2123
+ # the resource groups.
2124
+ #
2125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2126
+ # will be added to the HTTP request.
2127
+ #
2128
+ # @return [SBNamespaceListResult] which provide lazy access to pages of the
2129
+ # response.
2130
+ #
2131
+ def list_as_lazy(custom_headers:nil)
2132
+ response = list_async(custom_headers:custom_headers).value!
2133
+ unless response.nil?
2134
+ page = response.body
2135
+ page.next_method = Proc.new do |next_page_link|
2136
+ list_next_async(next_page_link, custom_headers:custom_headers)
2137
+ end
2138
+ page
2139
+ end
2140
+ end
2141
+
2142
+ #
2143
+ # Gets the available namespaces within a resource group.
2144
+ #
2145
+ # @param resource_group_name [String] Name of the Resource group within the
2146
+ # Azure subscription.
2147
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2148
+ # will be added to the HTTP request.
2149
+ #
2150
+ # @return [SBNamespaceListResult] which provide lazy access to pages of the
2151
+ # response.
2152
+ #
2153
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
2154
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
2155
+ unless response.nil?
2156
+ page = response.body
2157
+ page.next_method = Proc.new do |next_page_link|
2158
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
2159
+ end
2160
+ page
2161
+ end
2162
+ end
2163
+
2164
+ #
2165
+ # Gets a list of IP Filter rules for a Namespace.
2166
+ #
2167
+ # @param resource_group_name [String] Name of the Resource group within the
2168
+ # Azure subscription.
2169
+ # @param namespace_name [String] The namespace name
2170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2171
+ # will be added to the HTTP request.
2172
+ #
2173
+ # @return [IpFilterRuleListResult] which provide lazy access to pages of the
2174
+ # response.
2175
+ #
2176
+ def list_ip_filter_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
2177
+ response = list_ip_filter_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
2178
+ unless response.nil?
2179
+ page = response.body
2180
+ page.next_method = Proc.new do |next_page_link|
2181
+ list_ip_filter_rules_next_async(next_page_link, custom_headers:custom_headers)
2182
+ end
2183
+ page
2184
+ end
2185
+ end
2186
+
2187
+ #
2188
+ # Gets a list of VirtualNetwork rules for a Namespace.
2189
+ #
2190
+ # @param resource_group_name [String] Name of the Resource group within the
2191
+ # Azure subscription.
2192
+ # @param namespace_name [String] The namespace name
2193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2194
+ # will be added to the HTTP request.
2195
+ #
2196
+ # @return [VirtualNetworkRuleListResult] which provide lazy access to pages of
2197
+ # the response.
2198
+ #
2199
+ def list_virtual_network_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
2200
+ response = list_virtual_network_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
2201
+ unless response.nil?
2202
+ page = response.body
2203
+ page.next_method = Proc.new do |next_page_link|
2204
+ list_virtual_network_rules_next_async(next_page_link, custom_headers:custom_headers)
2205
+ end
2206
+ page
2207
+ end
2208
+ end
2209
+
2210
+ end
2211
+ end