google-cloud-compute-v1 1.0.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
  4. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +37 -8
  5. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +59 -14
  6. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +158 -19
  7. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +46 -0
  8. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +169 -23
  9. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +46 -0
  10. data/lib/google/cloud/compute/v1/compute_pb.rb +1117 -9
  11. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +2 -2
  12. data/lib/google/cloud/compute/v1/disks/rest/client.rb +94 -25
  13. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +44 -10
  14. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +98 -31
  15. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +1 -1
  16. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +54 -13
  17. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +70 -17
  18. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
  19. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +64 -16
  20. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +55 -14
  21. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
  22. data/lib/google/cloud/compute/v1/global_operations/rest/nonstandard_lro.rb +68 -0
  23. data/lib/google/cloud/compute/v1/global_operations.rb +1 -0
  24. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  25. data/lib/google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro.rb +68 -0
  26. data/lib/google/cloud/compute/v1/global_organization_operations.rb +1 -0
  27. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +47 -13
  28. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +55 -14
  29. data/lib/google/cloud/compute/v1/images/rest/client.rb +64 -16
  30. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +172 -47
  31. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +71 -18
  32. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
  33. data/lib/google/cloud/compute/v1/instances/rest/client.rb +524 -97
  34. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +91 -0
  35. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +48 -11
  36. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  37. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +44 -10
  38. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
  39. data/lib/google/cloud/compute/v1/machine_images/credentials.rb +52 -0
  40. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +804 -0
  41. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +363 -0
  42. data/lib/google/cloud/compute/v1/machine_images/rest.rb +33 -0
  43. data/lib/google/cloud/compute/v1/machine_images.rb +44 -0
  44. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +2 -2
  45. data/lib/google/cloud/compute/v1/network_edge_security_services/credentials.rb +52 -0
  46. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +679 -0
  47. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +279 -0
  48. data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +33 -0
  49. data/lib/google/cloud/compute/v1/network_edge_security_services.rb +44 -0
  50. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +60 -15
  51. data/lib/google/cloud/compute/v1/network_firewall_policies/credentials.rb +52 -0
  52. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1552 -0
  53. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +778 -0
  54. data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +33 -0
  55. data/lib/google/cloud/compute/v1/network_firewall_policies.rb +44 -0
  56. data/lib/google/cloud/compute/v1/networks/rest/client.rb +85 -23
  57. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +82 -21
  58. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +37 -8
  59. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +2 -2
  60. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +48 -11
  61. data/lib/google/cloud/compute/v1/projects/rest/client.rb +107 -31
  62. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +47 -13
  63. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +51 -14
  64. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +58 -13
  65. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +58 -13
  66. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +116 -5
  67. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +48 -0
  68. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  69. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +92 -23
  70. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +47 -10
  71. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +58 -13
  72. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +171 -46
  73. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +26 -5
  74. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +24 -3
  75. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +36 -7
  76. data/lib/google/cloud/compute/v1/region_network_firewall_policies/credentials.rb +52 -0
  77. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1670 -0
  78. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +823 -0
  79. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +33 -0
  80. data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +44 -0
  81. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +38 -9
  82. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  83. data/lib/google/cloud/compute/v1/region_operations/rest/nonstandard_lro.rb +68 -0
  84. data/lib/google/cloud/compute/v1/region_operations.rb +1 -0
  85. data/lib/google/cloud/compute/v1/region_security_policies/credentials.rb +52 -0
  86. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +676 -0
  87. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +276 -0
  88. data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +33 -0
  89. data/lib/google/cloud/compute/v1/region_security_policies.rb +44 -0
  90. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +38 -9
  91. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +47 -10
  92. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +149 -17
  93. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +46 -0
  94. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +58 -13
  95. data/lib/google/cloud/compute/v1/regions/rest/client.rb +3 -3
  96. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +138 -11
  97. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +48 -0
  98. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +37 -8
  99. data/lib/google/cloud/compute/v1/routers/rest/client.rb +60 -15
  100. data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
  101. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +161 -20
  102. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +50 -0
  103. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +51 -14
  104. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +116 -7
  105. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +46 -0
  106. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +37 -10
  107. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +45 -11
  108. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +71 -18
  109. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +47 -13
  110. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +56 -15
  111. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +86 -24
  112. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +37 -8
  113. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +92 -23
  114. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +74 -19
  115. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +54 -13
  116. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +37 -8
  117. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +65 -17
  118. data/lib/google/cloud/compute/v1/version.rb +1 -1
  119. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +48 -11
  120. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +37 -8
  121. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  122. data/lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb +68 -0
  123. data/lib/google/cloud/compute/v1/zone_operations.rb +1 -0
  124. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  125. data/lib/google/cloud/compute/v1.rb +7 -0
  126. data/proto_docs/google/cloud/compute/v1/compute.rb +3236 -422
  127. metadata +32 -3
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/compute/v1/compute_pb"
21
21
  require "google/cloud/compute/v1/backend_buckets/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
