azure_mgmt_network 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-05-01-preview/generated/azure_mgmt_network/network_management_client.rb +1 -1
  3. data/lib/2015-06-15/generated/azure_mgmt_network/network_management_client.rb +1 -1
  4. data/lib/2016-03-30/generated/azure_mgmt_network/network_management_client.rb +1 -1
  5. data/lib/2016-06-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  6. data/lib/2016-09-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  7. data/lib/2016-12-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  8. data/lib/2017-03-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  9. data/lib/2017-03-30/generated/azure_mgmt_network/network_management_client.rb +1 -1
  10. data/lib/2017-09-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  11. data/lib/2017-10-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  12. data/lib/2017-11-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  13. data/lib/2018-01-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  14. data/lib/2018-02-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  15. data/lib/2018-04-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  16. data/lib/2018-06-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  17. data/lib/2018-07-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  18. data/lib/2018-07-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  19. data/lib/2018-08-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  20. data/lib/2018-08-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  21. data/lib/2018-10-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  22. data/lib/2018-10-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  23. data/lib/2018-11-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  24. data/lib/2018-11-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  25. data/lib/2018-12-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  26. data/lib/2018-12-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  27. data/lib/2019-02-01/generated/azure_mgmt_network.rb +93 -93
  28. data/lib/2019-02-01/generated/azure_mgmt_network/models/application_gateway_on_demand_probe.rb +14 -12
  29. data/lib/2019-02-01/generated/azure_mgmt_network/models/public_ipprefix.rb +16 -2
  30. data/lib/2019-02-01/generated/azure_mgmt_network/models/public_ipprefix_sku.rb +1 -1
  31. data/lib/2019-02-01/generated/azure_mgmt_network/models/referenced_public_ip_address.rb +1 -1
  32. data/lib/2019-02-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  33. data/lib/2019-04-01/generated/azure_mgmt_network.rb +120 -120
  34. data/lib/2019-04-01/generated/azure_mgmt_network/models/application_gateway_on_demand_probe.rb +14 -12
  35. data/lib/2019-04-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  36. data/lib/2019-04-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
  37. data/lib/2019-04-01/generated/azure_mgmt_network/service_tags.rb +12 -3
  38. data/lib/2019-06-01/generated/azure_mgmt_network.rb +202 -180
  39. data/lib/2019-06-01/generated/azure_mgmt_network/firewall_policies.rb +918 -0
  40. data/lib/2019-06-01/generated/azure_mgmt_network/firewall_policy_rule_groups.rb +626 -0
  41. data/lib/2019-06-01/generated/azure_mgmt_network/models/application_gateway_on_demand_probe.rb +14 -12
  42. data/lib/2019-06-01/generated/azure_mgmt_network/models/application_rule_condition.rb +164 -0
  43. data/lib/2019-06-01/generated/azure_mgmt_network/models/azure_firewall.rb +38 -0
  44. data/lib/2019-06-01/generated/azure_mgmt_network/models/azure_firewall_public_ipaddress.rb +46 -0
  45. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy.rb +201 -0
  46. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_filter_rule.rb +106 -0
  47. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_filter_rule_action.rb +47 -0
  48. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_filter_rule_action_type.rb +17 -0
  49. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_list_result.rb +99 -0
  50. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_nat_rule.rb +120 -0
  51. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_nat_rule_action.rb +47 -0
  52. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_nat_rule_action_type.rb +16 -0
  53. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule.rb +73 -0
  54. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition.rb +69 -0
  55. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition_application_protocol.rb +64 -0
  56. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition_application_protocol_type.rb +16 -0
  57. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition_network_protocol.rb +18 -0
  58. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_group.rb +129 -0
  59. data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_group_list_result.rb +99 -0
  60. data/lib/2019-06-01/generated/azure_mgmt_network/models/hub_ipaddresses.rb +67 -0
  61. data/lib/2019-06-01/generated/azure_mgmt_network/models/network_rule_condition.rb +144 -0
  62. data/lib/2019-06-01/generated/azure_mgmt_network/models/private_endpoint.rb +5 -5
  63. data/lib/2019-06-01/generated/azure_mgmt_network/models/private_endpoint_connection.rb +38 -0
  64. data/lib/2019-06-01/generated/azure_mgmt_network/models/private_link_service.rb +5 -5
  65. data/lib/2019-06-01/generated/azure_mgmt_network/models/private_link_service_connection.rb +38 -0
  66. data/lib/2019-06-01/generated/azure_mgmt_network/models/private_link_service_ip_configuration.rb +42 -9
  67. data/lib/2019-06-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
  68. data/lib/2019-06-01/generated/azure_mgmt_network/models/unprepare_network_policies_request.rb +47 -0
  69. data/lib/2019-06-01/generated/azure_mgmt_network/network_management_client.rb +19 -11
  70. data/lib/2019-06-01/generated/azure_mgmt_network/service_tags.rb +12 -3
  71. data/lib/2019-06-01/generated/azure_mgmt_network/subnets.rb +150 -0
  72. data/lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +1 -1
  73. data/lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb +1 -1
  74. data/lib/profiles/latest/modules/network_profile_module.rb +638 -554
  75. data/lib/version.rb +1 -1
  76. metadata +24 -2
