azure_mgmt_network 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_network.rb +91 -82
  3. data/lib/generated/azure_mgmt_network/application_gateways.rb +17 -20
  4. data/lib/generated/azure_mgmt_network/bgp_service_communities.rb +216 -0
  5. data/lib/generated/azure_mgmt_network/express_route_circuit_authorizations.rb +9 -12
  6. data/lib/generated/azure_mgmt_network/express_route_circuit_peerings.rb +9 -12
  7. data/lib/generated/azure_mgmt_network/express_route_circuits.rb +21 -24
  8. data/lib/generated/azure_mgmt_network/express_route_service_providers.rb +3 -6
  9. data/lib/generated/azure_mgmt_network/load_balancers.rb +11 -14
  10. data/lib/generated/azure_mgmt_network/local_network_gateways.rb +9 -12
  11. data/lib/generated/azure_mgmt_network/models/{network_operation_status.rb → access.rb} +4 -5
  12. data/lib/generated/azure_mgmt_network/models/{error.rb → bgp_service_community.rb} +39 -36
  13. data/lib/generated/azure_mgmt_network/models/bgp_service_community_list_result.rb +94 -0
  14. data/lib/generated/azure_mgmt_network/models/bgp_settings.rb +1 -1
  15. data/lib/generated/azure_mgmt_network/models/bgpcommunity.rb +84 -0
  16. data/lib/generated/azure_mgmt_network/models/connection_reset_shared_key.rb +1 -1
  17. data/lib/generated/azure_mgmt_network/models/express_route_circuit.rb +1 -0
  18. data/lib/generated/azure_mgmt_network/models/express_route_circuit_authorization.rb +1 -0
  19. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering.rb +13 -1
  20. data/lib/generated/azure_mgmt_network/models/patch_route_filter.rb +144 -0
  21. data/lib/generated/azure_mgmt_network/models/patch_route_filter_rule.rb +136 -0
  22. data/lib/generated/azure_mgmt_network/models/public_ipaddress_dns_settings.rb +13 -14
  23. data/lib/generated/azure_mgmt_network/models/route_filter.rb +141 -0
  24. data/lib/generated/azure_mgmt_network/models/route_filter_list_result.rb +94 -0
  25. data/lib/generated/azure_mgmt_network/models/route_filter_rule.rb +146 -0
  26. data/lib/generated/azure_mgmt_network/models/route_filter_rule_list_result.rb +94 -0
  27. data/lib/generated/azure_mgmt_network/network_interfaces.rb +251 -254
  28. data/lib/generated/azure_mgmt_network/network_management_client.rb +60 -53
  29. data/lib/generated/azure_mgmt_network/network_security_groups.rb +11 -14
  30. data/lib/generated/azure_mgmt_network/public_ipaddresses.rb +11 -14
  31. data/lib/generated/azure_mgmt_network/route_filter_rules.rb +773 -0
  32. data/lib/generated/azure_mgmt_network/route_filters.rb +942 -0
  33. data/lib/generated/azure_mgmt_network/route_tables.rb +11 -14
  34. data/lib/generated/azure_mgmt_network/routes.rb +9 -12
  35. data/lib/generated/azure_mgmt_network/security_rules.rb +9 -12
  36. data/lib/generated/azure_mgmt_network/subnets.rb +9 -12
  37. data/lib/generated/azure_mgmt_network/usages.rb +3 -6
  38. data/lib/generated/azure_mgmt_network/version.rb +1 -1
  39. data/lib/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +15 -18
  40. data/lib/generated/azure_mgmt_network/virtual_network_gateways.rb +13 -16
  41. data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +9 -12
  42. data/lib/generated/azure_mgmt_network/virtual_networks.rb +13 -16
  43. metadata +17 -8
  44. data/lib/generated/azure_mgmt_network/models/azure_async_operation_result.rb +0 -64
  45. data/lib/generated/azure_mgmt_network/models/error_details.rb +0 -65