22
23
 
23
24
  module Google
24
25
  module Cloud
@@ -84,6 +85,8 @@ module Google
84
85
 
85
86
  default_config.rpcs.patch.timeout = 600.0
86
87
 
88
+ default_config.rpcs.set_edge_security_policy.timeout = 600.0
89
+
87
90
  default_config.rpcs.update.timeout = 600.0
88
91
 
89
92
  default_config
@@ -142,9 +145,21 @@ module Google
142
145
  credentials = Credentials.new credentials, scope: @config.scope
143
146
  end
144
147
 
148
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
149
+ config.credentials = credentials
150
+ config.endpoint = @config.endpoint
151
+ end
152
+
145
153
  @backend_buckets_stub = ::Google::Cloud::Compute::V1::BackendBuckets::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
154
  end
147
155
 
156
+ ##
157
+ # Get the associated client for long-running operations via GlobalOperations.
158
+ #
159
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
160
+ #
161
+ attr_reader :global_operations
162
+
148
163
  # Service calls
149
164
 
150
165
  ##
@@ -176,10 +191,10 @@ module Google
176
191
  # @param signed_url_key_resource [::Google::Cloud::Compute::V1::SignedUrlKey, ::Hash]
177
192
  # The body resource for this request
178
193
  # @yield [result, response] Access the result along with the Faraday response object
179
- # @yieldparam result [::Gapic::Rest::BaseOperation]
194
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
180
195
  # @yieldparam response [::Faraday::Response]
181
196
  #
182
- # @return [::Gapic::Rest::BaseOperation]
197
+ # @return [::Gapic::GenericLRO::Operation]
183
198
  #
184
199
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
185
200
  def add_signed_url_key request, options = nil
@@ -206,7 +221,14 @@ module Google
206
221
  metadata: @config.metadata
207
222
 
208
223
  @backend_buckets_stub.add_signed_url_key request, options do |result, response|
209
- result = ::Gapic::Rest::BaseOperation.new result
224
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
225
+ operation: result,
226
+ client: global_operations,
227
+ request_values: {
228
+ "project" => request.project
229
+ },
230
+ options: options
231
+ )
210
232
  yield result, response if block_given?
211
233
  return result
212
234
  end
@@ -242,10 +264,10 @@ module Google
242
264
  # @param request_id [::String]
243
265
  # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
244
266
  # @yield [result, response] Access the result along with the Faraday response object
245
- # @yieldparam result [::Gapic::Rest::BaseOperation]
267
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
246
268
  # @yieldparam response [::Faraday::Response]
247
269
  #
248
- # @return [::Gapic::Rest::BaseOperation]
270
+ # @return [::Gapic::GenericLRO::Operation]
249
271
  #
250
272
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
251
273
  def delete request, options = nil
@@ -272,7 +294,14 @@ module Google
272
294
  metadata: @config.metadata
273
295
 
274
296
  @backend_buckets_stub.delete request, options do |result, response|
275
- result = ::Gapic::Rest::BaseOperation.new result
297
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
298
+ operation: result,
299
+ client: global_operations,
300
+ request_values: {
301
+ "project" => request.project
302
+ },
303
+ options: options
304
+ )
276
305
  yield result, response if block_given?
277
306
  return result
278
307
  end
@@ -310,10 +339,10 @@ module Google
310
339
  # @param request_id [::String]
311
340
  # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
312
341
  # @yield [result, response] Access the result along with the Faraday response object
313
- # @yieldparam result [::Gapic::Rest::BaseOperation]
342
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
314
343
  # @yieldparam response [::Faraday::Response]
315
344
  #
316
- # @return [::Gapic::Rest::BaseOperation]
345
+ # @return [::Gapic::GenericLRO::Operation]
317
346
  #
318
347
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
319
348
  def delete_signed_url_key request, options = nil
@@ -340,7 +369,14 @@ module Google
340
369
  metadata: @config.metadata
341
370
 
342
371
  @backend_buckets_stub.delete_signed_url_key request, options do |result, response|
343
- result = ::Gapic::Rest::BaseOperation.new result
372
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
373
+ operation: result,
374
+ client: global_operations,
375
+ request_values: {
376
+ "project" => request.project
377
+ },
378
+ options: options
379
+ )
344
380
  yield result, response if block_given?
345
381
  return result
346
382
  end
@@ -439,10 +475,10 @@ module Google
439
475
  # @param request_id [::String]
440
476
  # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
441
477
  # @yield [result, response] Access the result along with the Faraday response object
