google-cloud-compute-v1 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/compute_pb.rb +577 -1
  3. data/lib/google/cloud/compute/v1/disks/rest/client.rb +1 -1
  4. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +1 -1
  5. data/lib/google/cloud/compute/v1/instances/rest/client.rb +3 -1
  6. data/lib/google/cloud/compute/v1/network_edge_security_services/credentials.rb +52 -0
  7. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +679 -0
  8. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +279 -0
  9. data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +33 -0
  10. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +44 -0
  11. data/lib/google/cloud/compute/v1/network_firewall_policies/credentials.rb +52 -0
  12. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1552 -0
  13. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +778 -0
  14. data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +33 -0
  15. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +44 -0
  16. data/lib/google/cloud/compute/v1/region_network_firewall_policies/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1670 -0
  18. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +823 -0
  19. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +33 -0
  20. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +44 -0
  21. data/lib/google/cloud/compute/v1/region_security_policies/credentials.rb +52 -0
  22. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +676 -0
  23. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +276 -0
  24. data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +33 -0
  25. data/lib/google/cloud/compute/v1/region_security_policies.rb +44 -0
  26. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +87 -0
  27. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +46 -0
  28. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +86 -0
  29. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +50 -0
  30. data/lib/google/cloud/compute/v1/version.rb +1 -1
  31. data/lib/google/cloud/compute/v1.rb +4 -0
  32. data/proto_docs/google/cloud/compute/v1/compute.rb +1562 -65
  33. metadata +22 -2
