google-cloud-compute-v1 2.4.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +52 -3
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +116 -3
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +116 -3
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +421 -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 +420 -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 +52 -3
  11. data/lib/google/cloud/compute/v1/disks/rest/client.rb +292 -3
  12. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +97 -1
  13. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +289 -1
  14. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +97 -1
  15. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +132 -3
  16. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +97 -1
  17. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +113 -1
  18. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +114 -2
  19. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +84 -3
  20. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +49 -1
  21. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +81 -1
  22. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +116 -3
  23. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +16 -0
  24. data/lib/google/cloud/compute/v1/images/rest/client.rb +177 -1
  25. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +327 -6
  26. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +149 -4
  27. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +132 -3
  28. data/lib/google/cloud/compute/v1/instances/rest/client.rb +845 -4
  29. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +62 -0
  30. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +116 -3
  31. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +33 -1
  32. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +33 -1
  33. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +206 -2
  34. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
  35. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +32 -0
  36. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +113 -1
  37. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +113 -1
  38. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +52 -3
  39. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +236 -3
  40. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +62 -0
  41. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +83 -2
  42. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +149 -4
  43. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +257 -1
  44. data/lib/google/cloud/compute/v1/networks/rest/client.rb +178 -2
  45. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +229 -4
  46. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +132 -3
  47. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +52 -3
  48. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +116 -3
  49. data/lib/google/cloud/compute/v1/projects/rest/client.rb +210 -2
  50. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +282 -4
  51. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +120 -0
  52. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +304 -3
  53. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +122 -0
  54. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +97 -1
  55. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +445 -1
  56. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +184 -0
  57. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +84 -3
  58. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +33 -1
  59. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +273 -1
  60. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +81 -1
  61. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +97 -1
  62. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +308 -4
  63. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +66 -2
  64. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +65 -1
  65. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +16 -0
  66. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +378 -4
  67. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +185 -0
  68. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +273 -1
  69. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +65 -1
  70. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +65 -1
  71. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +497 -5
  72. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +246 -0
  73. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +65 -1
  74. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +98 -2
  75. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +81 -1
  76. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +113 -1
  77. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +65 -1
  78. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +113 -1
  79. data/lib/google/cloud/compute/v1/regions/rest/client.rb +33 -1
  80. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +164 -3
  81. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +148 -3
  82. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  83. data/lib/google/cloud/compute/v1/routers/rest/client.rb +261 -4
  84. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +61 -0
  85. data/lib/google/cloud/compute/v1/routes/rest/client.rb +65 -1
  86. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +203 -6
  87. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +148 -3
  88. data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
  89. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +480 -0
  90. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +167 -0
  91. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
  92. data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
  93. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +129 -1
  94. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +84 -3
  95. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +117 -4
  96. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +197 -4
  97. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +81 -1
  98. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +116 -3
  99. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +180 -3
  100. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +188 -3
  101. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +62 -0
  102. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +284 -3
  103. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +62 -0
  104. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +145 -1
  105. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +116 -3
  106. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +100 -3
  107. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +148 -3
  108. data/lib/google/cloud/compute/v1/version.rb +1 -1
  109. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +132 -3
  110. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +100 -3
  111. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +65 -1
  112. data/lib/google/cloud/compute/v1/zones/rest/client.rb +33 -1
  113. data/lib/google/cloud/compute/v1.rb +1 -0
  114. data/proto_docs/google/api/client.rb +13 -0
  115. data/proto_docs/google/api/field_behavior.rb +14 -0
  116. data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
  117. data/proto_docs/google/protobuf/any.rb +144 -0
  118. metadata +11 -5
@@ -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
  #
@@ -194,6 +288,22 @@ module Google
194
288
  # @return [::Gapic::GenericLRO::Operation]
195
289
  #
196
290
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
291
+ #
292
+ # @example Basic example
293
+ # require "google/cloud/compute/v1"
294
+ #
295
+ # # Create a client object. The client can be reused for multiple calls.
296
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
297
+ #
298
+ # # Create a request. To set request fields, pass in keyword arguments.
299
+ # request = Google::Cloud::Compute::V1::DeletePublicAdvertisedPrefixeRequest.new
300
+ #
301
+ # # Call the delete method.
302
+ # result = client.delete request
303
+ #
304
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
305
+ # p result
306
+ #
197
307
  def delete request, options = nil
198
308
  raise ::ArgumentError, "request must be provided" if request.nil?
199
309
 
@@ -266,6 +376,22 @@ module Google
266
376
  # @return [::Google::Cloud::Compute::V1::PublicAdvertisedPrefix]
267
377
  #
268
378
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
379
+ #
380
+ # @example Basic example
381
+ # require "google/cloud/compute/v1"
382
+ #
383
+ # # Create a client object. The client can be reused for multiple calls.
384
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
385
+ #
386
+ # # Create a request. To set request fields, pass in keyword arguments.
387
+ # request = Google::Cloud::Compute::V1::GetPublicAdvertisedPrefixeRequest.new
388
+ #
389
+ # # Call the get method.
390
+ # result = client.get request
391
+ #
392
+ # # The returned object is of type Google::Cloud::Compute::V1::PublicAdvertisedPrefix.
393
+ # p result
394
+ #
269
395
  def get request, options = nil
