google-cloud-compute-v1 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/compute_pb.rb +58 -1
  3. data/lib/google/cloud/compute/v1/global_vm_extension_policies/credentials.rb +52 -0
  4. data/lib/google/cloud/compute/v1/global_vm_extension_policies/rest/client.rb +1164 -0
  5. data/lib/google/cloud/compute/v1/global_vm_extension_policies/rest/service_stub.rb +453 -0
  6. data/lib/google/cloud/compute/v1/global_vm_extension_policies/rest.rb +51 -0
  7. data/lib/google/cloud/compute/v1/global_vm_extension_policies.rb +47 -0
  8. data/lib/google/cloud/compute/v1/license_codes/credentials.rb +0 -1
  9. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +193 -0
  10. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +125 -0
  11. data/lib/google/cloud/compute/v1/networks/rest/client.rb +116 -0
  12. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +63 -0
  13. data/lib/google/cloud/compute/v1/rest.rb +3 -0
  14. data/lib/google/cloud/compute/v1/rollout_plans/credentials.rb +52 -0
  15. data/lib/google/cloud/compute/v1/rollout_plans/rest/client.rb +848 -0
  16. data/lib/google/cloud/compute/v1/rollout_plans/rest/service_stub.rb +328 -0
  17. data/lib/google/cloud/compute/v1/rollout_plans/rest.rb +51 -0
  18. data/lib/google/cloud/compute/v1/rollout_plans.rb +47 -0
  19. data/lib/google/cloud/compute/v1/rollouts/credentials.rb +52 -0
  20. data/lib/google/cloud/compute/v1/rollouts/rest/client.rb +853 -0
  21. data/lib/google/cloud/compute/v1/rollouts/rest/service_stub.rb +328 -0
  22. data/lib/google/cloud/compute/v1/rollouts/rest.rb +51 -0
  23. data/lib/google/cloud/compute/v1/rollouts.rb +47 -0
  24. data/lib/google/cloud/compute/v1/version.rb +1 -1
  25. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/client.rb +3 -3
  26. data/lib/google/cloud/compute/v1.rb +3 -0
  27. data/proto_docs/google/cloud/compute/v1/compute.rb +2698 -914
  28. metadata +16 -1
