google-cloud-compute-v1 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +4 -3
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +4 -3
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +4 -3
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +277 -1
  6. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +182 -0
  7. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +196 -3
  8. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +120 -0
  9. data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
  10. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +4 -3
  11. data/lib/google/cloud/compute/v1/disks/rest/client.rb +4 -3
  12. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +1 -1
  13. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +1 -1
  14. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +1 -1
  15. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +4 -3
  16. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +1 -1
  17. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +1 -1
  18. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +2 -2
  19. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +4 -3
  20. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  21. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +1 -1
  22. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +4 -3
  23. data/lib/google/cloud/compute/v1/images/rest/client.rb +1 -1
  24. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +7 -6
  25. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +5 -4
  26. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +4 -3
  27. data/lib/google/cloud/compute/v1/instances/rest/client.rb +109 -4
  28. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +62 -0
  29. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +4 -3
  30. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  31. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +1 -1
  32. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +94 -2
  33. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
  34. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +1 -1
  35. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +1 -1
  36. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +4 -3
  37. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +108 -3
  38. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +62 -0
  39. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +3 -2
  40. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +5 -4
  41. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1 -1
  42. data/lib/google/cloud/compute/v1/networks/rest/client.rb +2 -2
  43. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +5 -4
  44. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +4 -3
  45. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +4 -3
  46. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +4 -3
  47. data/lib/google/cloud/compute/v1/projects/rest/client.rb +2 -2
  48. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +202 -4
  49. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +120 -0
  50. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +208 -3
  51. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +122 -0
  52. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +1 -1
  53. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +301 -1
  54. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +184 -0
  55. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +4 -3
  56. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  57. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1 -1
  58. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +1 -1
  59. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +1 -1
  60. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +4 -4
  61. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +2 -2
  62. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +1 -1
  63. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +314 -4
  64. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +185 -0
  65. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1 -1
  66. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +1 -1
  67. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  68. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +417 -5
  69. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +246 -0
  70. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +1 -1
  71. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +2 -2
  72. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +1 -1
  73. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +1 -1
  74. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +1 -1
  75. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +1 -1
  76. data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
  77. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +4 -3
  78. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +4 -3
  79. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  80. data/lib/google/cloud/compute/v1/routers/rest/client.rb +101 -4
  81. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +61 -0
  82. data/lib/google/cloud/compute/v1/routes/rest/client.rb +1 -1
  83. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +11 -6
  84. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +4 -3
  85. data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
  86. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +480 -0
  87. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +167 -0
  88. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
  89. data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
  90. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +1 -1
  91. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +4 -3
  92. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +5 -4
  93. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +5 -4
  94. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +1 -1
  95. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +4 -3
  96. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +4 -3
  97. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +108 -3
  98. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +62 -0
  99. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +108 -3
  100. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +62 -0
  101. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +1 -1
  102. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +4 -3
  103. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +4 -3
  104. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +4 -3
  105. data/lib/google/cloud/compute/v1/version.rb +1 -1
  106. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +4 -3
  107. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +4 -3
  108. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  109. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  110. data/lib/google/cloud/compute/v1.rb +1 -0
  111. data/proto_docs/google/api/client.rb +13 -0
  112. data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
  113. data/proto_docs/google/protobuf/any.rb +144 -0
  114. metadata +8 -2
@@ -65,6 +65,8 @@ module Google
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
67
67
 
68
+ default_config.rpcs.announce.timeout = 600.0
69
+
68
70
  default_config.rpcs.delete.timeout = 600.0
69
71
 
70
72
  default_config.rpcs.get.timeout = 600.0
@@ -81,6 +83,8 @@ module Google
81
83
 
82
84
  default_config.rpcs.patch.timeout = 600.0
83
85
 
86
+ default_config.rpcs.withdraw.timeout = 600.0
87
+
84
88
  default_config
85
89
  end
86
90
  yield @configure if block_given?
@@ -163,6 +167,96 @@ module Google
163
167
 
164
168
  # Service calls
165
169
 