270
396
  raise ::ArgumentError, "request must be provided" if request.nil?
271
397
 
@@ -332,6 +458,22 @@ module Google
332
458
  # @return [::Gapic::GenericLRO::Operation]
333
459
  #
334
460
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
461
+ #
462
+ # @example Basic example
463
+ # require "google/cloud/compute/v1"
464
+ #
465
+ # # Create a client object. The client can be reused for multiple calls.
466
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
467
+ #
468
+ # # Create a request. To set request fields, pass in keyword arguments.
469
+ # request = Google::Cloud::Compute::V1::InsertPublicAdvertisedPrefixeRequest.new
470
+ #
471
+ # # Call the insert method.
472
+ # result = client.insert request
473
+ #
474
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
475
+ # p result
476
+ #
335
477
  def insert request, options = nil
336
478
  raise ::ArgumentError, "request must be provided" if request.nil?
337
479
 
@@ -394,7 +536,7 @@ module Google
394
536
  # the default parameter values, pass an empty Hash as a request object (see above).
395
537
  #
396
538
  # @param filter [::String]
397
- # 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.
398
540
  # @param max_results [::Integer]
399
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`)
400
542
  # @param order_by [::String]
@@ -412,6 +554,22 @@ module Google
412
554
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PublicAdvertisedPrefix>]
413
555
  #
414
556
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
557
+ #
558
+ # @example Basic example
559
+ # require "google/cloud/compute/v1"
560
+ #
561
+ # # Create a client object. The client can be reused for multiple calls.
562
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
563
+ #
564
+ # # Create a request. To set request fields, pass in keyword arguments.
565
+ # request = Google::Cloud::Compute::V1::ListPublicAdvertisedPrefixesRequest.new
566
+ #
567
+ # # Call the list method.
568
+ # result = client.list request
569
+ #
570
+ # # The returned object is of type Google::Cloud::Compute::V1::PublicAdvertisedPrefixList.
571
+ # p result
572
+ #
415
573
  def list request, options = nil
416
574
  raise ::ArgumentError, "request must be provided" if request.nil?
417
575
 
@@ -481,6 +639,22 @@ module Google
481
639
  # @return [::Gapic::GenericLRO::Operation]
482
640
  #
483
641
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
642
+ #
643
+ # @example Basic example
644
+ # require "google/cloud/compute/v1"
645
+ #
646
+ # # Create a client object. The client can be reused for multiple calls.
647
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
648
+ #
649
+ # # Create a request. To set request fields, pass in keyword arguments.
650
+ # request = Google::Cloud::Compute::V1::PatchPublicAdvertisedPrefixeRequest.new
651
+ #
652
+ # # Call the patch method.
653
+ # result = client.patch request
654
+ #
655
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
656
+ # p result
657
+ #
484
658
  def patch request, options = nil
485
659
  raise ::ArgumentError, "request must be provided" if request.nil?
486
660
 
@@ -524,6 +698,96 @@ module Google
524
698
  raise ::Google::Cloud::Error.from_error(e)
525
699
  end
526
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
+
527
791
  ##
528
792
  # Configuration class for the PublicAdvertisedPrefixes REST API.
529
793
  #
@@ -540,17 +804,17 @@ module Google
540
804
  # @example
541
805
  #
542
806
  # # Modify the global config, setting the timeout for
543
- # # delete to 20 seconds,
807
+ # # announce to 20 seconds,
544
808
  # # and all remaining timeouts to 10 seconds.
545
809
  # ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.configure do |config|
546
810
  # config.timeout = 10.0
547
- # config.rpcs.delete.timeout = 20.0
811
+ # config.rpcs.announce.timeout = 20.0
548
812
  # end
549
813
  #
550
814
  # # Apply the above configuration only to a new client.
551
815
  # client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new do |config|
552
816
  # config.timeout = 10.0
553
- # config.rpcs.delete.timeout = 20.0
817
+ # config.rpcs.announce.timeout = 20.0
554
818
  # end
555
819
  #
556
820
  # @!attribute [rw] endpoint
@@ -649,6 +913,11 @@ module Google
649
913
  # trigger a retry.
650
914
  #
651
915
  class Rpcs
916
+ ##
917
+ # RPC-specific configuration for `announce`
918
+ # @return [::Gapic::Config::Method]
919
+ #
920
+ attr_reader :announce
652
921
  ##
653
922
  # RPC-specific configuration for `delete`
654
923
  # @return [::Gapic::Config::Method]
@@ -674,9 +943,16 @@ module Google
674
943
  # @return [::Gapic::Config::Method]
675
944
  #
676
945
  attr_reader :patch
946
+ ##
947
+ # RPC-specific configuration for `withdraw`
948
+ # @return [::Gapic::Config::Method]
949
+ #
950
+ attr_reader :withdraw
677
951
 
678
952
  # @private
679
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
680
956
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
681
957
  @delete = ::Gapic::Config::Method.new delete_config
682
958
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
@@ -687,6 +963,8 @@ module Google
687
963
  @list = ::Gapic::Config::Method.new list_config
688
964
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
689
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
690
968
 
691
969
  yield self if block_given?
692
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