@@ -0,0 +1,626 @@
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::Network::Mgmt::V2019_06_01
7
+ #
8
+ # FirewallPolicyRuleGroups
9
+ #
10
+ class FirewallPolicyRuleGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the FirewallPolicyRuleGroups class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [NetworkManagementClient] reference to the NetworkManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Deletes the specified FirewallPolicyRuleGroup.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
29
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
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, firewall_policy_name, rule_group_name, custom_headers:nil)
34
+ response = delete_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:custom_headers).value!
35
+ nil
36
+ end
37
+
38
+ #
39
+ # @param resource_group_name [String] The name of the resource group.
40
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
41
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [Concurrent::Promise] promise which provides async access to http
46
+ # response.
47
+ #
48
+ def delete_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
49
+ # Send request
50
+ promise = begin_delete_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:custom_headers)
51
+
52
+ promise = promise.then do |response|
53
+ # Defining deserialization method.
54
+ deserialize_method = lambda do |parsed_response|
55
+ end
56
+
57
+ # Waiting for response.
58
+ @client.get_long_running_operation_result(response, deserialize_method)
59
+ end
60
+
61
+ promise
62
+ end
63
+
64
+ #
65
+ # Gets the specified FirewallPolicyRuleGroup.
66
+ #
67
+ # @param resource_group_name [String] The name of the resource group.
68
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
69
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
70
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
71
+ # will be added to the HTTP request.
72
+ #
73
+ # @return [FirewallPolicyRuleGroup] operation results.
74
+ #
75
+ def get(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
76
+ response = get_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:custom_headers).value!
77
+ response.body unless response.nil?
78
+ end
79
+
80
+ #
81
+ # Gets the specified FirewallPolicyRuleGroup.
82
+ #
83
+ # @param resource_group_name [String] The name of the resource group.
84
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
85
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
86
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
87
+ # will be added to the HTTP request.
88
+ #
89
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
90
+ #
91
+ def get_with_http_info(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
92
+ get_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:custom_headers).value!
93
+ end
94
+
95
+ #
96
+ # Gets the specified FirewallPolicyRuleGroup.
97
+ #
98
+ # @param resource_group_name [String] The name of the resource group.
99
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
100
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
101
+ # @param [Hash{String => String}] A hash of custom headers that will be added
102
+ # to the HTTP request.
103
+ #
104
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
105
+ #
106
+ def get_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
107
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
108
+ fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
109
+ fail ArgumentError, 'rule_group_name is nil' if rule_group_name.nil?
110
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
111
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
112
+
113
+
114
+ request_headers = {}
115
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
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/firewallPolicies/{firewallPolicyName}/ruleGroups/{ruleGroupName}'
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,'firewallPolicyName' => firewall_policy_name,'ruleGroupName' => rule_group_name,'subscriptionId' => @client.subscription_id},
127
+ query_params: {'api-version' => @client.api_version},
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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
144
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
145
+ # Deserialize Response
146
+ if status_code == 200
147
+ begin
148
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
149
+ result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroup.mapper()
150
+ result.body = @client.deserialize(result_mapper, parsed_response)
151
+ rescue Exception => e
152
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
153
+ end
154
+ end
155
+
156
+ result
157
+ end
158
+
159
+ promise.execute
160
+ end
161
+
162
+ #
163
+ # Creates or updates the specified FirewallPolicyRuleGroup.
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group.
166
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
167
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
168
+ # @param parameters [FirewallPolicyRuleGroup] Parameters supplied to the create
169
+ # or update FirewallPolicyRuleGroup operation.
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [FirewallPolicyRuleGroup] operation results.
174
+ #
175
+ def create_or_update(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:nil)
176
+ response = create_or_update_async(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:custom_headers).value!
177
+ response.body unless response.nil?
178
+ end
179
+
180
+ #
181
+ # @param resource_group_name [String] The name of the resource group.
182
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
183
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
184
+ # @param parameters [FirewallPolicyRuleGroup] Parameters supplied to the create
185
+ # or update FirewallPolicyRuleGroup operation.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] promise which provides async access to http
190
+ # response.
191
+ #
192
+ def create_or_update_async(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:nil)
193
+ # Send request
194
+ promise = begin_create_or_update_async(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:custom_headers)
195
+
196
+ promise = promise.then do |response|
197
+ # Defining deserialization method.
198
+ deserialize_method = lambda do |parsed_response|
199
+ result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroup.mapper()
200
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
201
+ end
202
+
203
+ # Waiting for response.
204
+ @client.get_long_running_operation_result(response, deserialize_method)
205
+ end
206
+
207
+ promise
208
+ end
209
+
210
+ #
211
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
212
+ #
213
+ # @param resource_group_name [String] The name of the resource group.
214
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
+ # will be added to the HTTP request.
217
+ #
218
+ # @return [Array<FirewallPolicyRuleGroup>] operation results.
219
+ #
220
+ def list(resource_group_name, firewall_policy_name, custom_headers:nil)
221
+ first_page = list_as_lazy(resource_group_name, firewall_policy_name, custom_headers:custom_headers)
222
+ first_page.get_all_items
223
+ end
224
+
225
+ #
226
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
227
+ #
228
+ # @param resource_group_name [String] The name of the resource group.
229
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
234
+ #
235
+ def list_with_http_info(resource_group_name, firewall_policy_name, custom_headers:nil)
236
+ list_async(resource_group_name, firewall_policy_name, custom_headers:custom_headers).value!
237
+ end
238
+
239
+ #
240
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
241
+ #
242
+ # @param resource_group_name [String] The name of the resource group.
243
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
244
+ # @param [Hash{String => String}] A hash of custom headers that will be added
245
+ # to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
248
+ #
249
+ def list_async(resource_group_name, firewall_policy_name, custom_headers:nil)
250
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
251
+ fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
252
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
253
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
254
+
255
+
256
+ request_headers = {}
257
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
258
+
259
+ # Set Headers
260
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
261
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
262
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleGroups'
263
+
264
+ request_url = @base_url || @client.base_url
265
+
266
+ options = {
267
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
268
+ path_params: {'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name,'subscriptionId' => @client.subscription_id},
269
+ query_params: {'api-version' => @client.api_version},
270
+ headers: request_headers.merge(custom_headers || {}),
271
+ base_url: request_url
272
+ }
273
+ promise = @client.make_request_async(:get, path_template, options)
274
+
275
+ promise = promise.then do |result|
276
+ http_response = result.response
277
+ status_code = http_response.status
278
+ response_content = http_response.body
279
+ unless status_code == 200
280
+ error_model = JSON.load(response_content)
281
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
282
+ end
283
+
284
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
285
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
286
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
287
+ # Deserialize Response
288
+ if status_code == 200
289
+ begin
290
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
291
+ result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroupListResult.mapper()
292
+ result.body = @client.deserialize(result_mapper, parsed_response)
293
+ rescue Exception => e
294
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
295
+ end
296
+ end
297
+
298
+ result
299
+ end
300
+
301
+ promise.execute
302
+ end
303
+
304
+ #
305
+ # Deletes the specified FirewallPolicyRuleGroup.
306
+ #
307
+ # @param resource_group_name [String] The name of the resource group.
308
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
309
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ #
314
+ def begin_delete(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
315
+ response = begin_delete_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:custom_headers).value!
316
+ nil
317
+ end
318
+
319
+ #
320
+ # Deletes the specified FirewallPolicyRuleGroup.
321
+ #
322
+ # @param resource_group_name [String] The name of the resource group.
323
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
324
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
+ # will be added to the HTTP request.
327
+ #
328
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
329
+ #
330
+ def begin_delete_with_http_info(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
331
+ begin_delete_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:custom_headers).value!
332
+ end
333
+
334
+ #
335
+ # Deletes the specified FirewallPolicyRuleGroup.
336
+ #
337
+ # @param resource_group_name [String] The name of the resource group.
338
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
339
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
340
+ # @param [Hash{String => String}] A hash of custom headers that will be added
341
+ # to the HTTP request.
342
+ #
343
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
344
+ #
345
+ def begin_delete_async(resource_group_name, firewall_policy_name, rule_group_name, custom_headers:nil)
346
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
347
+ fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
348
+ fail ArgumentError, 'rule_group_name is nil' if rule_group_name.nil?
349
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
350
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
351
+
352
+
353
+ request_headers = {}
354
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
355
+
356
+ # Set Headers
357
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
358
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
359
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleGroups/{ruleGroupName}'
360
+
361
+ request_url = @base_url || @client.base_url
362
+
363
+ options = {
364
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
365
+ path_params: {'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name,'ruleGroupName' => rule_group_name,'subscriptionId' => @client.subscription_id},
366
+ query_params: {'api-version' => @client.api_version},
367
+ headers: request_headers.merge(custom_headers || {}),
368
+ base_url: request_url
369
+ }
370
+ promise = @client.make_request_async(:delete, path_template, options)
371
+
372
+ promise = promise.then do |result|
373
+ http_response = result.response
374
+ status_code = http_response.status
375
+ response_content = http_response.body
376
+ unless status_code == 202 || status_code == 204 || status_code == 200
377
+ error_model = JSON.load(response_content)
378
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
379
+ end
380
+
381
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
382
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
383
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
384
+
385
+ result
386
+ end
387
+
388
+ promise.execute
389
+ end
390
+
391
+ #
392
+ # Creates or updates the specified FirewallPolicyRuleGroup.
393
+ #
394
+ # @param resource_group_name [String] The name of the resource group.
395
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
396
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
397
+ # @param parameters [FirewallPolicyRuleGroup] Parameters supplied to the create
398
+ # or update FirewallPolicyRuleGroup operation.
399
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
400
+ # will be added to the HTTP request.
401
+ #
402
+ # @return [FirewallPolicyRuleGroup] operation results.
403
+ #
404
+ def begin_create_or_update(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:nil)
405
+ response = begin_create_or_update_async(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:custom_headers).value!
406
+ response.body unless response.nil?
407
+ end
408
+
409
+ #
410
+ # Creates or updates the specified FirewallPolicyRuleGroup.
411
+ #
412
+ # @param resource_group_name [String] The name of the resource group.
413
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
414
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
415
+ # @param parameters [FirewallPolicyRuleGroup] Parameters supplied to the create
416
+ # or update FirewallPolicyRuleGroup operation.
417
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
418
+ # will be added to the HTTP request.
419
+ #
420
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
421
+ #
422
+ def begin_create_or_update_with_http_info(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:nil)
423
+ begin_create_or_update_async(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:custom_headers).value!
424
+ end
425
+
426
+ #
427
+ # Creates or updates the specified FirewallPolicyRuleGroup.
428
+ #
429
+ # @param resource_group_name [String] The name of the resource group.
430
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
431
+ # @param rule_group_name [String] The name of the FirewallPolicyRuleGroup.
432
+ # @param parameters [FirewallPolicyRuleGroup] Parameters supplied to the create
433
+ # or update FirewallPolicyRuleGroup operation.
434
+ # @param [Hash{String => String}] A hash of custom headers that will be added
435
+ # to the HTTP request.
436
+ #
437
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
438
+ #
439
+ def begin_create_or_update_async(resource_group_name, firewall_policy_name, rule_group_name, parameters, custom_headers:nil)
440
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
441
+ fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
442
+ fail ArgumentError, 'rule_group_name is nil' if rule_group_name.nil?
443
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
444
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
445
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
446
+
447
+
448
+ request_headers = {}
449
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
450
+
451
+ # Set Headers
452
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
453
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
454
+
455
+ # Serialize Request
456
+ request_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroup.mapper()
457
+ request_content = @client.serialize(request_mapper, parameters)
458
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
459
+
460
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleGroups/{ruleGroupName}'
461
+
462
+ request_url = @base_url || @client.base_url
463
+
464
+ options = {
465
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
466
+ path_params: {'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name,'ruleGroupName' => rule_group_name,'subscriptionId' => @client.subscription_id},
467
+ query_params: {'api-version' => @client.api_version},
468
+ body: request_content,
469
+ headers: request_headers.merge(custom_headers || {}),
470
+ base_url: request_url
471
+ }
472
+ promise = @client.make_request_async(:put, path_template, options)
473
+
474
+ promise = promise.then do |result|
475
+ http_response = result.response
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 201 || status_code == 200
479
+ error_model = JSON.load(response_content)
480
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
481
+ end
482
+
483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
485
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
486
+ # Deserialize Response
487
+ if status_code == 201
488
+ begin
489
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
490
+ result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroup.mapper()
491
+ result.body = @client.deserialize(result_mapper, parsed_response)
492
+ rescue Exception => e
493
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
494
+ end
495
+ end
496
+ # Deserialize Response
497
+ if status_code == 200
498
+ begin
499
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
500
+ result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroup.mapper()
501
+ result.body = @client.deserialize(result_mapper, parsed_response)
502
+ rescue Exception => e
503
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
504
+ end
505
+ end
506
+
507
+ result
508
+ end
509
+
510
+ promise.execute
511
+ end
512
+
513
+ #
514
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
515
+ #
516
+ # @param next_page_link [String] The NextLink from the previous successful call
517
+ # to List operation.
518
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
519
+ # will be added to the HTTP request.
520
+ #
521
+ # @return [FirewallPolicyRuleGroupListResult] operation results.
522
+ #
523
+ def list_next(next_page_link, custom_headers:nil)
524
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
525
+ response.body unless response.nil?
526
+ end
527
+
528
+ #
529
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
530
+ #
531
+ # @param next_page_link [String] The NextLink from the previous successful call
532
+ # to List operation.
533
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
534
+ # will be added to the HTTP request.
535
+ #
536
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
537
+ #
538
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
539
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
540
+ end
541
+
542
+ #
543
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
544
+ #
545
+ # @param next_page_link [String] The NextLink from the previous successful call
546
+ # to List operation.
547
+ # @param [Hash{String => String}] A hash of custom headers that will be added
548
+ # to the HTTP request.
549
+ #
550
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
551
+ #
552
+ def list_next_async(next_page_link, custom_headers:nil)
553
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
554
+
555
+
556
+ request_headers = {}
557
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
558
+
559
+ # Set Headers
560
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
561
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
562
+ path_template = '{nextLink}'
563
+
564
+ request_url = @base_url || @client.base_url
565
+
566
+ options = {
567
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
568
+ skip_encoding_path_params: {'nextLink' => next_page_link},
569
+ headers: request_headers.merge(custom_headers || {}),
570
+ base_url: request_url
571
+ }
572
+ promise = @client.make_request_async(:get, path_template, options)
573
+
574
+ promise = promise.then do |result|
575
+ http_response = result.response
576
+ status_code = http_response.status
577
+ response_content = http_response.body
578
+ unless status_code == 200
579
+ error_model = JSON.load(response_content)
580
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
581
+ end
582
+
583
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
584
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
585
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
586
+ # Deserialize Response
587
+ if status_code == 200
588
+ begin
589
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
590
+ result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyRuleGroupListResult.mapper()
591
+ result.body = @client.deserialize(result_mapper, parsed_response)
592
+ rescue Exception => e
593
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
594
+ end
595
+ end
596
+
597
+ result
598
+ end
599
+
600
+ promise.execute
601
+ end
602
+
603
+ #
604
+ # Lists all FirewallPolicyRuleGroups in a FirewallPolicy resource.
605
+ #
606
+ # @param resource_group_name [String] The name of the resource group.
607
+ # @param firewall_policy_name [String] The name of the Firewall Policy.
608
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
609
+ # will be added to the HTTP request.
610
+ #
611
+ # @return [FirewallPolicyRuleGroupListResult] which provide lazy access to
612
+ # pages of the response.
613
+ #
614
+ def list_as_lazy(resource_group_name, firewall_policy_name, custom_headers:nil)
615
+ response = list_async(resource_group_name, firewall_policy_name, custom_headers:custom_headers).value!
616
+ unless response.nil?
617
+ page = response.body
618
+ page.next_method = Proc.new do |next_page_link|
619
+ list_next_async(next_page_link, custom_headers:custom_headers)
620
+ end
621
+ page
622
+ end
623
+ end
624
+
625
+ end
626
+ end