@@ -0,0 +1,853 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/rollouts/rest/service_stub"
22
+ require "google/cloud/compute/v1/global_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module Rollouts
29
+ module Rest
30
+ ##
31
+ # REST client for the Rollouts service.
32
+ #
33
+ # The Rollouts API.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
41
+
42
+ # @private
43
+ attr_reader :rollouts_stub
44
+
45
+ ##
46
+ # Configure the Rollouts Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::Rollouts::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all Rollouts clients
54
+ # ::Google::Cloud::Compute::V1::Rollouts::Rest::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Compute", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.cancel.timeout = 600.0
75
+
76
+ default_config.rpcs.delete.timeout = 600.0
77
+
78
+ default_config.rpcs.get.timeout = 600.0
79
+ default_config.rpcs.get.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config.rpcs.list.timeout = 600.0
84
+ default_config.rpcs.list.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the Rollouts Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::Compute::V1::Rollouts::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # The effective universe domain
116
+ #
117
+ # @return [String]
118
+ #
119
+ def universe_domain
120
+ @rollouts_stub.universe_domain
121
+ end
122
+
123
+ ##
124
+ # Create a new Rollouts REST client object.
125
+ #
126
+ # @example
127
+ #
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::Compute::V1::Rollouts::Rest::Client.new
130
+ #
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::Compute::V1::Rollouts::Rest::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
135
+ #
136
+ # @yield [config] Configure the Rollouts client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ def initialize
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint.nil? ||
151
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
+ !@config.endpoint.split(".").first.include?("-"))
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @global_operations = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config|
163
+ config.credentials = credentials
164
+ config.quota_project = @quota_project_id
165
+ config.endpoint = @config.endpoint
166
+ config.universe_domain = @config.universe_domain
167
+ end
168
+
169
+ @rollouts_stub = ::Google::Cloud::Compute::V1::Rollouts::Rest::ServiceStub.new(
170
+ endpoint: @config.endpoint,
171
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
172
+ universe_domain: @config.universe_domain,
173
+ credentials: credentials,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @rollouts_stub.logger(stub: true)&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+ end
187
+
188
+ ##
189
+ # Get the associated client for long-running operations via GlobalOperations.
190
+ #
191
+ # @return [::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client]
192
+ #
193
+ attr_reader :global_operations
194
+
195
+ ##
196
+ # The logger used for request/response debug logging.
197
+ #
198
+ # @return [Logger]
199
+ #
200
+ def logger
201
+ @rollouts_stub.logger
202
+ end
203
+
204
+ # Service calls
205
+
206
+ ##
207
+ # Cancels a Rollout.
208
+ #
209
+ # @overload cancel(request, options = nil)
210
+ # Pass arguments to `cancel` via a request object, either of type
211
+ # {::Google::Cloud::Compute::V1::CancelRolloutRequest} or an equivalent Hash.
212
+ #
213
+ # @param request [::Google::Cloud::Compute::V1::CancelRolloutRequest, ::Hash]
214
+ # A request object representing the call parameters. Required. To specify no
215
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
216
+ # @param options [::Gapic::CallOptions, ::Hash]
217
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
218
+ #
219
+ # @overload cancel(project: nil, request_id: nil, rollback: nil, rollout: nil)
220
+ # Pass arguments to `cancel` via keyword arguments. Note that at
221
+ # least one keyword argument is required. To specify no parameters, or to keep all
222
+ # the default parameter values, pass an empty Hash as a request object (see above).
223
+ #
224
+ # @param project [::String]
225
+ # Project ID for this request.
226
+ # @param request_id [::String]
227
+ # An optional request ID to identify requests. Specify a unique request ID so
228
+ # that if you must retry your request, the server will know to ignore the
229
+ # request if it has already been completed.
230
+ #
231
+ # For example, consider a situation where you make an initial request and
232
+ # the request times out. If you make the request again with the same
233
+ # request ID, the server can check if original operation with the same
234
+ # request ID was received, and if so, will ignore the second request. This
235
+ # prevents clients from accidentally creating duplicate commitments.
236
+ #
237
+ # The request ID must be
238
+ # a valid UUID with the exception that zero UUID is not supported
239
+ # (00000000-0000-0000-0000-000000000000).
240
+ # @param rollback [::Boolean]
241
+ # Optional. If true, then the ongoing rollout must be rolled back. Else, just cancel
242
+ # the rollout without taking any further actions. Note that products must
243
+ # support at least one of these options, however, it does not need to support
244
+ # both.
245
+ # @param rollout [::String]
246
+ # Name of the Rollout resource to cancel.
247
+ # @yield [result, operation] Access the result along with the TransportOperation object
248
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
249
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
250
+ #
251
+ # @return [::Gapic::GenericLRO::Operation]
252
+ #
253
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
254
+ #
255
+ # @example Basic example
256
+ # require "google/cloud/compute/v1"
257
+ #
258
+ # # Create a client object. The client can be reused for multiple calls.
259
+ # client = Google::Cloud::Compute::V1::Rollouts::Rest::Client.new
260
+ #
261
+ # # Create a request. To set request fields, pass in keyword arguments.
262
+ # request = Google::Cloud::Compute::V1::CancelRolloutRequest.new
263
+ #
264
+ # # Call the cancel method.
265
+ # result = client.cancel request
266
+ #
267
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
268
+ # p result
269
+ #
270
+ def cancel request, options = nil
271
+ raise ::ArgumentError, "request must be provided" if request.nil?
272
+
273
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CancelRolloutRequest
274
+
275
+ # Converts hash and nil to an options object
276
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
277
+
278
+ # Customize the options with defaults
279
+ call_metadata = @config.rpcs.cancel.metadata.to_h
280
+
281
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
282
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
283
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
284
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
285
+ transports_version_send: [:rest]
286
+
287
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
288
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
289
+
290
+ options.apply_defaults timeout: @config.rpcs.cancel.timeout,
291
+ metadata: call_metadata,
292
+ retry_policy: @config.rpcs.cancel.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @rollouts_stub.cancel request, options do |result, response|
299
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
300
+ operation: result,
301
+ client: global_operations,
302
+ request_values: {
303
+ "project" => request.project
304
+ },
305
+ options: options
306
+ )
307
+ yield result, response if block_given?
308
+ throw :response, result
309
+ end
310
+ rescue ::Gapic::Rest::Error => e
311
+ raise ::Google::Cloud::Error.from_error(e)
312
+ end
313
+
314
+ ##
315
+ # Deletes a Rollout.
316
+ #
317
+ # @overload delete(request, options = nil)
318
+ # Pass arguments to `delete` via a request object, either of type
319
+ # {::Google::Cloud::Compute::V1::DeleteRolloutRequest} or an equivalent Hash.
320
+ #
321
+ # @param request [::Google::Cloud::Compute::V1::DeleteRolloutRequest, ::Hash]
322
+ # A request object representing the call parameters. Required. To specify no
323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
324
+ # @param options [::Gapic::CallOptions, ::Hash]
325
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
326
+ #
327
+ # @overload delete(project: nil, request_id: nil, rollout: nil)
328
+ # Pass arguments to `delete` via keyword arguments. Note that at
329
+ # least one keyword argument is required. To specify no parameters, or to keep all
330
+ # the default parameter values, pass an empty Hash as a request object (see above).
331
+ #
332
+ # @param project [::String]
333
+ # Project ID for this request.
334
+ # @param request_id [::String]
335
+ # An optional request ID to identify requests. Specify a unique request ID so
336
+ # that if you must retry your request, the server will know to ignore the
337
+ # request if it has already been completed.
338
+ #
339
+ # For example, consider a situation where you make an initial request and
340
+ # the request times out. If you make the request again with the same
341
+ # request ID, the server can check if original operation with the same
342
+ # request ID was received, and if so, will ignore the second request. This
343
+ # prevents clients from accidentally creating duplicate commitments.
344
+ #
345
+ # The request ID must be
346
+ # a valid UUID with the exception that zero UUID is not supported
347
+ # (00000000-0000-0000-0000-000000000000).
348
+ # @param rollout [::String]
349
+ # Name of the Rollout resource to delete.
350
+ # @yield [result, operation] Access the result along with the TransportOperation object
351
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
352
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
353
+ #
354
+ # @return [::Gapic::GenericLRO::Operation]
355
+ #
356
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
357
+ #
358
+ # @example Basic example
359
+ # require "google/cloud/compute/v1"
360
+ #
361
+ # # Create a client object. The client can be reused for multiple calls.
362
+ # client = Google::Cloud::Compute::V1::Rollouts::Rest::Client.new
363
+ #
364
+ # # Create a request. To set request fields, pass in keyword arguments.
365
+ # request = Google::Cloud::Compute::V1::DeleteRolloutRequest.new
366
+ #
367
+ # # Call the delete method.
368
+ # result = client.delete request
369
+ #
370
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
371
+ # p result
372
+ #
373
+ def delete request, options = nil
374
+ raise ::ArgumentError, "request must be provided" if request.nil?
375
+
376
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteRolloutRequest
377
+
378
+ # Converts hash and nil to an options object
379
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
380
+
381
+ # Customize the options with defaults
382
+ call_metadata = @config.rpcs.delete.metadata.to_h
383
+
384
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
385
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
386
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
387
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
388
+ transports_version_send: [:rest]
389
+
390
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
391
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
392
+
393
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
394
+ metadata: call_metadata,
395
+ retry_policy: @config.rpcs.delete.retry_policy
396
+
397
+ options.apply_defaults timeout: @config.timeout,
398
+ metadata: @config.metadata,
399
+ retry_policy: @config.retry_policy
400
+
401
+ @rollouts_stub.delete request, options do |result, response|
402
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
403
+ operation: result,
404
+ client: global_operations,
405
+ request_values: {
406
+ "project" => request.project
407
+ },
408
+ options: options
409
+ )
410
+ yield result, response if block_given?
411
+ throw :response, result
412
+ end
413
+ rescue ::Gapic::Rest::Error => e
414
+ raise ::Google::Cloud::Error.from_error(e)
415
+ end
416
+
417
+ ##
418
+ # Gets details of a single project-scoped Rollout.
419
+ #
420
+ # @overload get(request, options = nil)
421
+ # Pass arguments to `get` via a request object, either of type
422
+ # {::Google::Cloud::Compute::V1::GetRolloutRequest} or an equivalent Hash.
423
+ #
424
+ # @param request [::Google::Cloud::Compute::V1::GetRolloutRequest, ::Hash]
425
+ # A request object representing the call parameters. Required. To specify no
426
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
427
+ # @param options [::Gapic::CallOptions, ::Hash]
428
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
429
+ #
430
+ # @overload get(project: nil, rollout: nil)
431
+ # Pass arguments to `get` via keyword arguments. Note that at
432
+ # least one keyword argument is required. To specify no parameters, or to keep all
433
+ # the default parameter values, pass an empty Hash as a request object (see above).
434
+ #
435
+ # @param project [::String]
436
+ # Project ID for this request.
437
+ # @param rollout [::String]
438
+ # Name of the persistent rollout to return.
439
+ # @yield [result, operation] Access the result along with the TransportOperation object
440
+ # @yieldparam result [::Google::Cloud::Compute::V1::Rollout]
441
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
442
+ #
443
+ # @return [::Google::Cloud::Compute::V1::Rollout]
444
+ #
445
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
446
+ #
447
+ # @example Basic example
448
+ # require "google/cloud/compute/v1"
449
+ #
450
+ # # Create a client object. The client can be reused for multiple calls.
451
+ # client = Google::Cloud::Compute::V1::Rollouts::Rest::Client.new
452
+ #
453
+ # # Create a request. To set request fields, pass in keyword arguments.
454
+ # request = Google::Cloud::Compute::V1::GetRolloutRequest.new
455
+ #
456
+ # # Call the get method.
457
+ # result = client.get request
458
+ #
459
+ # # The returned object is of type Google::Cloud::Compute::V1::Rollout.
460
+ # p result
461
+ #
462
+ def get request, options = nil
463
+ raise ::ArgumentError, "request must be provided" if request.nil?
464
+
465
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRolloutRequest
466
+
467
+ # Converts hash and nil to an options object
468
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
469
+
470
+ # Customize the options with defaults
471
+ call_metadata = @config.rpcs.get.metadata.to_h
472
+
473
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
474
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
475
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
476
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
477
+ transports_version_send: [:rest]
478
+
479
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
480
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
481
+
482
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
483
+ metadata: call_metadata,
484
+ retry_policy: @config.rpcs.get.retry_policy
485
+
486
+ options.apply_defaults timeout: @config.timeout,
487
+ metadata: @config.metadata,
488
+ retry_policy: @config.retry_policy
489
+
490
+ @rollouts_stub.get request, options do |result, operation|
491
+ yield result, operation if block_given?
492
+ end
493
+ rescue ::Gapic::Rest::Error => e
494
+ raise ::Google::Cloud::Error.from_error(e)
495
+ end
496
+
497
+ ##
498
+ # Lists Rollouts in a given project and location.
499
+ #
500
+ # @overload list(request, options = nil)
501
+ # Pass arguments to `list` via a request object, either of type
502
+ # {::Google::Cloud::Compute::V1::ListRolloutsRequest} or an equivalent Hash.
503
+ #
504
+ # @param request [::Google::Cloud::Compute::V1::ListRolloutsRequest, ::Hash]
505
+ # A request object representing the call parameters. Required. To specify no
506
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
507
+ # @param options [::Gapic::CallOptions, ::Hash]
508
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
509
+ #
510
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
511
+ # Pass arguments to `list` via keyword arguments. Note that at
512
+ # least one keyword argument is required. To specify no parameters, or to keep all
513
+ # the default parameter values, pass an empty Hash as a request object (see above).
514
+ #
515
+ # @param filter [::String]
516
+ # A filter expression that filters resources listed in the response. Most
517
+ # Compute resources support two types of filter expressions:
518
+ # expressions that support regular expressions and expressions that follow
519
+ # API improvement proposal AIP-160.
520
+ # These two types of filter expressions cannot be mixed in one request.
521
+ #
522
+ # If you want to use AIP-160, your expression must specify the field name, an
523
+ # operator, and the value that you want to use for filtering. The value
524
+ # must be a string, a number, or a boolean. The operator
525
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
526
+ #
527
+ # For example, if you are filtering Compute Engine instances, you can
528
+ # exclude instances named `example-instance` by specifying
529
+ # `name != example-instance`.
530
+ #
531
+ # The `:*` comparison can be used to test whether a key has been defined.
532
+ # For example, to find all objects with `owner` label use:
533
+ # ```
534
+ # labels.owner:*
535
+ # ```
536
+ #
537
+ # You can also filter nested fields. For example, you could specify
538
+ # `scheduling.automaticRestart = false` to include instances only
539
+ # if they are not scheduled for automatic restarts. You can use filtering
540
+ # on nested fields to filter based onresource labels.
541
+ #
542
+ # To filter on multiple expressions, provide each separate expression within
543
+ # parentheses. For example:
544
+ # ```
545
+ # (scheduling.automaticRestart = true)
546
+ # (cpuPlatform = "Intel Skylake")
547
+ # ```
548
+ # By default, each expression is an `AND` expression. However, you
549
+ # can include `AND` and `OR` expressions explicitly.
550
+ # For example:
551
+ # ```
552
+ # (cpuPlatform = "Intel Skylake") OR
553
+ # (cpuPlatform = "Intel Broadwell") AND
554
+ # (scheduling.automaticRestart = true)
555
+ # ```
556
+ #
557
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
558
+ # (not equal) operator against a single un-parenthesized expression with or
559
+ # without quotes or against multiple parenthesized expressions. Examples:
560
+ #
561
+ # `fieldname eq unquoted literal`
562
+ # `fieldname eq 'single quoted literal'`
563
+ # `fieldname eq "double quoted literal"`
564
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
565
+ #
566
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
567
+ # The literal value must match the entire field.
568
+ #
569
+ # For example, to filter for instances that do not end with name "instance",
570
+ # you would use `name ne .*instance`.
571
+ #
572
+ # You cannot combine constraints on multiple fields using regular
573
+ # expressions.
574
+ # @param max_results [::Integer]
575
+ # The maximum number of results per page that should be returned.
576
+ # If the number of available results is larger than `maxResults`,
577
+ # Compute Engine returns a `nextPageToken` that can be used to get
578
+ # the next page of results in subsequent list requests. Acceptable values are
579
+ # `0` to `500`, inclusive. (Default: `500`)
580
+ # @param order_by [::String]
581
+ # Sorts list results by a certain order. By default, results
582
+ # are returned in alphanumerical order based on the resource name.
583
+ #
584
+ # You can also sort results in descending order based on the creation
585
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
586
+ # results based on the `creationTimestamp` field in
587
+ # reverse chronological order (newest result first). Use this to sort
588
+ # resources like operations so that the newest operation is returned first.
589
+ #
590
+ # Currently, only sorting by `name` or
591
+ # `creationTimestamp desc` is supported.
592
+ # @param page_token [::String]
593
+ # Specifies a page token to use. Set `pageToken` to the
594
+ # `nextPageToken` returned by a previous list request to get
595
+ # the next page of results.
596
+ # @param project [::String]
597
+ # Project ID for this request.
598
+ # @param return_partial_success [::Boolean]
599
+ # Opt-in for partial success behavior which provides partial results in case
600
+ # of failure. The default value is false.
601
+ #
602
+ # For example, when partial success behavior is enabled, aggregatedList for a
603
+ # single zone scope either returns all resources in the zone or no resources,
604
+ # with an error code.
605
+ # @yield [result, operation] Access the result along with the TransportOperation object
606
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Rollout>]
607
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
608
+ #
609
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Rollout>]
610
+ #
611
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
612
+ #
613
+ # @example Basic example
614
+ # require "google/cloud/compute/v1"
615
+ #
616
+ # # Create a client object. The client can be reused for multiple calls.
617
+ # client = Google::Cloud::Compute::V1::Rollouts::Rest::Client.new
618
+ #
619
+ # # Create a request. To set request fields, pass in keyword arguments.
620
+ # request = Google::Cloud::Compute::V1::ListRolloutsRequest.new
621
+ #
622
+ # # Call the list method.
623
+ # result = client.list request
624
+ #
625
+ # # The returned object is of type Google::Cloud::Compute::V1::RolloutsListResponse.
626
+ # p result
627
+ #
628
+ def list request, options = nil
629
+ raise ::ArgumentError, "request must be provided" if request.nil?
630
+
631
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRolloutsRequest
632
+
633
+ # Converts hash and nil to an options object
634
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
635
+
636
+ # Customize the options with defaults
637
+ call_metadata = @config.rpcs.list.metadata.to_h
638
+
639
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
640
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
641
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
642
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
643
+ transports_version_send: [:rest]
644
+
645
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
646
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
647
+
648
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
649
+ metadata: call_metadata,
650
+ retry_policy: @config.rpcs.list.retry_policy
651
+
652
+ options.apply_defaults timeout: @config.timeout,
653
+ metadata: @config.metadata,
654
+ retry_policy: @config.retry_policy
655
+
656
+ @rollouts_stub.list request, options do |result, operation|
657
+ result = ::Gapic::Rest::PagedEnumerable.new @rollouts_stub, :list, "items", request, result, options
658
+ yield result, operation if block_given?
659
+ throw :response, result
660
+ end
661
+ rescue ::Gapic::Rest::Error => e
662
+ raise ::Google::Cloud::Error.from_error(e)
663
+ end
664
+
665
+ ##
666
+ # Configuration class for the Rollouts REST API.
667
+ #
668
+ # This class represents the configuration for Rollouts REST,
669
+ # providing control over timeouts, retry behavior, logging, transport
670
+ # parameters, and other low-level controls. Certain parameters can also be
671
+ # applied individually to specific RPCs. See
672
+ # {::Google::Cloud::Compute::V1::Rollouts::Rest::Client::Configuration::Rpcs}
673
+ # for a list of RPCs that can be configured independently.
674
+ #
675
+ # Configuration can be applied globally to all clients, or to a single client
676
+ # on construction.
677
+ #
678
+ # @example
679
+ #
680
+ # # Modify the global config, setting the timeout for
681
+ # # cancel to 20 seconds,
682
+ # # and all remaining timeouts to 10 seconds.
683
+ # ::Google::Cloud::Compute::V1::Rollouts::Rest::Client.configure do |config|
684
+ # config.timeout = 10.0
685
+ # config.rpcs.cancel.timeout = 20.0
686
+ # end
687
+ #
688
+ # # Apply the above configuration only to a new client.
689
+ # client = ::Google::Cloud::Compute::V1::Rollouts::Rest::Client.new do |config|
690
+ # config.timeout = 10.0
691
+ # config.rpcs.cancel.timeout = 20.0
692
+ # end
693
+ #
694
+ # @!attribute [rw] endpoint
695
+ # A custom service endpoint, as a hostname or hostname:port. The default is
696
+ # nil, indicating to use the default endpoint in the current universe domain.
697
+ # @return [::String,nil]
698
+ # @!attribute [rw] credentials
699
+ # Credentials to send with calls. You may provide any of the following types:
700
+ # * (`String`) The path to a service account key file in JSON format
701
+ # * (`Hash`) A service account key as a Hash
702
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
703
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
704
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
705
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
706
+ # * (`nil`) indicating no credentials
707
+ #
708
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
709
+ # external source for authentication to Google Cloud, you must validate it before
710
+ # providing it to a Google API client library. Providing an unvalidated credential
711
+ # configuration to Google APIs can compromise the security of your systems and data.
712
+ # For more information, refer to [Validate credential configurations from external
713
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
714
+ # @return [::Object]
715
+ # @!attribute [rw] scope
716
+ # The OAuth scopes
717
+ # @return [::Array<::String>]
718
+ # @!attribute [rw] lib_name
719
+ # The library name as recorded in instrumentation and logging
720
+ # @return [::String]
721
+ # @!attribute [rw] lib_version
722
+ # The library version as recorded in instrumentation and logging
723
+ # @return [::String]
724
+ # @!attribute [rw] timeout
725
+ # The call timeout in seconds.
726
+ # @return [::Numeric]
727
+ # @!attribute [rw] metadata
728
+ # Additional headers to be sent with the call.
729
+ # @return [::Hash{::Symbol=>::String}]
730
+ # @!attribute [rw] retry_policy
731
+ # The retry policy. The value is a hash with the following keys:
732
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
733
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
734
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
735
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
736
+ # trigger a retry.
737
+ # @return [::Hash]
738
+ # @!attribute [rw] quota_project
739
+ # A separate project against which to charge quota.
740
+ # @return [::String]
741
+ # @!attribute [rw] universe_domain
742
+ # The universe domain within which to make requests. This determines the
743
+ # default endpoint URL. The default value of nil uses the environment
744
+ # universe (usually the default "googleapis.com" universe).
745
+ # @return [::String,nil]
746
+ # @!attribute [rw] logger
747
+ # A custom logger to use for request/response debug logging, or the value
748
+ # `:default` (the default) to construct a default logger, or `nil` to
749
+ # explicitly disable logging.
750
+ # @return [::Logger,:default,nil]
751
+ #
752
+ class Configuration
753
+ extend ::Gapic::Config
754
+
755
+ # @private
756
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
757
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
758
+
759
+ config_attr :endpoint, nil, ::String, nil
760
+ config_attr :credentials, nil do |value|
761
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
762
+ allowed.any? { |klass| klass === value }
763
+ end
764
+ config_attr :scope, nil, ::String, ::Array, nil
765
+ config_attr :lib_name, nil, ::String, nil
766
+ config_attr :lib_version, nil, ::String, nil
767
+ config_attr :timeout, nil, ::Numeric, nil
768
+ config_attr :metadata, nil, ::Hash, nil
769
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
770
+ config_attr :quota_project, nil, ::String, nil
771
+ config_attr :universe_domain, nil, ::String, nil
772
+ config_attr :logger, :default, ::Logger, nil, :default
773
+
774
+ # @private
775
+ def initialize parent_config = nil
776
+ @parent_config = parent_config unless parent_config.nil?
777
+
778
+ yield self if block_given?
779
+ end
780
+
781
+ ##
782
+ # Configurations for individual RPCs
783
+ # @return [Rpcs]
784
+ #
785
+ def rpcs
786
+ @rpcs ||= begin
787
+ parent_rpcs = nil
788
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
789
+ Rpcs.new parent_rpcs
790
+ end
791
+ end
792
+
793
+ ##
794
+ # Configuration RPC class for the Rollouts API.
795
+ #
796
+ # Includes fields providing the configuration for each RPC in this service.
797
+ # Each configuration object is of type `Gapic::Config::Method` and includes
798
+ # the following configuration fields:
799
+ #
800
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
801
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
802
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
803
+ # include the following keys:
804
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
805
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
806
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
807
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
808
+ # trigger a retry.
809
+ #
810
+ class Rpcs
811
+ ##
812
+ # RPC-specific configuration for `cancel`
813
+ # @return [::Gapic::Config::Method]
814
+ #
815
+ attr_reader :cancel
816
+ ##
817
+ # RPC-specific configuration for `delete`
818
+ # @return [::Gapic::Config::Method]
819
+ #
820
+ attr_reader :delete
821
+ ##
822
+ # RPC-specific configuration for `get`
823
+ # @return [::Gapic::Config::Method]
824
+ #
825
+ attr_reader :get
826
+ ##
827
+ # RPC-specific configuration for `list`
828
+ # @return [::Gapic::Config::Method]
829
+ #
830
+ attr_reader :list
831
+
832
+ # @private
833
+ def initialize parent_rpcs = nil
834
+ cancel_config = parent_rpcs.cancel if parent_rpcs.respond_to? :cancel
835
+ @cancel = ::Gapic::Config::Method.new cancel_config
836
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
837
+ @delete = ::Gapic::Config::Method.new delete_config
838
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
839
+ @get = ::Gapic::Config::Method.new get_config
840
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
841
+ @list = ::Gapic::Config::Method.new list_config
842
+
843
+ yield self if block_given?
844
+ end
845
+ end
846
+ end
847
+ end
848
+ end
849
+ end
850
+ end
851
+ end
852
+ end
853
+ end