442
- # @yieldparam result [::Gapic::Rest::BaseOperation]
478
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
443
479
  # @yieldparam response [::Faraday::Response]
444
480
  #
445
- # @return [::Gapic::Rest::BaseOperation]
481
+ # @return [::Gapic::GenericLRO::Operation]
446
482
  #
447
483
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
448
484
  def insert request, options = nil
@@ -469,7 +505,14 @@ module Google
469
505
  metadata: @config.metadata
470
506
 
471
507
  @backend_buckets_stub.insert request, options do |result, response|
472
- result = ::Gapic::Rest::BaseOperation.new result
508
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
509
+ operation: result,
510
+ client: global_operations,
511
+ request_values: {
512
+ "project" => request.project
513
+ },
514
+ options: options
515
+ )
473
516
  yield result, response if block_given?
474
517
  return result
475
518
  end
@@ -499,7 +542,7 @@ module Google
499
542
  # the default parameter values, pass an empty Hash as a request object (see above).
500
543
  #
501
544
  # @param filter [::String]
502
- # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
545
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
503
546
  # @param max_results [::Integer]
504
547
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
505
548
  # @param order_by [::String]
@@ -579,10 +622,10 @@ module Google
579
622
  # @param request_id [::String]
580
623
  # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
581
624
  # @yield [result, response] Access the result along with the Faraday response object
582
- # @yieldparam result [::Gapic::Rest::BaseOperation]
625
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
583
626
  # @yieldparam response [::Faraday::Response]
584
627
  #
585
- # @return [::Gapic::Rest::BaseOperation]
628
+ # @return [::Gapic::GenericLRO::Operation]
586
629
  #
587
630
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
588
631
  def patch request, options = nil
@@ -609,7 +652,89 @@ module Google
609
652
  metadata: @config.metadata
610
653
 
611
654
  @backend_buckets_stub.patch request, options do |result, response|
612
- result = ::Gapic::Rest::BaseOperation.new result
655
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
656
+ operation: result,
657
+ client: global_operations,
658
+ request_values: {
659
+ "project" => request.project
660
+ },
661
+ options: options
662
+ )
663
+ yield result, response if block_given?
664
+ return result
665
+ end
666
+ rescue ::Faraday::Error => e
667
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
668
+ raise ::Google::Cloud::Error.from_error(gapic_error)
669
+ end
670
+
671
+ ##
672
+ # Sets the edge security policy for the specified backend bucket.
673
+ #
674
+ # @overload set_edge_security_policy(request, options = nil)
675
+ # Pass arguments to `set_edge_security_policy` via a request object, either of type
676
+ # {::Google::Cloud::Compute::V1::SetEdgeSecurityPolicyBackendBucketRequest} or an equivalent Hash.
677
+ #
678
+ # @param request [::Google::Cloud::Compute::V1::SetEdgeSecurityPolicyBackendBucketRequest, ::Hash]
679
+ # A request object representing the call parameters. Required. To specify no
680
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
681
+ # @param options [::Gapic::CallOptions, ::Hash]
682
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
683
+ # Note: currently retry functionality is not implemented. While it is possible
684
+ # to set it using ::Gapic::CallOptions, it will not be applied
685
+ #
686
+ # @overload set_edge_security_policy(backend_bucket: nil, project: nil, request_id: nil, security_policy_reference_resource: nil)
687
+ # Pass arguments to `set_edge_security_policy` via keyword arguments. Note that at
688
+ # least one keyword argument is required. To specify no parameters, or to keep all
689
+ # the default parameter values, pass an empty Hash as a request object (see above).
690
+ #
691
+ # @param backend_bucket [::String]
692
+ # Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.
693
+ # @param project [::String]
694
+ # Project ID for this request.
695
+ # @param request_id [::String]
696
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
697
+ # @param security_policy_reference_resource [::Google::Cloud::Compute::V1::SecurityPolicyReference, ::Hash]
698
+ # The body resource for this request
699
+ # @yield [result, response] Access the result along with the Faraday response object
700
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
701
+ # @yieldparam response [::Faraday::Response]
702
+ #
703
+ # @return [::Gapic::GenericLRO::Operation]
704
+ #
705
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
706
+ def set_edge_security_policy request, options = nil
707
+ raise ::ArgumentError, "request must be provided" if request.nil?
708
+
709
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetEdgeSecurityPolicyBackendBucketRequest
710
+
711
+ # Converts hash and nil to an options object
712
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
713
+
714
+ # Customize the options with defaults
715
+ call_metadata = @config.rpcs.set_edge_security_policy.metadata.to_h
716
+
717
+ # Set x-goog-api-client header
718
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
719
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
720
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
721
+ transports_version_send: [:rest]
722
+
723
+ options.apply_defaults timeout: @config.rpcs.set_edge_security_policy.timeout,
724
+ metadata: call_metadata
725
+
726
+ options.apply_defaults timeout: @config.timeout,
727
+ metadata: @config.metadata
728
+
729
+ @backend_buckets_stub.set_edge_security_policy request, options do |result, response|
730
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
731
+ operation: result,
732
+ client: global_operations,
733
+ request_values: {
734
+ "project" => request.project
735
+ },
736
+ options: options
737
+ )
613
738
  yield result, response if block_given?