@@ -0,0 +1,942 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Network
7
+ #
8
+ # Composite Swagger for Network Client
9
+ #
10
+ class RouteFilters
11
+ include Azure::ARM::Network::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the RouteFilters class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [NetworkManagementClient] reference to the NetworkManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Deletes the specified route filter.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param route_filter_name [String] The name of the route filter.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ def delete(resource_group_name, route_filter_name, custom_headers = nil)
34
+ response = delete_async(resource_group_name, route_filter_name, custom_headers).value!
35
+ nil
36
+ end
37
+
38
+ #
39
+ # @param resource_group_name [String] The name of the resource group.
40
+ # @param route_filter_name [String] The name of the route filter.
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ # @return [Concurrent::Promise] promise which provides async access to http
45
+ # response.
46
+ #
47
+ def delete_async(resource_group_name, route_filter_name, custom_headers = nil)
48
+ # Send request
49
+ promise = begin_delete_async(resource_group_name, route_filter_name, custom_headers)
50
+
51
+ promise = promise.then do |response|
52
+ # Defining deserialization method.
53
+ deserialize_method = lambda do |parsed_response|
54
+ end
55
+
56
+ # Waiting for response.
57
+ @client.get_long_running_operation_result(response, deserialize_method)
58
+ end
59
+
60
+ promise
61
+ end
62
+
63
+ #
64
+ # Gets the specified route filter.
65
+ #
66
+ # @param resource_group_name [String] The name of the resource group.
67
+ # @param route_filter_name [String] The name of the route filter.
68
+ # @param expand [String] Expands referenced express route bgp peering
69
+ # resources.
70
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
71
+ # will be added to the HTTP request.
72
+ #
73
+ # @return [RouteFilter] operation results.
74
+ #
75
+ def get(resource_group_name, route_filter_name, expand = nil, custom_headers = nil)
76
+ response = get_async(resource_group_name, route_filter_name, expand, custom_headers).value!
77
+ response.body unless response.nil?
78
+ end
79
+
80
+ #
81
+ # Gets the specified route filter.
82
+ #
83
+ # @param resource_group_name [String] The name of the resource group.
84
+ # @param route_filter_name [String] The name of the route filter.
85
+ # @param expand [String] Expands referenced express route bgp peering
86
+ # resources.
87
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
88
+ # will be added to the HTTP request.
89
+ #
90
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
91
+ #
92
+ def get_with_http_info(resource_group_name, route_filter_name, expand = nil, custom_headers = nil)
93
+ get_async(resource_group_name, route_filter_name, expand, custom_headers).value!
94
+ end
95
+
96
+ #
97
+ # Gets the specified route filter.
98
+ #
99
+ # @param resource_group_name [String] The name of the resource group.
100
+ # @param route_filter_name [String] The name of the route filter.
101
+ # @param expand [String] Expands referenced express route bgp peering
102
+ # resources.
103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
104
+ # to the HTTP request.
105
+ #
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def get_async(resource_group_name, route_filter_name, expand = nil, custom_headers = nil)
109
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
110
+ fail ArgumentError, 'route_filter_name is nil' if route_filter_name.nil?
111
+ api_version = '2016-12-01'
112
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
113
+
114
+
115
+ request_headers = {}
116
+
117
+ # Set Headers
118
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
119
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
120
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'
121
+
122
+ request_url = @base_url || @client.base_url
123
+
124
+ options = {
125
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
126
+ path_params: {'resourceGroupName' => resource_group_name,'routeFilterName' => route_filter_name,'subscriptionId' => @client.subscription_id},
127
+ query_params: {'api-version' => api_version,'$expand' => expand},
128
+ headers: request_headers.merge(custom_headers || {}),
129
+ base_url: request_url
130
+ }
131
+ promise = @client.make_request_async(:get, path_template, options)
132
+
133
+ promise = promise.then do |result|
134
+ http_response = result.response
135
+ status_code = http_response.status
136
+ response_content = http_response.body
137
+ unless status_code == 200
138
+ error_model = JSON.load(response_content)
139
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
140
+ end
141
+
142
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
143
+ # Deserialize Response
144
+ if status_code == 200
145
+ begin
146
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
147
+ result_mapper = RouteFilter.mapper()
148
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
149
+ rescue Exception => e
150
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
151
+ end
152
+ end
153
+
154
+ result
155
+ end
156
+
157
+ promise.execute
158
+ end
159
+
160
+ #
161
+ # Creates or updates a route filter in a specified resource group.
162
+ #
163
+ # @param resource_group_name [String] The name of the resource group.
164
+ # @param route_filter_name [String] The name of the route filter.
165
+ # @param route_filter_parameters [RouteFilter] Parameters supplied to the
166
+ # create or update route filter operation.
167
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
168
+ # will be added to the HTTP request.
169
+ #
170
+ # @return [RouteFilter] operation results.
171
+ #
172
+ def create_or_update(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
173
+ response = create_or_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers).value!
174
+ response.body unless response.nil?
175
+ end
176
+
177
+ #
178
+ # @param resource_group_name [String] The name of the resource group.
179
+ # @param route_filter_name [String] The name of the route filter.
180
+ # @param route_filter_parameters [RouteFilter] Parameters supplied to the
181
+ # create or update route filter operation.
182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
183
+ # will be added to the HTTP request.
184
+ #
185
+ # @return [Concurrent::Promise] promise which provides async access to http
186
+ # response.
187
+ #
188
+ def create_or_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
189
+ # Send request
190
+ promise = begin_create_or_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers)
191
+
192
+ promise = promise.then do |response|
193
+ # Defining deserialization method.
194
+ deserialize_method = lambda do |parsed_response|
195
+ result_mapper = RouteFilter.mapper()
196
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
197
+ end
198
+
199
+ # Waiting for response.
200
+ @client.get_long_running_operation_result(response, deserialize_method)
201
+ end
202
+
203
+ promise
204
+ end
205
+
206
+ #
207
+ # Updates a route filter in a specified resource group.
208
+ #
209
+ # @param resource_group_name [String] The name of the resource group.
210
+ # @param route_filter_name [String] The name of the route filter.
211
+ # @param route_filter_parameters [PatchRouteFilter] Parameters supplied to the
212
+ # update route filter operation.
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [RouteFilter] operation results.
217
+ #
218
+ def update(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
219
+ response = update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers).value!
220
+ response.body unless response.nil?
221
+ end
222
+
223
+ #
224
+ # @param resource_group_name [String] The name of the resource group.
225
+ # @param route_filter_name [String] The name of the route filter.
226
+ # @param route_filter_parameters [PatchRouteFilter] Parameters supplied to the
227
+ # update route filter operation.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [Concurrent::Promise] promise which provides async access to http
232
+ # response.
233
+ #
234
+ def update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
235
+ # Send request
236
+ promise = begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers)
237
+
238
+ promise = promise.then do |response|
239
+ # Defining deserialization method.
240
+ deserialize_method = lambda do |parsed_response|
241
+ result_mapper = RouteFilter.mapper()
242
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
243
+ end
244
+
245
+ # Waiting for response.
246
+ @client.get_long_running_operation_result(response, deserialize_method)
247
+ end
248
+
249
+ promise
250
+ end
251
+
252
+ #
253
+ # Gets all route filters in a resource group.
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group.
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [Array<RouteFilter>] operation results.
260
+ #
261
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
262
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
263
+ first_page.get_all_items
264
+ end
265
+
266
+ #
267
+ # Gets all route filters in a resource group.
268
+ #
269
+ # @param resource_group_name [String] The name of the resource group.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
274
+ #
275
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
276
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
277
+ end
278
+
279
+ #
280
+ # Gets all route filters in a resource group.
281
+ #
282
+ # @param resource_group_name [String] The name of the resource group.
283
+ # @param [Hash{String => String}] A hash of custom headers that will be added
284
+ # to the HTTP request.
285
+ #
286
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
287
+ #
288
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
289
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
290
+ api_version = '2016-12-01'
291
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
292
+
293
+
294
+ request_headers = {}
295
+
296
+ # Set Headers
297
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
298
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
299
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'
300
+
301
+ request_url = @base_url || @client.base_url
302
+
303
+ options = {
304
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
305
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
306
+ query_params: {'api-version' => api_version},
307
+ headers: request_headers.merge(custom_headers || {}),
308
+ base_url: request_url
309
+ }
310
+ promise = @client.make_request_async(:get, path_template, options)
311
+
312
+ promise = promise.then do |result|
313
+ http_response = result.response
314
+ status_code = http_response.status
315
+ response_content = http_response.body
316
+ unless status_code == 200
317
+ error_model = JSON.load(response_content)
318
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
319
+ end
320
+
321
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
322
+ # Deserialize Response
323
+ if status_code == 200
324
+ begin
325
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
326
+ result_mapper = RouteFilterListResult.mapper()
327
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
328
+ rescue Exception => e
329
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
330
+ end
331
+ end
332
+
333
+ result
334
+ end
335
+
336
+ promise.execute
337
+ end
338
+
339
+ #
340
+ # Gets all route filters in a subscription.
341
+ #
342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
343
+ # will be added to the HTTP request.
344
+ #
345
+ # @return [Array<RouteFilter>] operation results.
346
+ #
347
+ def list(custom_headers = nil)
348
+ first_page = list_as_lazy(custom_headers)
349
+ first_page.get_all_items
350
+ end
351
+
352
+ #
353
+ # Gets all route filters in a subscription.
354
+ #
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
359
+ #
360
+ def list_with_http_info(custom_headers = nil)
361
+ list_async(custom_headers).value!
362
+ end
363
+
364
+ #
365
+ # Gets all route filters in a subscription.
366
+ #
367
+ # @param [Hash{String => String}] A hash of custom headers that will be added
368
+ # to the HTTP request.
369
+ #
370
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
371
+ #
372
+ def list_async(custom_headers = nil)
373
+ api_version = '2016-12-01'
374
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
375
+
376
+
377
+ request_headers = {}
378
+
379
+ # Set Headers
380
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
381
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
382
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'
383
+
384
+ request_url = @base_url || @client.base_url
385
+
386
+ options = {
387
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
388
+ path_params: {'subscriptionId' => @client.subscription_id},
389
+ query_params: {'api-version' => api_version},
390
+ headers: request_headers.merge(custom_headers || {}),
391
+ base_url: request_url
392
+ }
393
+ promise = @client.make_request_async(:get, path_template, options)
394
+
395
+ promise = promise.then do |result|
396
+ http_response = result.response
397
+ status_code = http_response.status
398
+ response_content = http_response.body
399
+ unless status_code == 200
400
+ error_model = JSON.load(response_content)
401
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
402
+ end
403
+
404
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
405
+ # Deserialize Response
406
+ if status_code == 200
407
+ begin
408
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
409
+ result_mapper = RouteFilterListResult.mapper()
410
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
411
+ rescue Exception => e
412
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
413
+ end
414
+ end
415
+
416
+ result
417
+ end
418
+
419
+ promise.execute
420
+ end
421
+
422
+ #
423
+ # Deletes the specified route filter.
424
+ #
425
+ # @param resource_group_name [String] The name of the resource group.
426
+ # @param route_filter_name [String] The name of the route filter.
427
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
428
+ # will be added to the HTTP request.
429
+ #
430
+ #
431
+ def begin_delete(resource_group_name, route_filter_name, custom_headers = nil)
432
+ response = begin_delete_async(resource_group_name, route_filter_name, custom_headers).value!
433
+ nil
434
+ end
435
+
436
+ #
437
+ # Deletes the specified route filter.
438
+ #
439
+ # @param resource_group_name [String] The name of the resource group.
440
+ # @param route_filter_name [String] The name of the route filter.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
445
+ #
446
+ def begin_delete_with_http_info(resource_group_name, route_filter_name, custom_headers = nil)
447
+ begin_delete_async(resource_group_name, route_filter_name, custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Deletes the specified route filter.
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group.
454
+ # @param route_filter_name [String] The name of the route filter.
455
+ # @param [Hash{String => String}] A hash of custom headers that will be added
456
+ # to the HTTP request.
457
+ #
458
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
459
+ #
460
+ def begin_delete_async(resource_group_name, route_filter_name, custom_headers = nil)
461
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
462
+ fail ArgumentError, 'route_filter_name is nil' if route_filter_name.nil?
463
+ api_version = '2016-12-01'
464
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
465
+
466
+
467
+ request_headers = {}
468
+
469
+ # Set Headers
470
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
471
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
472
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'
473
+
474
+ request_url = @base_url || @client.base_url
475
+
476
+ options = {
477
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
478
+ path_params: {'resourceGroupName' => resource_group_name,'routeFilterName' => route_filter_name,'subscriptionId' => @client.subscription_id},
479
+ query_params: {'api-version' => api_version},
480
+ headers: request_headers.merge(custom_headers || {}),
481
+ base_url: request_url
482
+ }
483
+ promise = @client.make_request_async(:delete, path_template, options)
484
+
485
+ promise = promise.then do |result|
486
+ http_response = result.response
487
+ status_code = http_response.status
488
+ response_content = http_response.body
489
+ unless status_code == 202 || status_code == 200 || status_code == 204
490
+ error_model = JSON.load(response_content)
491
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
492
+ end
493
+
494
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
495
+
496
+ result
497
+ end
498
+
499
+ promise.execute
500
+ end
501
+
502
+ #
503
+ # Creates or updates a route filter in a specified resource group.
504
+ #
505
+ # @param resource_group_name [String] The name of the resource group.
506
+ # @param route_filter_name [String] The name of the route filter.
507
+ # @param route_filter_parameters [RouteFilter] Parameters supplied to the
508
+ # create or update route filter operation.
509
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
510
+ # will be added to the HTTP request.
511
+ #
512
+ # @return [RouteFilter] operation results.
513
+ #
514
+ def begin_create_or_update(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
515
+ response = begin_create_or_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers).value!
516
+ response.body unless response.nil?
517
+ end
518
+
519
+ #
520
+ # Creates or updates a route filter in a specified resource group.
521
+ #
522
+ # @param resource_group_name [String] The name of the resource group.
523
+ # @param route_filter_name [String] The name of the route filter.
524
+ # @param route_filter_parameters [RouteFilter] Parameters supplied to the
525
+ # create or update route filter operation.
526
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
527
+ # will be added to the HTTP request.
528
+ #
529
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
530
+ #
531
+ def begin_create_or_update_with_http_info(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
532
+ begin_create_or_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers).value!
533
+ end
534
+
535
+ #
536
+ # Creates or updates a route filter in a specified resource group.
537
+ #
538
+ # @param resource_group_name [String] The name of the resource group.
539
+ # @param route_filter_name [String] The name of the route filter.
540
+ # @param route_filter_parameters [RouteFilter] Parameters supplied to the
541
+ # create or update route filter operation.
542
+ # @param [Hash{String => String}] A hash of custom headers that will be added
543
+ # to the HTTP request.
544
+ #
545
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
546
+ #
547
+ def begin_create_or_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
548
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
549
+ fail ArgumentError, 'route_filter_name is nil' if route_filter_name.nil?
550
+ fail ArgumentError, 'route_filter_parameters is nil' if route_filter_parameters.nil?
551
+ api_version = '2016-12-01'
552
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
553
+
554
+
555
+ request_headers = {}
556
+
557
+ # Set Headers
558
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
559
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
560
+
561
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
562
+
563
+ # Serialize Request
564
+ request_mapper = RouteFilter.mapper()
565
+ request_content = @client.serialize(request_mapper, route_filter_parameters, 'route_filter_parameters')
566
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
567
+
568
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'
569
+
570
+ request_url = @base_url || @client.base_url
571
+
572
+ options = {
573
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
574
+ path_params: {'resourceGroupName' => resource_group_name,'routeFilterName' => route_filter_name,'subscriptionId' => @client.subscription_id},
575
+ query_params: {'api-version' => api_version},
576
+ body: request_content,
577
+ headers: request_headers.merge(custom_headers || {}),
578
+ base_url: request_url
579
+ }
580
+ promise = @client.make_request_async(:put, path_template, options)
581
+
582
+ promise = promise.then do |result|
583
+ http_response = result.response
584
+ status_code = http_response.status
585
+ response_content = http_response.body
586
+ unless status_code == 200 || status_code == 201
587
+ error_model = JSON.load(response_content)
588
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
589
+ end
590
+
591
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
592
+ # Deserialize Response
593
+ if status_code == 200
594
+ begin
595
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
596
+ result_mapper = RouteFilter.mapper()
597
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
598
+ rescue Exception => e
599
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
600
+ end
601
+ end
602
+ # Deserialize Response
603
+ if status_code == 201
604
+ begin
605
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
606
+ result_mapper = RouteFilter.mapper()
607
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
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
+ # Updates a route filter in a specified resource group.
621
+ #
622
+ # @param resource_group_name [String] The name of the resource group.
623
+ # @param route_filter_name [String] The name of the route filter.
624
+ # @param route_filter_parameters [PatchRouteFilter] Parameters supplied to the
625
+ # update route filter operation.
626
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
627
+ # will be added to the HTTP request.
628
+ #
629
+ # @return [RouteFilter] operation results.
630
+ #
631
+ def begin_update(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
632
+ response = begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers).value!
633
+ response.body unless response.nil?
634
+ end
635
+
636
+ #
637
+ # Updates a route filter in a specified resource group.
638
+ #
639
+ # @param resource_group_name [String] The name of the resource group.
640
+ # @param route_filter_name [String] The name of the route filter.
641
+ # @param route_filter_parameters [PatchRouteFilter] Parameters supplied to the
642
+ # update route filter operation.
643
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
644
+ # will be added to the HTTP request.
645
+ #
646
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
647
+ #
648
+ def begin_update_with_http_info(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
649
+ begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers).value!
650
+ end
651
+
652
+ #
653
+ # Updates a route filter in a specified resource group.
654
+ #
655
+ # @param resource_group_name [String] The name of the resource group.
656
+ # @param route_filter_name [String] The name of the route filter.
657
+ # @param route_filter_parameters [PatchRouteFilter] Parameters supplied to the
658
+ # update route filter operation.
659
+ # @param [Hash{String => String}] A hash of custom headers that will be added
660
+ # to the HTTP request.
661
+ #
662
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
663
+ #
664
+ def begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers = nil)
665
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
666
+ fail ArgumentError, 'route_filter_name is nil' if route_filter_name.nil?
667
+ fail ArgumentError, 'route_filter_parameters is nil' if route_filter_parameters.nil?
668
+ api_version = '2016-12-01'
669
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
670
+
671
+
672
+ request_headers = {}
673
+
674
+ # Set Headers
675
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
676
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
677
+
678
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
679
+
680
+ # Serialize Request
681
+ request_mapper = PatchRouteFilter.mapper()
682
+ request_content = @client.serialize(request_mapper, route_filter_parameters, 'route_filter_parameters')
683
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
684
+
685
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'
686
+
687
+ request_url = @base_url || @client.base_url
688
+
689
+ options = {
690
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
691
+ path_params: {'resourceGroupName' => resource_group_name,'routeFilterName' => route_filter_name,'subscriptionId' => @client.subscription_id},
692
+ query_params: {'api-version' => api_version},
693
+ body: request_content,
694
+ headers: request_headers.merge(custom_headers || {}),
695
+ base_url: request_url
696
+ }
697
+ promise = @client.make_request_async(:patch, path_template, options)
698
+
699
+ promise = promise.then do |result|
700
+ http_response = result.response
701
+ status_code = http_response.status
702
+ response_content = http_response.body
703
+ unless status_code == 200
704
+ error_model = JSON.load(response_content)
705
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
706
+ end
707
+
708
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
709
+ # Deserialize Response
710
+ if status_code == 200
711
+ begin
712
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
713
+ result_mapper = RouteFilter.mapper()
714
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
715
+ rescue Exception => e
716
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
717
+ end
718
+ end
719
+
720
+ result
721
+ end
722
+
723
+ promise.execute
724
+ end
725
+
726
+ #
727
+ # Gets all route filters in a resource group.
728
+ #
729
+ # @param next_page_link [String] The NextLink from the previous successful call
730
+ # to List operation.
731
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
732
+ # will be added to the HTTP request.
733
+ #
734
+ # @return [RouteFilterListResult] operation results.
735
+ #
736
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
737
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
738
+ response.body unless response.nil?
739
+ end
740
+
741
+ #
742
+ # Gets all route filters in a resource group.
743
+ #
744
+ # @param next_page_link [String] The NextLink from the previous successful call
745
+ # to List operation.
746
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
747
+ # will be added to the HTTP request.
748
+ #
749
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
750
+ #
751
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
752
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
753
+ end
754
+
755
+ #
756
+ # Gets all route filters in a resource group.
757
+ #
758
+ # @param next_page_link [String] The NextLink from the previous successful call
759
+ # to List operation.
760
+ # @param [Hash{String => String}] A hash of custom headers that will be added
761
+ # to the HTTP request.
762
+ #
763
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
764
+ #
765
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
766
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
767
+
768
+
769
+ request_headers = {}
770
+
771
+ # Set Headers
772
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
773
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
774
+ path_template = '{nextLink}'
775
+
776
+ request_url = @base_url || @client.base_url
777
+
778
+ options = {
779
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
780
+ skip_encoding_path_params: {'nextLink' => next_page_link},
781
+ headers: request_headers.merge(custom_headers || {}),
782
+ base_url: request_url
783
+ }
784
+ promise = @client.make_request_async(:get, path_template, options)
785
+
786
+ promise = promise.then do |result|
787
+ http_response = result.response
788
+ status_code = http_response.status
789
+ response_content = http_response.body
790
+ unless status_code == 200
791
+ error_model = JSON.load(response_content)
792
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
793
+ end
794
+
795
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
796
+ # Deserialize Response
797
+ if status_code == 200
798
+ begin
799
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
800
+ result_mapper = RouteFilterListResult.mapper()
801
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
802
+ rescue Exception => e
803
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
804
+ end
805
+ end
806
+
807
+ result
808
+ end
809
+
810
+ promise.execute
811
+ end
812
+
813
+ #
814
+ # Gets all route filters in a subscription.
815
+ #
816
+ # @param next_page_link [String] The NextLink from the previous successful call
817
+ # to List operation.
818
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
819
+ # will be added to the HTTP request.
820
+ #
821
+ # @return [RouteFilterListResult] operation results.
822
+ #
823
+ def list_next(next_page_link, custom_headers = nil)
824
+ response = list_next_async(next_page_link, custom_headers).value!
825
+ response.body unless response.nil?
826
+ end
827
+
828
+ #
829
+ # Gets all route filters in a subscription.
830
+ #
831
+ # @param next_page_link [String] The NextLink from the previous successful call
832
+ # to List operation.
833
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
834
+ # will be added to the HTTP request.
835
+ #
836
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
837
+ #
838
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
839
+ list_next_async(next_page_link, custom_headers).value!
840
+ end
841
+
842
+ #
843
+ # Gets all route filters in a subscription.
844
+ #
845
+ # @param next_page_link [String] The NextLink from the previous successful call
846
+ # to List operation.
847
+ # @param [Hash{String => String}] A hash of custom headers that will be added
848
+ # to the HTTP request.
849
+ #
850
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
851
+ #
852
+ def list_next_async(next_page_link, custom_headers = nil)
853
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
854
+
855
+
856
+ request_headers = {}
857
+
858
+ # Set Headers
859
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
860
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
861
+ path_template = '{nextLink}'
862
+
863
+ request_url = @base_url || @client.base_url
864
+
865
+ options = {
866
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
867
+ skip_encoding_path_params: {'nextLink' => next_page_link},
868
+ headers: request_headers.merge(custom_headers || {}),
869
+ base_url: request_url
870
+ }
871
+ promise = @client.make_request_async(:get, path_template, options)
872
+
873
+ promise = promise.then do |result|
874
+ http_response = result.response
875
+ status_code = http_response.status
876
+ response_content = http_response.body
877
+ unless status_code == 200
878
+ error_model = JSON.load(response_content)
879
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
880
+ end
881
+
882
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
883
+ # Deserialize Response
884
+ if status_code == 200
885
+ begin
886
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
887
+ result_mapper = RouteFilterListResult.mapper()
888
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
889
+ rescue Exception => e
890
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
891
+ end
892
+ end
893
+
894
+ result
895
+ end
896
+
897
+ promise.execute
898
+ end
899
+
900
+ #
901
+ # Gets all route filters in a resource group.
902
+ #
903
+ # @param resource_group_name [String] The name of the resource group.
904
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
905
+ # will be added to the HTTP request.
906
+ #
907
+ # @return [RouteFilterListResult] which provide lazy access to pages of the
908
+ # response.
909
+ #
910
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
911
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
912
+ unless response.nil?
913
+ page = response.body
914
+ page.next_method = Proc.new do |next_page_link|
915
+ list_by_resource_group_next_async(next_page_link, custom_headers)
916
+ end
917
+ page
918
+ end
919
+ end
920
+
921
+ #
922
+ # Gets all route filters in a subscription.
923
+ #
924
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
925
+ # will be added to the HTTP request.
926
+ #
927
+ # @return [RouteFilterListResult] which provide lazy access to pages of the
928
+ # response.
929
+ #
930
+ def list_as_lazy(custom_headers = nil)
931
+ response = list_async(custom_headers).value!
932
+ unless response.nil?
933
+ page = response.body
934
+ page.next_method = Proc.new do |next_page_link|
935
+ list_next_async(next_page_link, custom_headers)
936
+ end
937
+ page
938
+ end
939
+ end
940
+
941
+ end
942
+ end