170
+ ##
171
+ # Announces the specified PublicAdvertisedPrefix
172
+ #
173
+ # @overload announce(request, options = nil)
174
+ # Pass arguments to `announce` via a request object, either of type
175
+ # {::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest} or an equivalent Hash.
176
+ #
177
+ # @param request [::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest, ::Hash]
178
+ # A request object representing the call parameters. Required. To specify no
179
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
180
+ # @param options [::Gapic::CallOptions, ::Hash]
181
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
182
+ #
183
+ # @overload announce(project: nil, public_advertised_prefix: nil, request_id: nil)
184
+ # Pass arguments to `announce` via keyword arguments. Note that at
185
+ # least one keyword argument is required. To specify no parameters, or to keep all
186
+ # the default parameter values, pass an empty Hash as a request object (see above).
187
+ #
188
+ # @param project [::String]
189
+ # Project ID for this request.
190
+ # @param public_advertised_prefix [::String]
191
+ # The name of the public advertised prefix. It should comply with RFC1035.
192
+ # @param request_id [::String]
193
+ # 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).
194
+ # @yield [result, operation] Access the result along with the TransportOperation object
195
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
196
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
197
+ #
198
+ # @return [::Gapic::GenericLRO::Operation]
199
+ #
200
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
201
+ #
202
+ # @example Basic example
203
+ # require "google/cloud/compute/v1"
204
+ #
205
+ # # Create a client object. The client can be reused for multiple calls.
206
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
207
+ #
208
+ # # Create a request. To set request fields, pass in keyword arguments.
209
+ # request = Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest.new
210
+ #
211
+ # # Call the announce method.
212
+ # result = client.announce request
213
+ #
214
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
215
+ # p result
216
+ #
217
+ def announce request, options = nil
218
+ raise ::ArgumentError, "request must be provided" if request.nil?
219
+
220
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest
221
+
222
+ # Converts hash and nil to an options object
223
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
224
+
225
+ # Customize the options with defaults
226
+ call_metadata = @config.rpcs.announce.metadata.to_h
227
+
228
+ # Set x-goog-api-client and x-goog-user-project headers
229
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
230
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
231
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
232
+ transports_version_send: [:rest]
233
+
234
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
235
+
236
+ options.apply_defaults timeout: @config.rpcs.announce.timeout,
237
+ metadata: call_metadata,
238
+ retry_policy: @config.rpcs.announce.retry_policy
239
+
240
+ options.apply_defaults timeout: @config.timeout,
241
+ metadata: @config.metadata,
242
+ retry_policy: @config.retry_policy
243
+
244
+ @public_advertised_prefixes_stub.announce request, options do |result, response|
245
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
246
+ operation: result,
247
+ client: global_operations,
248
+ request_values: {
249
+ "project" => request.project
250
+ },
251
+ options: options
252
+ )
253
+ yield result, response if block_given?
254
+ return result
255
+ end
256
+ rescue ::Gapic::Rest::Error => e
257
+ raise ::Google::Cloud::Error.from_error(e)
258
+ end
259
+
166
260
  ##
167
261
  # Deletes the specified PublicAdvertisedPrefix
168
262
  #
@@ -442,7 +536,7 @@ module Google
442
536
  # the default parameter values, pass an empty Hash as a request object (see above).
443
537
  #
444
538
  # @param filter [::String]
445
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your 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) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
539
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your 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 `:*` 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) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
446
540
  # @param max_results [::Integer]
447
541
  # 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`)
448
542
  # @param order_by [::String]
@@ -604,6 +698,96 @@ module Google
604
698
  raise ::Google::Cloud::Error.from_error(e)
605
699
  end
606
700
 
