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,848 @@
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/rollout_plans/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 RolloutPlans
29
+ module Rest
30
+ ##
31
+ # REST client for the RolloutPlans service.
32
+ #
33
+ # The RolloutPlans 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 :rollout_plans_stub
44
+
45
+ ##
46
+ # Configure the RolloutPlans Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::RolloutPlans::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all RolloutPlans clients
54
+ # ::Google::Cloud::Compute::V1::RolloutPlans::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.delete.timeout = 600.0
75
+
76
+ default_config.rpcs.get.timeout = 600.0
77
+ default_config.rpcs.get.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.insert.timeout = 600.0
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 RolloutPlans 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::RolloutPlans::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
+ @rollout_plans_stub.universe_domain
121
+ end
122
+
123
+ ##
124
+ # Create a new RolloutPlans REST client object.
125
+ #
126
+ # @example
127
+ #
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new
130
+ #
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
135
+ #
136
+ # @yield [config] Configure the RolloutPlans 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
+ @rollout_plans_stub = ::Google::Cloud::Compute::V1::RolloutPlans::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
+ @rollout_plans_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
+ @rollout_plans_stub.logger
202
+ end
203
+
204
+ # Service calls
205
+
206
+ ##
207
+ # Deletes a RolloutPlan.
208
+ #
209
+ # @overload delete(request, options = nil)
210
+ # Pass arguments to `delete` via a request object, either of type
211
+ # {::Google::Cloud::Compute::V1::DeleteRolloutPlanRequest} or an equivalent Hash.
212
+ #
213
+ # @param request [::Google::Cloud::Compute::V1::DeleteRolloutPlanRequest, ::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 delete(project: nil, request_id: nil, rollout_plan: nil)
220
+ # Pass arguments to `delete` 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 rollout_plan [::String]
241
+ # Name of the RolloutPlan resource to delete.
242
+ # @yield [result, operation] Access the result along with the TransportOperation object
243
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
244
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
245
+ #
246
+ # @return [::Gapic::GenericLRO::Operation]
247
+ #
248
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
249
+ #
250
+ # @example Basic example
251
+ # require "google/cloud/compute/v1"
252
+ #
253
+ # # Create a client object. The client can be reused for multiple calls.
254
+ # client = Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new
255
+ #
256
+ # # Create a request. To set request fields, pass in keyword arguments.
257
+ # request = Google::Cloud::Compute::V1::DeleteRolloutPlanRequest.new
258
+ #
259
+ # # Call the delete method.
260
+ # result = client.delete request
261
+ #
262
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
263
+ # p result
264
+ #
265
+ def delete request, options = nil
266
+ raise ::ArgumentError, "request must be provided" if request.nil?
267
+
268
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteRolloutPlanRequest
269
+
270
+ # Converts hash and nil to an options object
271
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
272
+
273
+ # Customize the options with defaults
274
+ call_metadata = @config.rpcs.delete.metadata.to_h
275
+
276
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
277
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
278
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
279
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
280
+ transports_version_send: [:rest]
281
+
282
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
283
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
284
+
285
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
286
+ metadata: call_metadata,
287
+ retry_policy: @config.rpcs.delete.retry_policy
288
+
289
+ options.apply_defaults timeout: @config.timeout,
290
+ metadata: @config.metadata,
291
+ retry_policy: @config.retry_policy
292
+
293
+ @rollout_plans_stub.delete request, options do |result, response|
294
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
295
+ operation: result,
296
+ client: global_operations,
297
+ request_values: {
298
+ "project" => request.project
299
+ },
300
+ options: options
301
+ )
302
+ yield result, response if block_given?
303
+ throw :response, result
304
+ end
305
+ rescue ::Gapic::Rest::Error => e
306
+ raise ::Google::Cloud::Error.from_error(e)
307
+ end
308
+
309
+ ##
310
+ # Gets details of a single project-scoped RolloutPlan.
311
+ #
312
+ # @overload get(request, options = nil)
313
+ # Pass arguments to `get` via a request object, either of type
314
+ # {::Google::Cloud::Compute::V1::GetRolloutPlanRequest} or an equivalent Hash.
315
+ #
316
+ # @param request [::Google::Cloud::Compute::V1::GetRolloutPlanRequest, ::Hash]
317
+ # A request object representing the call parameters. Required. To specify no
318
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
319
+ # @param options [::Gapic::CallOptions, ::Hash]
320
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
321
+ #
322
+ # @overload get(project: nil, rollout_plan: nil)
323
+ # Pass arguments to `get` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param project [::String]
328
+ # Project ID for this request.
329
+ # @param rollout_plan [::String]
330
+ # Name of the persistent rollout plan to return.
331
+ # @yield [result, operation] Access the result along with the TransportOperation object
332
+ # @yieldparam result [::Google::Cloud::Compute::V1::RolloutPlan]
333
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
334
+ #
335
+ # @return [::Google::Cloud::Compute::V1::RolloutPlan]
336
+ #
337
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
338
+ #
339
+ # @example Basic example
340
+ # require "google/cloud/compute/v1"
341
+ #
342
+ # # Create a client object. The client can be reused for multiple calls.
343
+ # client = Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new
344
+ #
345
+ # # Create a request. To set request fields, pass in keyword arguments.
346
+ # request = Google::Cloud::Compute::V1::GetRolloutPlanRequest.new
347
+ #
348
+ # # Call the get method.
349
+ # result = client.get request
350
+ #
351
+ # # The returned object is of type Google::Cloud::Compute::V1::RolloutPlan.
352
+ # p result
353
+ #
354
+ def get request, options = nil
355
+ raise ::ArgumentError, "request must be provided" if request.nil?
356
+
357
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRolloutPlanRequest
358
+
359
+ # Converts hash and nil to an options object
360
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
361
+
362
+ # Customize the options with defaults
363
+ call_metadata = @config.rpcs.get.metadata.to_h
364
+
365
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
366
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
367
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
368
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
369
+ transports_version_send: [:rest]
370
+
371
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
372
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
373
+
374
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
375
+ metadata: call_metadata,
376
+ retry_policy: @config.rpcs.get.retry_policy
377
+
378
+ options.apply_defaults timeout: @config.timeout,
379
+ metadata: @config.metadata,
380
+ retry_policy: @config.retry_policy
381
+
382
+ @rollout_plans_stub.get request, options do |result, operation|
383
+ yield result, operation if block_given?
384
+ end
385
+ rescue ::Gapic::Rest::Error => e
386
+ raise ::Google::Cloud::Error.from_error(e)
387
+ end
388
+
389
+ ##
390
+ # Creates a new RolloutPlan in a given project and location.
391
+ #
392
+ # @overload insert(request, options = nil)
393
+ # Pass arguments to `insert` via a request object, either of type
394
+ # {::Google::Cloud::Compute::V1::InsertRolloutPlanRequest} or an equivalent Hash.
395
+ #
396
+ # @param request [::Google::Cloud::Compute::V1::InsertRolloutPlanRequest, ::Hash]
397
+ # A request object representing the call parameters. Required. To specify no
398
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
399
+ # @param options [::Gapic::CallOptions, ::Hash]
400
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
401
+ #
402
+ # @overload insert(project: nil, request_id: nil, rollout_plan_resource: nil)
403
+ # Pass arguments to `insert` via keyword arguments. Note that at
404
+ # least one keyword argument is required. To specify no parameters, or to keep all
405
+ # the default parameter values, pass an empty Hash as a request object (see above).
406
+ #
407
+ # @param project [::String]
408
+ # Project ID for this request.
409
+ # @param request_id [::String]
410
+ # An optional request ID to identify requests. Specify a unique request ID so
411
+ # that if you must retry your request, the server will know to ignore the
412
+ # request if it has already been completed.
413
+ #
414
+ # For example, consider a situation where you make an initial request and
415
+ # the request times out. If you make the request again with the same
416
+ # request ID, the server can check if original operation with the same
417
+ # request ID was received, and if so, will ignore the second request. This
418
+ # prevents clients from accidentally creating duplicate commitments.
419
+ #
420
+ # The request ID must be
421
+ # a valid UUID with the exception that zero UUID is not supported
422
+ # (00000000-0000-0000-0000-000000000000).
423
+ # @param rollout_plan_resource [::Google::Cloud::Compute::V1::RolloutPlan, ::Hash]
424
+ # The body resource for this request
425
+ # @yield [result, operation] Access the result along with the TransportOperation object
426
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
427
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
428
+ #
429
+ # @return [::Gapic::GenericLRO::Operation]
430
+ #
431
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
432
+ #
433
+ # @example Basic example
434
+ # require "google/cloud/compute/v1"
435
+ #
436
+ # # Create a client object. The client can be reused for multiple calls.
437
+ # client = Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new
438
+ #
439
+ # # Create a request. To set request fields, pass in keyword arguments.
440
+ # request = Google::Cloud::Compute::V1::InsertRolloutPlanRequest.new
441
+ #
442
+ # # Call the insert method.
443
+ # result = client.insert request
444
+ #
445
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
446
+ # p result
447
+ #
448
+ def insert request, options = nil
449
+ raise ::ArgumentError, "request must be provided" if request.nil?
450
+
451
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertRolloutPlanRequest
452
+
453
+ # Converts hash and nil to an options object
454
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
455
+
456
+ # Customize the options with defaults
457
+ call_metadata = @config.rpcs.insert.metadata.to_h
458
+
459
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
460
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
461
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
462
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
463
+ transports_version_send: [:rest]
464
+
465
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
466
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
+
468
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
469
+ metadata: call_metadata,
470
+ retry_policy: @config.rpcs.insert.retry_policy
471
+
472
+ options.apply_defaults timeout: @config.timeout,
473
+ metadata: @config.metadata,
474
+ retry_policy: @config.retry_policy
475
+
476
+ @rollout_plans_stub.insert request, options do |result, response|
477
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
478
+ operation: result,
479
+ client: global_operations,
480
+ request_values: {
481
+ "project" => request.project
482
+ },
483
+ options: options
484
+ )
485
+ yield result, response if block_given?
486
+ throw :response, result
487
+ end
488
+ rescue ::Gapic::Rest::Error => e
489
+ raise ::Google::Cloud::Error.from_error(e)
490
+ end
491
+
492
+ ##
493
+ # Lists RolloutPlans in a given project and location.
494
+ #
495
+ # @overload list(request, options = nil)
496
+ # Pass arguments to `list` via a request object, either of type
497
+ # {::Google::Cloud::Compute::V1::ListRolloutPlansRequest} or an equivalent Hash.
498
+ #
499
+ # @param request [::Google::Cloud::Compute::V1::ListRolloutPlansRequest, ::Hash]
500
+ # A request object representing the call parameters. Required. To specify no
501
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
502
+ # @param options [::Gapic::CallOptions, ::Hash]
503
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
504
+ #
505
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
506
+ # Pass arguments to `list` via keyword arguments. Note that at
507
+ # least one keyword argument is required. To specify no parameters, or to keep all
508
+ # the default parameter values, pass an empty Hash as a request object (see above).
509
+ #
510
+ # @param filter [::String]
511
+ # A filter expression that filters resources listed in the response. Most
512
+ # Compute resources support two types of filter expressions:
513
+ # expressions that support regular expressions and expressions that follow
514
+ # API improvement proposal AIP-160.
515
+ # These two types of filter expressions cannot be mixed in one request.
516
+ #
517
+ # If you want to use AIP-160, your expression must specify the field name, an
518
+ # operator, and the value that you want to use for filtering. The value
519
+ # must be a string, a number, or a boolean. The operator
520
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
521
+ #
522
+ # For example, if you are filtering Compute Engine instances, you can
523
+ # exclude instances named `example-instance` by specifying
524
+ # `name != example-instance`.
525
+ #
526
+ # The `:*` comparison can be used to test whether a key has been defined.
527
+ # For example, to find all objects with `owner` label use:
528
+ # ```
529
+ # labels.owner:*
530
+ # ```
531
+ #
532
+ # You can also filter nested fields. For example, you could specify
533
+ # `scheduling.automaticRestart = false` to include instances only
534
+ # if they are not scheduled for automatic restarts. You can use filtering
535
+ # on nested fields to filter based onresource labels.
536
+ #
537
+ # To filter on multiple expressions, provide each separate expression within
538
+ # parentheses. For example:
539
+ # ```
540
+ # (scheduling.automaticRestart = true)
541
+ # (cpuPlatform = "Intel Skylake")
542
+ # ```
543
+ # By default, each expression is an `AND` expression. However, you
544
+ # can include `AND` and `OR` expressions explicitly.
545
+ # For example:
546
+ # ```
547
+ # (cpuPlatform = "Intel Skylake") OR
548
+ # (cpuPlatform = "Intel Broadwell") AND
549
+ # (scheduling.automaticRestart = true)
550
+ # ```
551
+ #
552
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
553
+ # (not equal) operator against a single un-parenthesized expression with or
554
+ # without quotes or against multiple parenthesized expressions. Examples:
555
+ #
556
+ # `fieldname eq unquoted literal`
557
+ # `fieldname eq 'single quoted literal'`
558
+ # `fieldname eq "double quoted literal"`
559
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
560
+ #
561
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
562
+ # The literal value must match the entire field.
563
+ #
564
+ # For example, to filter for instances that do not end with name "instance",
565
+ # you would use `name ne .*instance`.
566
+ #
567
+ # You cannot combine constraints on multiple fields using regular
568
+ # expressions.
569
+ # @param max_results [::Integer]
570
+ # The maximum number of results per page that should be returned.
571
+ # If the number of available results is larger than `maxResults`,
572
+ # Compute Engine returns a `nextPageToken` that can be used to get
573
+ # the next page of results in subsequent list requests. Acceptable values are
574
+ # `0` to `500`, inclusive. (Default: `500`)
575
+ # @param order_by [::String]
576
+ # Sorts list results by a certain order. By default, results
577
+ # are returned in alphanumerical order based on the resource name.
578
+ #
579
+ # You can also sort results in descending order based on the creation
580
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
581
+ # results based on the `creationTimestamp` field in
582
+ # reverse chronological order (newest result first). Use this to sort
583
+ # resources like operations so that the newest operation is returned first.
584
+ #
585
+ # Currently, only sorting by `name` or
586
+ # `creationTimestamp desc` is supported.
587
+ # @param page_token [::String]
588
+ # Specifies a page token to use. Set `pageToken` to the
589
+ # `nextPageToken` returned by a previous list request to get
590
+ # the next page of results.
591
+ # @param project [::String]
592
+ # Project ID for this request.
593
+ # @param return_partial_success [::Boolean]
594
+ # Opt-in for partial success behavior which provides partial results in case
595
+ # of failure. The default value is false.
596
+ #
597
+ # For example, when partial success behavior is enabled, aggregatedList for a
598
+ # single zone scope either returns all resources in the zone or no resources,
599
+ # with an error code.
600
+ # @yield [result, operation] Access the result along with the TransportOperation object
601
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::RolloutPlan>]
602
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
603
+ #
604
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::RolloutPlan>]
605
+ #
606
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
607
+ #
608
+ # @example Basic example
609
+ # require "google/cloud/compute/v1"
610
+ #
611
+ # # Create a client object. The client can be reused for multiple calls.
612
+ # client = Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new
613
+ #
614
+ # # Create a request. To set request fields, pass in keyword arguments.
615
+ # request = Google::Cloud::Compute::V1::ListRolloutPlansRequest.new
616
+ #
617
+ # # Call the list method.
618
+ # result = client.list request
619
+ #
620
+ # # The returned object is of type Google::Cloud::Compute::V1::RolloutPlansListResponse.
621
+ # p result
622
+ #
623
+ def list request, options = nil
624
+ raise ::ArgumentError, "request must be provided" if request.nil?
625
+
626
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRolloutPlansRequest
627
+
628
+ # Converts hash and nil to an options object
629
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
630
+
631
+ # Customize the options with defaults
632
+ call_metadata = @config.rpcs.list.metadata.to_h
633
+
634
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
635
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
636
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
637
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
638
+ transports_version_send: [:rest]
639
+
640
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
641
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
642
+
643
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
644
+ metadata: call_metadata,
645
+ retry_policy: @config.rpcs.list.retry_policy
646
+
647
+ options.apply_defaults timeout: @config.timeout,
648
+ metadata: @config.metadata,
649
+ retry_policy: @config.retry_policy
650
+
651
+ @rollout_plans_stub.list request, options do |result, operation|
652
+ result = ::Gapic::Rest::PagedEnumerable.new @rollout_plans_stub, :list, "items", request, result, options
653
+ yield result, operation if block_given?
654
+ throw :response, result
655
+ end
656
+ rescue ::Gapic::Rest::Error => e
657
+ raise ::Google::Cloud::Error.from_error(e)
658
+ end
659
+
660
+ ##
661
+ # Configuration class for the RolloutPlans REST API.
662
+ #
663
+ # This class represents the configuration for RolloutPlans REST,
664
+ # providing control over timeouts, retry behavior, logging, transport
665
+ # parameters, and other low-level controls. Certain parameters can also be
666
+ # applied individually to specific RPCs. See
667
+ # {::Google::Cloud::Compute::V1::RolloutPlans::Rest::Client::Configuration::Rpcs}
668
+ # for a list of RPCs that can be configured independently.
669
+ #
670
+ # Configuration can be applied globally to all clients, or to a single client
671
+ # on construction.
672
+ #
673
+ # @example
674
+ #
675
+ # # Modify the global config, setting the timeout for
676
+ # # delete to 20 seconds,
677
+ # # and all remaining timeouts to 10 seconds.
678
+ # ::Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.configure do |config|
679
+ # config.timeout = 10.0
680
+ # config.rpcs.delete.timeout = 20.0
681
+ # end
682
+ #
683
+ # # Apply the above configuration only to a new client.
684
+ # client = ::Google::Cloud::Compute::V1::RolloutPlans::Rest::Client.new do |config|
685
+ # config.timeout = 10.0
686
+ # config.rpcs.delete.timeout = 20.0
687
+ # end
688
+ #
689
+ # @!attribute [rw] endpoint
690
+ # A custom service endpoint, as a hostname or hostname:port. The default is
691
+ # nil, indicating to use the default endpoint in the current universe domain.
692
+ # @return [::String,nil]
693
+ # @!attribute [rw] credentials
694
+ # Credentials to send with calls. You may provide any of the following types:
695
+ # * (`String`) The path to a service account key file in JSON format
696
+ # * (`Hash`) A service account key as a Hash
697
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
698
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
699
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
700
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
701
+ # * (`nil`) indicating no credentials
702
+ #
703
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
704
+ # external source for authentication to Google Cloud, you must validate it before
705
+ # providing it to a Google API client library. Providing an unvalidated credential
706
+ # configuration to Google APIs can compromise the security of your systems and data.
707
+ # For more information, refer to [Validate credential configurations from external
708
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
709
+ # @return [::Object]
710
+ # @!attribute [rw] scope
711
+ # The OAuth scopes
712
+ # @return [::Array<::String>]
713
+ # @!attribute [rw] lib_name
714
+ # The library name as recorded in instrumentation and logging
715
+ # @return [::String]
716
+ # @!attribute [rw] lib_version
717
+ # The library version as recorded in instrumentation and logging
718
+ # @return [::String]
719
+ # @!attribute [rw] timeout
720
+ # The call timeout in seconds.
721
+ # @return [::Numeric]
722
+ # @!attribute [rw] metadata
723
+ # Additional headers to be sent with the call.
724
+ # @return [::Hash{::Symbol=>::String}]
725
+ # @!attribute [rw] retry_policy
726
+ # The retry policy. The value is a hash with the following keys:
727
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
728
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
729
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
730
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
731
+ # trigger a retry.
732
+ # @return [::Hash]
733
+ # @!attribute [rw] quota_project
734
+ # A separate project against which to charge quota.
735
+ # @return [::String]
736
+ # @!attribute [rw] universe_domain
737
+ # The universe domain within which to make requests. This determines the
738
+ # default endpoint URL. The default value of nil uses the environment
739
+ # universe (usually the default "googleapis.com" universe).
740
+ # @return [::String,nil]
741
+ # @!attribute [rw] logger
742
+ # A custom logger to use for request/response debug logging, or the value
743
+ # `:default` (the default) to construct a default logger, or `nil` to
744
+ # explicitly disable logging.
745
+ # @return [::Logger,:default,nil]
746
+ #
747
+ class Configuration
748
+ extend ::Gapic::Config
749
+
750
+ # @private
751
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
752
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
753
+
754
+ config_attr :endpoint, nil, ::String, nil
755
+ config_attr :credentials, nil do |value|
756
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
757
+ allowed.any? { |klass| klass === value }
758
+ end
759
+ config_attr :scope, nil, ::String, ::Array, nil
760
+ config_attr :lib_name, nil, ::String, nil
761
+ config_attr :lib_version, nil, ::String, nil
762
+ config_attr :timeout, nil, ::Numeric, nil
763
+ config_attr :metadata, nil, ::Hash, nil
764
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
765
+ config_attr :quota_project, nil, ::String, nil
766
+ config_attr :universe_domain, nil, ::String, nil
767
+ config_attr :logger, :default, ::Logger, nil, :default
768
+
769
+ # @private
770
+ def initialize parent_config = nil
771
+ @parent_config = parent_config unless parent_config.nil?
772
+
773
+ yield self if block_given?
774
+ end
775
+
776
+ ##
777
+ # Configurations for individual RPCs
778
+ # @return [Rpcs]
779
+ #
780
+ def rpcs
781
+ @rpcs ||= begin
782
+ parent_rpcs = nil
783
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
784
+ Rpcs.new parent_rpcs
785
+ end
786
+ end
787
+
788
+ ##
789
+ # Configuration RPC class for the RolloutPlans API.
790
+ #
791
+ # Includes fields providing the configuration for each RPC in this service.
792
+ # Each configuration object is of type `Gapic::Config::Method` and includes
793
+ # the following configuration fields:
794
+ #
795
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
796
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
797
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
798
+ # include the following keys:
799
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
800
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
801
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
802
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
803
+ # trigger a retry.
804
+ #
805
+ class Rpcs
806
+ ##
807
+ # RPC-specific configuration for `delete`
808
+ # @return [::Gapic::Config::Method]
809
+ #
810
+ attr_reader :delete
811
+ ##
812
+ # RPC-specific configuration for `get`
813
+ # @return [::Gapic::Config::Method]
814
+ #
815
+ attr_reader :get
816
+ ##
817
+ # RPC-specific configuration for `insert`
818
+ # @return [::Gapic::Config::Method]
819
+ #
820
+ attr_reader :insert
821
+ ##
822
+ # RPC-specific configuration for `list`
823
+ # @return [::Gapic::Config::Method]
824
+ #
825
+ attr_reader :list
826
+
827
+ # @private
828
+ def initialize parent_rpcs = nil
829
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
830
+ @delete = ::Gapic::Config::Method.new delete_config
831
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
832
+ @get = ::Gapic::Config::Method.new get_config
833
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
834
+ @insert = ::Gapic::Config::Method.new insert_config
835
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
836
+ @list = ::Gapic::Config::Method.new list_config
837
+
838
+ yield self if block_given?
839
+ end
840
+ end
841
+ end
842
+ end
843
+ end
844
+ end
845
+ end
846
+ end
847
+ end
848
+ end