@@ -0,0 +1,778 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module NetworkFirewallPolicies
26
+ module Rest
27
+ ##
28
+ # REST service stub for the NetworkFirewallPolicies service.
29
+ # service stub contains baseline method implementations
30
+ # including transcoding, making the REST call and deserialing the response
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
39
+ end
40
+
41
+ ##
42
+ # Baseline implementation for the add_association REST call
43
+ #
44
+ # @param request_pb [::Google::Cloud::Compute::V1::AddAssociationNetworkFirewallPolicyRequest]
45
+ # A request object representing the call parameters. Required.
46
+ # @param options [::Gapic::CallOptions]
47
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
48
+ #
49
+ # @yield [result, response] Access the result along with the Faraday response object
50
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
51
+ # @yieldparam response [::Faraday::Response]
52
+ #
53
+ # @return [::Google::Cloud::Compute::V1::Operation]
54
+ # A result object deserialized from the server's reply
55
+ def add_association request_pb, options = nil
56
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
57
+
58
+ uri, body, query_string_params = transcode_add_association_request request_pb
59
+ response = @client_stub.make_post_request(
60
+ uri: uri,
61
+ body: body,
62
+ params: query_string_params,
63
+ options: options
64
+ )
65
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
66
+
67
+ yield result, response if block_given?
68
+ result
69
+ end
70
+
71
+ ##
72
+ # GRPC transcoding helper method for the add_association REST call
73
+ #
74
+ # @param request_pb [::Google::Cloud::Compute::V1::AddAssociationNetworkFirewallPolicyRequest]
75
+ # A request object representing the call parameters. Required.
76
+ # @return [Array(String, [String, nil], Hash{String => String})]
77
+ # Uri, Body, Query string parameters
78
+ def transcode_add_association_request request_pb
79
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/addAssociation"
80
+ body = request_pb.firewall_policy_association_resource.to_json
81
+ query_string_params = {}
82
+ query_string_params["replaceExistingAssociation"] = request_pb.replace_existing_association.to_s if request_pb.has_replace_existing_association?
83
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
84
+
85
+ [uri, body, query_string_params]
86
+ end
87
+
88
+ ##
89
+ # Baseline implementation for the add_rule REST call
90
+ #
91
+ # @param request_pb [::Google::Cloud::Compute::V1::AddRuleNetworkFirewallPolicyRequest]
92
+ # A request object representing the call parameters. Required.
93
+ # @param options [::Gapic::CallOptions]
94
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
95
+ #
96
+ # @yield [result, response] Access the result along with the Faraday response object
97
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
98
+ # @yieldparam response [::Faraday::Response]
99
+ #
100
+ # @return [::Google::Cloud::Compute::V1::Operation]
101
+ # A result object deserialized from the server's reply
102
+ def add_rule request_pb, options = nil
103
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
104
+
105
+ uri, body, query_string_params = transcode_add_rule_request request_pb
106
+ response = @client_stub.make_post_request(
107
+ uri: uri,
108
+ body: body,
109
+ params: query_string_params,
110
+ options: options
111
+ )
112
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
113
+
114
+ yield result, response if block_given?
115
+ result
116
+ end
117
+
118
+ ##
119
+ # GRPC transcoding helper method for the add_rule REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::Compute::V1::AddRuleNetworkFirewallPolicyRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def transcode_add_rule_request request_pb
126
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/addRule"
127
+ body = request_pb.firewall_policy_rule_resource.to_json
128
+ query_string_params = {}
129
+ query_string_params["maxPriority"] = request_pb.max_priority.to_s if request_pb.has_max_priority?
130
+ query_string_params["minPriority"] = request_pb.min_priority.to_s if request_pb.has_min_priority?
131
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
132
+
133
+ [uri, body, query_string_params]
134
+ end
135
+
136
+ ##
137
+ # Baseline implementation for the clone_rules REST call
138
+ #
139
+ # @param request_pb [::Google::Cloud::Compute::V1::CloneRulesNetworkFirewallPolicyRequest]
140
+ # A request object representing the call parameters. Required.
141
+ # @param options [::Gapic::CallOptions]
142
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
143
+ #
144
+ # @yield [result, response] Access the result along with the Faraday response object
145
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
146
+ # @yieldparam response [::Faraday::Response]
147
+ #
148
+ # @return [::Google::Cloud::Compute::V1::Operation]
149
+ # A result object deserialized from the server's reply
150
+ def clone_rules request_pb, options = nil
151
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
152
+
153
+ uri, _body, query_string_params = transcode_clone_rules_request request_pb
154
+ response = @client_stub.make_post_request(
155
+ uri: uri,
156
+ params: query_string_params,
157
+ options: options
158
+ )
159
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
160
+
161
+ yield result, response if block_given?
162
+ result
163
+ end
164
+
165
+ ##
166
+ # GRPC transcoding helper method for the clone_rules REST call
167
+ #
168
+ # @param request_pb [::Google::Cloud::Compute::V1::CloneRulesNetworkFirewallPolicyRequest]
169
+ # A request object representing the call parameters. Required.
170
+ # @return [Array(String, [String, nil], Hash{String => String})]
171
+ # Uri, Body, Query string parameters
172
+ def transcode_clone_rules_request request_pb
173
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/cloneRules"
174
+ body = nil
175
+ query_string_params = {}
176
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
177
+ query_string_params["sourceFirewallPolicy"] = request_pb.source_firewall_policy.to_s if request_pb.has_source_firewall_policy?
178
+
179
+ [uri, body, query_string_params]
180
+ end
181
+
182
+ ##
183
+ # Baseline implementation for the delete REST call
184
+ #
185
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteNetworkFirewallPolicyRequest]
186
+ # A request object representing the call parameters. Required.
187
+ # @param options [::Gapic::CallOptions]
188
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
189
+ #
190
+ # @yield [result, response] Access the result along with the Faraday response object
191
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
192
+ # @yieldparam response [::Faraday::Response]
193
+ #
194
+ # @return [::Google::Cloud::Compute::V1::Operation]
195
+ # A result object deserialized from the server's reply
196
+ def delete request_pb, options = nil
197
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
198
+
199
+ uri, _body, query_string_params = transcode_delete_request request_pb
200
+ response = @client_stub.make_delete_request(
201
+ uri: uri,
202
+ params: query_string_params,
203
+ options: options
204
+ )
205
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
206
+
207
+ yield result, response if block_given?
208
+ result
209
+ end
210
+
211
+ ##
212
+ # GRPC transcoding helper method for the delete REST call
213
+ #
214
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteNetworkFirewallPolicyRequest]
215
+ # A request object representing the call parameters. Required.
216
+ # @return [Array(String, [String, nil], Hash{String => String})]
217
+ # Uri, Body, Query string parameters
218
+ def transcode_delete_request request_pb
219
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}"
220
+ body = nil
221
+ query_string_params = {}
222
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
223
+
224
+ [uri, body, query_string_params]
225
+ end
226
+
227
+ ##
228
+ # Baseline implementation for the get REST call
229
+ #
230
+ # @param request_pb [::Google::Cloud::Compute::V1::GetNetworkFirewallPolicyRequest]
231
+ # A request object representing the call parameters. Required.
232
+ # @param options [::Gapic::CallOptions]
233
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
234
+ #
235
+ # @yield [result, response] Access the result along with the Faraday response object
236
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicy]
237
+ # @yieldparam response [::Faraday::Response]
238
+ #
239
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicy]
240
+ # A result object deserialized from the server's reply
241
+ def get request_pb, options = nil
242
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
243
+
244
+ uri, _body, _query_string_params = transcode_get_request request_pb
245
+ response = @client_stub.make_get_request(
246
+ uri: uri,
247
+ options: options
248
+ )
249
+ result = ::Google::Cloud::Compute::V1::FirewallPolicy.decode_json response.body, ignore_unknown_fields: true
250
+
251
+ yield result, response if block_given?
252
+ result
253
+ end
254
+
255
+ ##
256
+ # GRPC transcoding helper method for the get REST call
257
+ #
258
+ # @param request_pb [::Google::Cloud::Compute::V1::GetNetworkFirewallPolicyRequest]
259
+ # A request object representing the call parameters. Required.
260
+ # @return [Array(String, [String, nil], Hash{String => String})]
261
+ # Uri, Body, Query string parameters
262
+ def transcode_get_request request_pb
263
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}"
264
+ body = nil
265
+ query_string_params = {}
266
+
267
+ [uri, body, query_string_params]
268
+ end
269
+
270
+ ##
271
+ # Baseline implementation for the get_association REST call
272
+ #
273
+ # @param request_pb [::Google::Cloud::Compute::V1::GetAssociationNetworkFirewallPolicyRequest]
274
+ # A request object representing the call parameters. Required.
275
+ # @param options [::Gapic::CallOptions]
276
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
277
+ #
278
+ # @yield [result, response] Access the result along with the Faraday response object
279
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicyAssociation]
280
+ # @yieldparam response [::Faraday::Response]
281
+ #
282
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicyAssociation]
283
+ # A result object deserialized from the server's reply
284
+ def get_association request_pb, options = nil
285
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
286
+
287
+ uri, _body, query_string_params = transcode_get_association_request request_pb
288
+ response = @client_stub.make_get_request(
289
+ uri: uri,
290
+ params: query_string_params,
291
+ options: options
292
+ )
293
+ result = ::Google::Cloud::Compute::V1::FirewallPolicyAssociation.decode_json response.body, ignore_unknown_fields: true
294
+
295
+ yield result, response if block_given?
296
+ result
297
+ end
298
+
299
+ ##
300
+ # GRPC transcoding helper method for the get_association REST call
301
+ #
302
+ # @param request_pb [::Google::Cloud::Compute::V1::GetAssociationNetworkFirewallPolicyRequest]
303
+ # A request object representing the call parameters. Required.
304
+ # @return [Array(String, [String, nil], Hash{String => String})]
305
+ # Uri, Body, Query string parameters
306
+ def transcode_get_association_request request_pb
307
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/getAssociation"
308
+ body = nil
309
+ query_string_params = {}
310
+ query_string_params["name"] = request_pb.name.to_s if request_pb.has_name?
311
+
312
+ [uri, body, query_string_params]
313
+ end
314
+
315
+ ##
316
+ # Baseline implementation for the get_iam_policy REST call
317
+ #
318
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyNetworkFirewallPolicyRequest]
319
+ # A request object representing the call parameters. Required.
320
+ # @param options [::Gapic::CallOptions]
321
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
322
+ #
323
+ # @yield [result, response] Access the result along with the Faraday response object
324
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
325
+ # @yieldparam response [::Faraday::Response]
326
+ #
327
+ # @return [::Google::Cloud::Compute::V1::Policy]
328
+ # A result object deserialized from the server's reply
329
+ def get_iam_policy request_pb, options = nil
330
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
331
+
332
+ uri, _body, query_string_params = transcode_get_iam_policy_request request_pb
333
+ response = @client_stub.make_get_request(
334
+ uri: uri,
335
+ params: query_string_params,
336
+ options: options
337
+ )
338
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
339
+
340
+ yield result, response if block_given?
341
+ result
342
+ end
343
+
344
+ ##
345
+ # GRPC transcoding helper method for the get_iam_policy REST call
346
+ #
347
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyNetworkFirewallPolicyRequest]
348
+ # A request object representing the call parameters. Required.
349
+ # @return [Array(String, [String, nil], Hash{String => String})]
350
+ # Uri, Body, Query string parameters
351
+ def transcode_get_iam_policy_request request_pb
352
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.resource}/getIamPolicy"
353
+ body = nil
354
+ query_string_params = {}
355
+ query_string_params["optionsRequestedPolicyVersion"] = request_pb.options_requested_policy_version.to_s if request_pb.has_options_requested_policy_version?
356
+
357
+ [uri, body, query_string_params]
358
+ end
359
+
360
+ ##
361
+ # Baseline implementation for the get_rule REST call
362
+ #
363
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRuleNetworkFirewallPolicyRequest]
364
+ # A request object representing the call parameters. Required.
365
+ # @param options [::Gapic::CallOptions]
366
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
367
+ #
368
+ # @yield [result, response] Access the result along with the Faraday response object
369
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicyRule]
370
+ # @yieldparam response [::Faraday::Response]
371
+ #
372
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicyRule]
373
+ # A result object deserialized from the server's reply
374
+ def get_rule request_pb, options = nil
375
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
376
+
377
+ uri, _body, query_string_params = transcode_get_rule_request request_pb
378
+ response = @client_stub.make_get_request(
379
+ uri: uri,
380
+ params: query_string_params,
381
+ options: options
382
+ )
383
+ result = ::Google::Cloud::Compute::V1::FirewallPolicyRule.decode_json response.body, ignore_unknown_fields: true
384
+
385
+ yield result, response if block_given?
386
+ result
387
+ end
388
+
389
+ ##
390
+ # GRPC transcoding helper method for the get_rule REST call
391
+ #
392
+ # @param request_pb [::Google::Cloud::Compute::V1::GetRuleNetworkFirewallPolicyRequest]
393
+ # A request object representing the call parameters. Required.
394
+ # @return [Array(String, [String, nil], Hash{String => String})]
395
+ # Uri, Body, Query string parameters
396
+ def transcode_get_rule_request request_pb
397
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/getRule"
398
+ body = nil
399
+ query_string_params = {}
400
+ query_string_params["priority"] = request_pb.priority.to_s if request_pb.has_priority?
401
+
402
+ [uri, body, query_string_params]
403
+ end
404
+
405
+ ##
406
+ # Baseline implementation for the insert REST call
407
+ #
408
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertNetworkFirewallPolicyRequest]
409
+ # A request object representing the call parameters. Required.
410
+ # @param options [::Gapic::CallOptions]
411
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
412
+ #
413
+ # @yield [result, response] Access the result along with the Faraday response object
414
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
415
+ # @yieldparam response [::Faraday::Response]
416
+ #
417
+ # @return [::Google::Cloud::Compute::V1::Operation]
418
+ # A result object deserialized from the server's reply
419
+ def insert request_pb, options = nil
420
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
421
+
422
+ uri, body, query_string_params = transcode_insert_request request_pb
423
+ response = @client_stub.make_post_request(
424
+ uri: uri,
425
+ body: body,
426
+ params: query_string_params,
427
+ options: options
428
+ )
429
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
430
+
431
+ yield result, response if block_given?
432
+ result
433
+ end
434
+
435
+ ##
436
+ # GRPC transcoding helper method for the insert REST call
437
+ #
438
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertNetworkFirewallPolicyRequest]
439
+ # A request object representing the call parameters. Required.
440
+ # @return [Array(String, [String, nil], Hash{String => String})]
441
+ # Uri, Body, Query string parameters
442
+ def transcode_insert_request request_pb
443
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies"
444
+ body = request_pb.firewall_policy_resource.to_json
445
+ query_string_params = {}
446
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
447
+
448
+ [uri, body, query_string_params]
449
+ end
450
+
451
+ ##
452
+ # Baseline implementation for the list REST call
453
+ #
454
+ # @param request_pb [::Google::Cloud::Compute::V1::ListNetworkFirewallPoliciesRequest]
455
+ # A request object representing the call parameters. Required.
456
+ # @param options [::Gapic::CallOptions]
457
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
458
+ #
459
+ # @yield [result, response] Access the result along with the Faraday response object
460
+ # @yieldparam result [::Google::Cloud::Compute::V1::FirewallPolicyList]
461
+ # @yieldparam response [::Faraday::Response]
462
+ #
463
+ # @return [::Google::Cloud::Compute::V1::FirewallPolicyList]
464
+ # A result object deserialized from the server's reply
465
+ def list request_pb, options = nil
466
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
467
+
468
+ uri, _body, query_string_params = transcode_list_request request_pb
469
+ response = @client_stub.make_get_request(
470
+ uri: uri,
471
+ params: query_string_params,
472
+ options: options
473
+ )
474
+ result = ::Google::Cloud::Compute::V1::FirewallPolicyList.decode_json response.body, ignore_unknown_fields: true
475
+
476
+ yield result, response if block_given?
477
+ result
478
+ end
479
+
480
+ ##
481
+ # GRPC transcoding helper method for the list REST call
482
+ #
483
+ # @param request_pb [::Google::Cloud::Compute::V1::ListNetworkFirewallPoliciesRequest]
484
+ # A request object representing the call parameters. Required.
485
+ # @return [Array(String, [String, nil], Hash{String => String})]
486
+ # Uri, Body, Query string parameters
487
+ def transcode_list_request request_pb
488
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies"
489
+ body = nil
490
+ query_string_params = {}
491
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
492
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
493
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
494
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
495
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
496
+
497
+ [uri, body, query_string_params]
498
+ end
499
+
500
+ ##
501
+ # Baseline implementation for the patch REST call
502
+ #
503
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchNetworkFirewallPolicyRequest]
504
+ # A request object representing the call parameters. Required.
505
+ # @param options [::Gapic::CallOptions]
506
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
507
+ #
508
+ # @yield [result, response] Access the result along with the Faraday response object
509
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
510
+ # @yieldparam response [::Faraday::Response]
511
+ #
512
+ # @return [::Google::Cloud::Compute::V1::Operation]
513
+ # A result object deserialized from the server's reply
514
+ def patch request_pb, options = nil
515
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
516
+
517
+ uri, body, query_string_params = transcode_patch_request request_pb
518
+ response = @client_stub.make_patch_request(
519
+ uri: uri,
520
+ body: body,
521
+ params: query_string_params,
522
+ options: options
523
+ )
524
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
525
+
526
+ yield result, response if block_given?
527
+ result
528
+ end
529
+
530
+ ##
531
+ # GRPC transcoding helper method for the patch REST call
532
+ #
533
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchNetworkFirewallPolicyRequest]
534
+ # A request object representing the call parameters. Required.
535
+ # @return [Array(String, [String, nil], Hash{String => String})]
536
+ # Uri, Body, Query string parameters
537
+ def transcode_patch_request request_pb
538
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}"
539
+ body = request_pb.firewall_policy_resource.to_json
540
+ query_string_params = {}
541
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
542
+
543
+ [uri, body, query_string_params]
544
+ end
545
+
546
+ ##
547
+ # Baseline implementation for the patch_rule REST call
548
+ #
549
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchRuleNetworkFirewallPolicyRequest]
550
+ # A request object representing the call parameters. Required.
551
+ # @param options [::Gapic::CallOptions]
552
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
553
+ #
554
+ # @yield [result, response] Access the result along with the Faraday response object
555
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
556
+ # @yieldparam response [::Faraday::Response]
557
+ #
558
+ # @return [::Google::Cloud::Compute::V1::Operation]
559
+ # A result object deserialized from the server's reply
560
+ def patch_rule request_pb, options = nil
561
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
562
+
563
+ uri, body, query_string_params = transcode_patch_rule_request request_pb
564
+ response = @client_stub.make_post_request(
565
+ uri: uri,
566
+ body: body,
567
+ params: query_string_params,
568
+ options: options
569
+ )
570
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
571
+
572
+ yield result, response if block_given?
573
+ result
574
+ end
575
+
576
+ ##
577
+ # GRPC transcoding helper method for the patch_rule REST call
578
+ #
579
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchRuleNetworkFirewallPolicyRequest]
580
+ # A request object representing the call parameters. Required.
581
+ # @return [Array(String, [String, nil], Hash{String => String})]
582
+ # Uri, Body, Query string parameters
583
+ def transcode_patch_rule_request request_pb
584
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/patchRule"
585
+ body = request_pb.firewall_policy_rule_resource.to_json
586
+ query_string_params = {}
587
+ query_string_params["priority"] = request_pb.priority.to_s if request_pb.has_priority?
588
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
589
+
590
+ [uri, body, query_string_params]
591
+ end
592
+
593
+ ##
594
+ # Baseline implementation for the remove_association REST call
595
+ #
596
+ # @param request_pb [::Google::Cloud::Compute::V1::RemoveAssociationNetworkFirewallPolicyRequest]
597
+ # A request object representing the call parameters. Required.
598
+ # @param options [::Gapic::CallOptions]
599
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
600
+ #
601
+ # @yield [result, response] Access the result along with the Faraday response object
602
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
603
+ # @yieldparam response [::Faraday::Response]
604
+ #
605
+ # @return [::Google::Cloud::Compute::V1::Operation]
606
+ # A result object deserialized from the server's reply
607
+ def remove_association request_pb, options = nil
608
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
609
+
610
+ uri, _body, query_string_params = transcode_remove_association_request request_pb
611
+ response = @client_stub.make_post_request(
612
+ uri: uri,
613
+ params: query_string_params,
614
+ options: options
615
+ )
616
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
617
+
618
+ yield result, response if block_given?
619
+ result
620
+ end
621
+
622
+ ##
623
+ # GRPC transcoding helper method for the remove_association REST call
624
+ #
625
+ # @param request_pb [::Google::Cloud::Compute::V1::RemoveAssociationNetworkFirewallPolicyRequest]
626
+ # A request object representing the call parameters. Required.
627
+ # @return [Array(String, [String, nil], Hash{String => String})]
628
+ # Uri, Body, Query string parameters
629
+ def transcode_remove_association_request request_pb
630
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/removeAssociation"
631
+ body = nil
632
+ query_string_params = {}
633
+ query_string_params["name"] = request_pb.name.to_s if request_pb.has_name?
634
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
635
+
636
+ [uri, body, query_string_params]
637
+ end
638
+
639
+ ##
640
+ # Baseline implementation for the remove_rule REST call
641
+ #
642
+ # @param request_pb [::Google::Cloud::Compute::V1::RemoveRuleNetworkFirewallPolicyRequest]
643
+ # A request object representing the call parameters. Required.
644
+ # @param options [::Gapic::CallOptions]
645
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
646
+ #
647
+ # @yield [result, response] Access the result along with the Faraday response object
648
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
649
+ # @yieldparam response [::Faraday::Response]
650
+ #
651
+ # @return [::Google::Cloud::Compute::V1::Operation]
652
+ # A result object deserialized from the server's reply
653
+ def remove_rule request_pb, options = nil
654
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
655
+
656
+ uri, _body, query_string_params = transcode_remove_rule_request request_pb
657
+ response = @client_stub.make_post_request(
658
+ uri: uri,
659
+ params: query_string_params,
660
+ options: options
661
+ )
662
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
663
+
664
+ yield result, response if block_given?
665
+ result
666
+ end
667
+
668
+ ##
669
+ # GRPC transcoding helper method for the remove_rule REST call
670
+ #
671
+ # @param request_pb [::Google::Cloud::Compute::V1::RemoveRuleNetworkFirewallPolicyRequest]
672
+ # A request object representing the call parameters. Required.
673
+ # @return [Array(String, [String, nil], Hash{String => String})]
674
+ # Uri, Body, Query string parameters
675
+ def transcode_remove_rule_request request_pb
676
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.firewall_policy}/removeRule"
677
+ body = nil
678
+ query_string_params = {}
679
+ query_string_params["priority"] = request_pb.priority.to_s if request_pb.has_priority?
680
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
681
+
682
+ [uri, body, query_string_params]
683
+ end
684
+
685
+ ##
686
+ # Baseline implementation for the set_iam_policy REST call
687
+ #
688
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyNetworkFirewallPolicyRequest]
689
+ # A request object representing the call parameters. Required.
690
+ # @param options [::Gapic::CallOptions]
691
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
692
+ #
693
+ # @yield [result, response] Access the result along with the Faraday response object
694
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
695
+ # @yieldparam response [::Faraday::Response]
696
+ #
697
+ # @return [::Google::Cloud::Compute::V1::Policy]
698
+ # A result object deserialized from the server's reply
699
+ def set_iam_policy request_pb, options = nil
700
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
701
+
702
+ uri, body, _query_string_params = transcode_set_iam_policy_request request_pb
703
+ response = @client_stub.make_post_request(
704
+ uri: uri,
705
+ body: body,
706
+ options: options
707
+ )
708
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
709
+
710
+ yield result, response if block_given?
711
+ result
712
+ end
713
+
714
+ ##
715
+ # GRPC transcoding helper method for the set_iam_policy REST call
716
+ #
717
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyNetworkFirewallPolicyRequest]
718
+ # A request object representing the call parameters. Required.
719
+ # @return [Array(String, [String, nil], Hash{String => String})]
720
+ # Uri, Body, Query string parameters
721
+ def transcode_set_iam_policy_request request_pb
722
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.resource}/setIamPolicy"
723
+ body = request_pb.global_set_policy_request_resource.to_json
724
+ query_string_params = {}
725
+
726
+ [uri, body, query_string_params]
727
+ end
728
+
729
+ ##
730
+ # Baseline implementation for the test_iam_permissions REST call
731
+ #
732
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsNetworkFirewallPolicyRequest]
733
+ # A request object representing the call parameters. Required.
734
+ # @param options [::Gapic::CallOptions]
735
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
736
+ #
737
+ # @yield [result, response] Access the result along with the Faraday response object
738
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
739
+ # @yieldparam response [::Faraday::Response]
740
+ #
741
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
742
+ # A result object deserialized from the server's reply
743
+ def test_iam_permissions request_pb, options = nil
744
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
745
+
746
+ uri, body, _query_string_params = transcode_test_iam_permissions_request request_pb
747
+ response = @client_stub.make_post_request(
748
+ uri: uri,
749
+ body: body,
750
+ options: options
751
+ )
752
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
753
+
754
+ yield result, response if block_given?
755
+ result
756
+ end
757
+
758
+ ##
759
+ # GRPC transcoding helper method for the test_iam_permissions REST call
760
+ #
761
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsNetworkFirewallPolicyRequest]
762
+ # A request object representing the call parameters. Required.
763
+ # @return [Array(String, [String, nil], Hash{String => String})]
764
+ # Uri, Body, Query string parameters
765
+ def transcode_test_iam_permissions_request request_pb
766
+ uri = "/compute/v1/projects/#{request_pb.project}/global/firewallPolicies/#{request_pb.resource}/testIamPermissions"
767
+ body = request_pb.test_permissions_request_resource.to_json
768
+ query_string_params = {}
769
+
770
+ [uri, body, query_string_params]
771
+ end
772
+ end
773
+ end
774
+ end
775
+ end
776
+ end
777
+ end
778
+ end