701
+ ##
702
+ # Withdraws the specified PublicAdvertisedPrefix
703
+ #
704
+ # @overload withdraw(request, options = nil)
705
+ # Pass arguments to `withdraw` via a request object, either of type
706
+ # {::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest} or an equivalent Hash.
707
+ #
708
+ # @param request [::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest, ::Hash]
709
+ # A request object representing the call parameters. Required. To specify no
710
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
711
+ # @param options [::Gapic::CallOptions, ::Hash]
712
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
713
+ #
714
+ # @overload withdraw(project: nil, public_advertised_prefix: nil, request_id: nil)
715
+ # Pass arguments to `withdraw` via keyword arguments. Note that at
716
+ # least one keyword argument is required. To specify no parameters, or to keep all
717
+ # the default parameter values, pass an empty Hash as a request object (see above).
718
+ #
719
+ # @param project [::String]
720
+ # Project ID for this request.
721
+ # @param public_advertised_prefix [::String]
722
+ # The name of the public advertised prefix. It should comply with RFC1035.
723
+ # @param request_id [::String]
724
+ # 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).
725
+ # @yield [result, operation] Access the result along with the TransportOperation object
726
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
727
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
728
+ #
729
+ # @return [::Gapic::GenericLRO::Operation]
730
+ #
731
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
732
+ #
733
+ # @example Basic example
734
+ # require "google/cloud/compute/v1"
735
+ #
736
+ # # Create a client object. The client can be reused for multiple calls.
737
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
738
+ #
739
+ # # Create a request. To set request fields, pass in keyword arguments.
740
+ # request = Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest.new
741
+ #
742
+ # # Call the withdraw method.
743
+ # result = client.withdraw request
744
+ #
745
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
746
+ # p result
747
+ #
748
+ def withdraw request, options = nil
749
+ raise ::ArgumentError, "request must be provided" if request.nil?
750
+
751
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest
752
+
753
+ # Converts hash and nil to an options object
754
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
755
+
756
+ # Customize the options with defaults
757
+ call_metadata = @config.rpcs.withdraw.metadata.to_h
758
+
759
+ # Set x-goog-api-client and x-goog-user-project headers
760
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
761
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
762
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
763
+ transports_version_send: [:rest]
764
+
765
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
766
+
767
+ options.apply_defaults timeout: @config.rpcs.withdraw.timeout,
768
+ metadata: call_metadata,
769
+ retry_policy: @config.rpcs.withdraw.retry_policy
770
+
771
+ options.apply_defaults timeout: @config.timeout,
772
+ metadata: @config.metadata,
773
+ retry_policy: @config.retry_policy
774
+
775
+ @public_advertised_prefixes_stub.withdraw request, options do |result, response|
776
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
777
+ operation: result,
778
+ client: global_operations,
779
+ request_values: {
780
+ "project" => request.project
781
+ },
782
+ options: options
783
+ )
784
+ yield result, response if block_given?
785
+ return result
786
+ end
787
+ rescue ::Gapic::Rest::Error => e
788
+ raise ::Google::Cloud::Error.from_error(e)
789
+ end
790
+
607
791
  ##
608
792
  # Configuration class for the PublicAdvertisedPrefixes REST API.
609
793
  #
@@ -620,17 +804,17 @@ module Google
620
804
  # @example
621
805
  #
622
806
  # # Modify the global config, setting the timeout for
623
- # # delete to 20 seconds,
807
+ # # announce to 20 seconds,
624
808
  # # and all remaining timeouts to 10 seconds.
625
809
  # ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.configure do |config|
626
810
  # config.timeout = 10.0
627
- # config.rpcs.delete.timeout = 20.0
811
+ # config.rpcs.announce.timeout = 20.0
628
812
  # end
629
813
  #
630
814
  # # Apply the above configuration only to a new client.
631
815
  # client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new do |config|
632
816
  # config.timeout = 10.0
633
- # config.rpcs.delete.timeout = 20.0
817
+ # config.rpcs.announce.timeout = 20.0
634
818
  # end
635
819
  #
636
820
  # @!attribute [rw] endpoint
@@ -729,6 +913,11 @@ module Google
729
913
  # trigger a retry.
730
914
  #
731
915
  class Rpcs
916
+ ##
917
+ # RPC-specific configuration for `announce`
918
+ # @return [::Gapic::Config::Method]
919
+ #
920
+ attr_reader :announce
732
921
  ##
733
922
  # RPC-specific configuration for `delete`
734
923
  # @return [::Gapic::Config::Method]
@@ -754,9 +943,16 @@ module Google
754
943
  # @return [::Gapic::Config::Method]
755
944
  #
756
945
  attr_reader :patch
946
+ ##
947
+ # RPC-specific configuration for `withdraw`
948
+ # @return [::Gapic::Config::Method]
949
+ #
950
+ attr_reader :withdraw
757
951
 
758
952
  # @private
759
953
  def initialize parent_rpcs = nil