614
739
  return result
615
740
  end
@@ -647,10 +772,10 @@ module Google
647
772
  # @param request_id [::String]
648
773
  # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
649
774
  # @yield [result, response] Access the result along with the Faraday response object
650
- # @yieldparam result [::Gapic::Rest::BaseOperation]
775
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
651
776
  # @yieldparam response [::Faraday::Response]
652
777
  #
653
- # @return [::Gapic::Rest::BaseOperation]
778
+ # @return [::Gapic::GenericLRO::Operation]
654
779
  #
655
780
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
656
781
  def update request, options = nil
@@ -677,7 +802,14 @@ module Google
677
802
  metadata: @config.metadata
678
803
 
679
804
  @backend_buckets_stub.update request, options do |result, response|
680
- result = ::Gapic::Rest::BaseOperation.new result
805
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
806
+ operation: result,
807
+ client: global_operations,
808
+ request_values: {
809
+ "project" => request.project
810
+ },
811
+ options: options
812
+ )
681
813
  yield result, response if block_given?
682
814
  return result
683
815
  end
@@ -821,6 +953,11 @@ module Google
821
953
  #
822
954
  attr_reader :patch
823
955
  ##
956
+ # RPC-specific configuration for `set_edge_security_policy`
957
+ # @return [::Gapic::Config::Method]
958
+ #
959
+ attr_reader :set_edge_security_policy
960
+ ##
824
961
  # RPC-specific configuration for `update`
825
962
  # @return [::Gapic::Config::Method]
826
963
  #
@@ -842,6 +979,8 @@ module Google
842
979
  @list = ::Gapic::Config::Method.new list_config
843
980
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
844
981
  @patch = ::Gapic::Config::Method.new patch_config
982
+ set_edge_security_policy_config = parent_rpcs.set_edge_security_policy if parent_rpcs.respond_to? :set_edge_security_policy
983
+ @set_edge_security_policy = ::Gapic::Config::Method.new set_edge_security_policy_config
845
984
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
846
985
  @update = ::Gapic::Config::Method.new update_config
847
986
 
@@ -359,6 +359,52 @@ module Google
359
359
  [uri, body, query_string_params]
360
360
  end
361
361
 
362
+ ##
363
+ # Baseline implementation for the set_edge_security_policy REST call
364
+ #
365
+ # @param request_pb [::Google::Cloud::Compute::V1::SetEdgeSecurityPolicyBackendBucketRequest]
366
+ # A request object representing the call parameters. Required.
367
+ # @param options [::Gapic::CallOptions]
368
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
369
+ #
370
+ # @yield [result, response] Access the result along with the Faraday response object
371
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
372
+ # @yieldparam response [::Faraday::Response]
373
+ #
374
+ # @return [::Google::Cloud::Compute::V1::Operation]
375
+ # A result object deserialized from the server's reply
376
+ def set_edge_security_policy request_pb, options = nil
377
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
378
+
379
+ uri, body, query_string_params = transcode_set_edge_security_policy_request request_pb
380
+ response = @client_stub.make_post_request(
381
+ uri: uri,
382
+ body: body,
383
+ params: query_string_params,
384
+ options: options
385
+ )
386
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
387
+
388
+ yield result, response if block_given?
389
+ result
390
+ end
391
+
392
+ ##
393
+ # GRPC transcoding helper method for the set_edge_security_policy REST call
394
+ #
395
+ # @param request_pb [::Google::Cloud::Compute::V1::SetEdgeSecurityPolicyBackendBucketRequest]
396
+ # A request object representing the call parameters. Required.
397
+ # @return [Array(String, [String, nil], Hash{String => String})]
398
+ # Uri, Body, Query string parameters
399
+ def transcode_set_edge_security_policy_request request_pb
400
+ uri = "/compute/v1/projects/#{request_pb.project}/global/backendBuckets/#{request_pb.backend_bucket}/setEdgeSecurityPolicy"
401
+ body = request_pb.security_policy_reference_resource.to_json
402
+ query_string_params = {}
403
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
404
+
405
+ [uri, body, query_string_params]
406
+ end
407
+
362
408
  ##
363
409
  # Baseline implementation for the update REST call
364
410
  #