954
+ announce_config = parent_rpcs.announce if parent_rpcs.respond_to? :announce
955
+ @announce = ::Gapic::Config::Method.new announce_config
760
956
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
761
957
  @delete = ::Gapic::Config::Method.new delete_config
762
958
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
@@ -767,6 +963,8 @@ module Google
767
963
  @list = ::Gapic::Config::Method.new list_config
768
964
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
769
965
  @patch = ::Gapic::Config::Method.new patch_config
966
+ withdraw_config = parent_rpcs.withdraw if parent_rpcs.respond_to? :withdraw
967
+ @withdraw = ::Gapic::Config::Method.new withdraw_config
770
968
 
771
969
  yield self if block_given?
772
970
  end
@@ -40,6 +40,44 @@ module Google
40
40
  raise_faraday_errors: false
41
41
  end
42
42
 
43
+ ##
44
+ # Baseline implementation for the announce REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::Compute::V1::Operation]
56
+ # A result object deserialized from the server's reply
57
+ def announce request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_announce_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
43
81
  ##
44
82
  # Baseline implementation for the delete REST call
45
83
  #
@@ -230,6 +268,66 @@ module Google
230
268
  result
231
269
  end
232
270
 
271
+ ##
272
+ # Baseline implementation for the withdraw REST call
273
+ #
274
+ # @param request_pb [::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest]
275
+ # A request object representing the call parameters. Required.
276
+ # @param options [::Gapic::CallOptions]
277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
278
+ #
279
+ # @yield [result, operation] Access the result along with the TransportOperation object
280
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
281
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
282
+ #
283
+ # @return [::Google::Cloud::Compute::V1::Operation]
284
+ # A result object deserialized from the server's reply
285
+ def withdraw request_pb, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
287
+
288
+ verb, uri, query_string_params, body = ServiceStub.transcode_withdraw_request request_pb
289
+ query_string_params = if query_string_params.any?
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
+ else
292
+ {}
293
+ end
294
+
295
+ response = @client_stub.make_http_request(
296
+ verb,
297
+ uri: uri,
298
+ body: body || "",
299
+ params: query_string_params,
300
+ options: options
301
+ )
302
+ operation = ::Gapic::Rest::TransportOperation.new response
303
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
304
+
305
+ yield result, operation if block_given?
306
+ result
307
+ end
308
+
309
+ ##
310
+ # @private
311
+ #
312
+ # GRPC transcoding helper method for the announce REST call
313
+ #
314
+ # @param request_pb [::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest]
315
+ # A request object representing the call parameters. Required.
316
+ # @return [Array(String, [String, nil], Hash{String => String})]
317
+ # Uri, Body, Query string parameters
318
+ def self.transcode_announce_request request_pb
319
+ transcoder = Gapic::Rest::GrpcTranscoder.new
320
+ .with_bindings(
321
+ uri_method: :post,
322
+ uri_template: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}/announce",
323
+ matches: [
324
+ ["project", %r{^[^/]+/?$}, false],
325
+ ["public_advertised_prefix", %r{^[^/]+/?$}, false]
326
+ ]
327
+ )
328
+ transcoder.transcode request_pb
329
+ end
330
+
233
331
  ##
234
332
  # @private
235
333
  #
@@ -339,6 +437,28 @@ module Google
339
437
  )
340
438
  transcoder.transcode request_pb
341
439
  end
440
+
441
+ ##
442
+ # @private
443
+ #
444
+ # GRPC transcoding helper method for the withdraw REST call
445
+ #
446
+ # @param request_pb [::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest]
447
+ # A request object representing the call parameters. Required.
448
+ # @return [Array(String, [String, nil], Hash{String => String})]
449
+ # Uri, Body, Query string parameters
450
+ def self.transcode_withdraw_request request_pb
451
+ transcoder = Gapic::Rest::GrpcTranscoder.new
452
+ .with_bindings(
453
+ uri_method: :post,
454
+ uri_template: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}/withdraw",
455
+ matches: [
456
+ ["project", %r{^[^/]+/?$}, false],
457
+ ["public_advertised_prefix", %r{^[^/]+/?$}, false]
458
+ ]
459
+ )
460
+ transcoder.transcode request_pb
461
+ end
342
462
  end
343
463
  end
344
464
  end