google-cloud-deploy-v1 0.4.0 → 0.5.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.
@@ -0,0 +1,2221 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/deploy/v1/cloud_deploy_pb"
21
+ require "google/cloud/deploy/v1/cloud_deploy/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module Deploy
28
+ module V1
29
+ module CloudDeploy
30
+ module Rest
31
+ ##
32
+ # REST client for the CloudDeploy service.
33
+ #
34
+ # CloudDeploy service creates and manages Continuous Delivery operations
35
+ # on Google Cloud Platform via Skaffold (https://skaffold.dev).
36
+ #
37
+ class Client
38
+ include Paths
39
+
40
+ # @private
41
+ attr_reader :cloud_deploy_stub
42
+
43
+ ##
44
+ # Configure the CloudDeploy Client class.
45
+ #
46
+ # See {::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all CloudDeploy clients
52
+ # ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "Deploy", "V1"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config.rpcs.list_delivery_pipelines.timeout = 60.0
73
+ default_config.rpcs.list_delivery_pipelines.retry_policy = {
74
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
75
+ }
76
+
77
+ default_config.rpcs.get_delivery_pipeline.timeout = 60.0
78
+ default_config.rpcs.get_delivery_pipeline.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.create_delivery_pipeline.timeout = 60.0
83
+
84
+ default_config.rpcs.update_delivery_pipeline.timeout = 60.0
85
+
86
+ default_config.rpcs.delete_delivery_pipeline.timeout = 60.0
87
+
88
+ default_config.rpcs.list_targets.timeout = 60.0
89
+ default_config.rpcs.list_targets.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.get_target.timeout = 60.0
94
+ default_config.rpcs.get_target.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.create_target.timeout = 60.0
99
+
100
+ default_config.rpcs.update_target.timeout = 60.0
101
+
102
+ default_config.rpcs.delete_target.timeout = 60.0
103
+
104
+ default_config.rpcs.list_releases.timeout = 60.0
105
+ default_config.rpcs.list_releases.retry_policy = {
106
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
107
+ }
108
+
109
+ default_config.rpcs.get_release.timeout = 60.0
110
+ default_config.rpcs.get_release.retry_policy = {
111
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
112
+ }
113
+
114
+ default_config.rpcs.create_release.timeout = 60.0
115
+
116
+ default_config.rpcs.abandon_release.timeout = 60.0
117
+
118
+ default_config.rpcs.approve_rollout.timeout = 60.0
119
+
120
+ default_config.rpcs.list_rollouts.timeout = 60.0
121
+ default_config.rpcs.list_rollouts.retry_policy = {
122
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
123
+ }
124
+
125
+ default_config.rpcs.get_rollout.timeout = 60.0
126
+ default_config.rpcs.get_rollout.retry_policy = {
127
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
128
+ }
129
+
130
+ default_config.rpcs.create_rollout.timeout = 60.0
131
+
132
+ default_config.rpcs.retry_job.timeout = 60.0
133
+
134
+ default_config.rpcs.list_job_runs.timeout = 60.0
135
+ default_config.rpcs.list_job_runs.retry_policy = {
136
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
137
+ }
138
+
139
+ default_config.rpcs.get_job_run.timeout = 60.0
140
+ default_config.rpcs.get_job_run.retry_policy = {
141
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
142
+ }
143
+
144
+ default_config.rpcs.get_config.timeout = 60.0
145
+ default_config.rpcs.get_config.retry_policy = {
146
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
147
+ }
148
+
149
+ default_config
150
+ end
151
+ yield @configure if block_given?
152
+ @configure
153
+ end
154
+
155
+ ##
156
+ # Configure the CloudDeploy Client instance.
157
+ #
158
+ # The configuration is set to the derived mode, meaning that values can be changed,
159
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
160
+ # should be made on {Client.configure}.
161
+ #
162
+ # See {::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client::Configuration}
163
+ # for a description of the configuration fields.
164
+ #
165
+ # @yield [config] Configure the Client client.
166
+ # @yieldparam config [Client::Configuration]
167
+ #
168
+ # @return [Client::Configuration]
169
+ #
170
+ def configure
171
+ yield @config if block_given?
172
+ @config
173
+ end
174
+
175
+ ##
176
+ # Create a new CloudDeploy REST client object.
177
+ #
178
+ # @example
179
+ #
180
+ # # Create a client using the default configuration
181
+ # client = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new
182
+ #
183
+ # # Create a client using a custom configuration
184
+ # client = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new do |config|
185
+ # config.timeout = 10.0
186
+ # end
187
+ #
188
+ # @yield [config] Configure the CloudDeploy client.
189
+ # @yieldparam config [Client::Configuration]
190
+ #
191
+ def initialize
192
+ # Create the configuration object
193
+ @config = Configuration.new Client.configure
194
+
195
+ # Yield the configuration if needed
196
+ yield @config if block_given?
197
+
198
+ # Create credentials
199
+ credentials = @config.credentials
200
+ # Use self-signed JWT if the endpoint is unchanged from default,
201
+ # but only if the default endpoint does not have a region prefix.
202
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
203
+ !@config.endpoint.split(".").first.include?("-")
204
+ credentials ||= Credentials.default scope: @config.scope,
205
+ enable_self_signed_jwt: enable_self_signed_jwt
206
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
207
+ credentials = Credentials.new credentials, scope: @config.scope
208
+ end
209
+
210
+ @quota_project_id = @config.quota_project
211
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
212
+
213
+ @operations_client = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Operations.new do |config|
214
+ config.credentials = credentials
215
+ config.quota_project = @quota_project_id
216
+ config.endpoint = @config.endpoint
217
+ end
218
+
219
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
220
+ config.credentials = credentials
221
+ config.quota_project = @quota_project_id
222
+ config.endpoint = @config.endpoint
223
+ config.bindings_override = @config.bindings_override
224
+ end
225
+
226
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
227
+ config.credentials = credentials
228
+ config.quota_project = @quota_project_id
229
+ config.endpoint = @config.endpoint
230
+ config.bindings_override = @config.bindings_override
231
+ end
232
+
233
+ @cloud_deploy_stub = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
234
+ end
235
+
236
+ ##
237
+ # Get the associated client for long-running operations.
238
+ #
239
+ # @return [::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Operations]
240
+ #
241
+ attr_reader :operations_client
242
+
243
+ ##
244
+ # Get the associated client for mix-in of the Locations.
245
+ #
246
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
247
+ #
248
+ attr_reader :location_client
249
+
250
+ ##
251
+ # Get the associated client for mix-in of the IAMPolicy.
252
+ #
253
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
254
+ #
255
+ attr_reader :iam_policy_client
256
+
257
+ # Service calls
258
+
259
+ ##
260
+ # Lists DeliveryPipelines in a given project and location.
261
+ #
262
+ # @overload list_delivery_pipelines(request, options = nil)
263
+ # Pass arguments to `list_delivery_pipelines` via a request object, either of type
264
+ # {::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest} or an equivalent Hash.
265
+ #
266
+ # @param request [::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest, ::Hash]
267
+ # A request object representing the call parameters. Required. To specify no
268
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
269
+ # @param options [::Gapic::CallOptions, ::Hash]
270
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
271
+ #
272
+ # @overload list_delivery_pipelines(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
273
+ # Pass arguments to `list_delivery_pipelines` via keyword arguments. Note that at
274
+ # least one keyword argument is required. To specify no parameters, or to keep all
275
+ # the default parameter values, pass an empty Hash as a request object (see above).
276
+ #
277
+ # @param parent [::String]
278
+ # Required. The parent, which owns this collection of pipelines. Format must be
279
+ # projects/\\{project_id}/locations/\\{location_name}.
280
+ # @param page_size [::Integer]
281
+ # The maximum number of pipelines to return. The service may return
282
+ # fewer than this value. If unspecified, at most 50 pipelines will
283
+ # be returned. The maximum value is 1000; values above 1000 will be set
284
+ # to 1000.
285
+ # @param page_token [::String]
286
+ # A page token, received from a previous `ListDeliveryPipelines` call.
287
+ # Provide this to retrieve the subsequent page.
288
+ #
289
+ # When paginating, all other provided parameters match
290
+ # the call that provided the page token.
291
+ # @param filter [::String]
292
+ # Filter pipelines to be returned. See https://google.aip.dev/160 for more
293
+ # details.
294
+ # @param order_by [::String]
295
+ # Field to sort by. See https://google.aip.dev/132#ordering for more details.
296
+ # @yield [result, operation] Access the result along with the TransportOperation object
297
+ # @yieldparam result [::Google::Cloud::Deploy::V1::ListDeliveryPipelinesResponse]
298
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
299
+ #
300
+ # @return [::Google::Cloud::Deploy::V1::ListDeliveryPipelinesResponse]
301
+ #
302
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
303
+ def list_delivery_pipelines request, options = nil
304
+ raise ::ArgumentError, "request must be provided" if request.nil?
305
+
306
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest
307
+
308
+ # Converts hash and nil to an options object
309
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
310
+
311
+ # Customize the options with defaults
312
+ call_metadata = @config.rpcs.list_delivery_pipelines.metadata.to_h
313
+
314
+ # Set x-goog-api-client and x-goog-user-project headers
315
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
316
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
317
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
318
+ transports_version_send: [:rest]
319
+
320
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
321
+
322
+ options.apply_defaults timeout: @config.rpcs.list_delivery_pipelines.timeout,
323
+ metadata: call_metadata,
324
+ retry_policy: @config.rpcs.list_delivery_pipelines.retry_policy
325
+
326
+ options.apply_defaults timeout: @config.timeout,
327
+ metadata: @config.metadata,
328
+ retry_policy: @config.retry_policy
329
+
330
+ @cloud_deploy_stub.list_delivery_pipelines request, options do |result, operation|
331
+ yield result, operation if block_given?
332
+ return result
333
+ end
334
+ rescue ::Gapic::Rest::Error => e
335
+ raise ::Google::Cloud::Error.from_error(e)
336
+ end
337
+
338
+ ##
339
+ # Gets details of a single DeliveryPipeline.
340
+ #
341
+ # @overload get_delivery_pipeline(request, options = nil)
342
+ # Pass arguments to `get_delivery_pipeline` via a request object, either of type
343
+ # {::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest} or an equivalent Hash.
344
+ #
345
+ # @param request [::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest, ::Hash]
346
+ # A request object representing the call parameters. Required. To specify no
347
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
348
+ # @param options [::Gapic::CallOptions, ::Hash]
349
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
350
+ #
351
+ # @overload get_delivery_pipeline(name: nil)
352
+ # Pass arguments to `get_delivery_pipeline` via keyword arguments. Note that at
353
+ # least one keyword argument is required. To specify no parameters, or to keep all
354
+ # the default parameter values, pass an empty Hash as a request object (see above).
355
+ #
356
+ # @param name [::String]
357
+ # Required. Name of the `DeliveryPipeline`. Format must be
358
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}.
359
+ # @yield [result, operation] Access the result along with the TransportOperation object
360
+ # @yieldparam result [::Google::Cloud::Deploy::V1::DeliveryPipeline]
361
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
362
+ #
363
+ # @return [::Google::Cloud::Deploy::V1::DeliveryPipeline]
364
+ #
365
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
366
+ def get_delivery_pipeline request, options = nil
367
+ raise ::ArgumentError, "request must be provided" if request.nil?
368
+
369
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest
370
+
371
+ # Converts hash and nil to an options object
372
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
373
+
374
+ # Customize the options with defaults
375
+ call_metadata = @config.rpcs.get_delivery_pipeline.metadata.to_h
376
+
377
+ # Set x-goog-api-client and x-goog-user-project headers
378
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
379
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
380
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
381
+ transports_version_send: [:rest]
382
+
383
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
+
385
+ options.apply_defaults timeout: @config.rpcs.get_delivery_pipeline.timeout,
386
+ metadata: call_metadata,
387
+ retry_policy: @config.rpcs.get_delivery_pipeline.retry_policy
388
+
389
+ options.apply_defaults timeout: @config.timeout,
390
+ metadata: @config.metadata,
391
+ retry_policy: @config.retry_policy
392
+
393
+ @cloud_deploy_stub.get_delivery_pipeline request, options do |result, operation|
394
+ yield result, operation if block_given?
395
+ return result
396
+ end
397
+ rescue ::Gapic::Rest::Error => e
398
+ raise ::Google::Cloud::Error.from_error(e)
399
+ end
400
+
401
+ ##
402
+ # Creates a new DeliveryPipeline in a given project and location.
403
+ #
404
+ # @overload create_delivery_pipeline(request, options = nil)
405
+ # Pass arguments to `create_delivery_pipeline` via a request object, either of type
406
+ # {::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest} or an equivalent Hash.
407
+ #
408
+ # @param request [::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest, ::Hash]
409
+ # A request object representing the call parameters. Required. To specify no
410
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
411
+ # @param options [::Gapic::CallOptions, ::Hash]
412
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
413
+ #
414
+ # @overload create_delivery_pipeline(parent: nil, delivery_pipeline_id: nil, delivery_pipeline: nil, request_id: nil, validate_only: nil)
415
+ # Pass arguments to `create_delivery_pipeline` via keyword arguments. Note that at
416
+ # least one keyword argument is required. To specify no parameters, or to keep all
417
+ # the default parameter values, pass an empty Hash as a request object (see above).
418
+ #
419
+ # @param parent [::String]
420
+ # Required. The parent collection in which the `DeliveryPipeline` should be created.
421
+ # Format should be projects/\\{project_id}/locations/\\{location_name}.
422
+ # @param delivery_pipeline_id [::String]
423
+ # Required. ID of the `DeliveryPipeline`.
424
+ # @param delivery_pipeline [::Google::Cloud::Deploy::V1::DeliveryPipeline, ::Hash]
425
+ # Required. The `DeliveryPipeline` to create.
426
+ # @param request_id [::String]
427
+ # Optional. A request ID to identify requests. Specify a unique request ID
428
+ # so that if you must retry your request, the server will know to ignore
429
+ # the request if it has already been completed. The server will guarantee
430
+ # that for at least 60 minutes since the first request.
431
+ #
432
+ # For example, consider a situation where you make an initial request and the
433
+ # request times out. If you make the request again with the same request ID,
434
+ # the server can check if original operation with the same request ID was
435
+ # received, and if so, will ignore the second request. This prevents clients
436
+ # from accidentally creating duplicate commitments.
437
+ #
438
+ # The request ID must be a valid UUID with the exception that zero UUID is
439
+ # not supported (00000000-0000-0000-0000-000000000000).
440
+ # @param validate_only [::Boolean]
441
+ # Optional. If set to true, the request is validated and the user is provided with
442
+ # an expected result, but no actual change is made.
443
+ # @yield [result, operation] Access the result along with the TransportOperation object
444
+ # @yieldparam result [::Gapic::Operation]
445
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
446
+ #
447
+ # @return [::Gapic::Operation]
448
+ #
449
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
450
+ def create_delivery_pipeline request, options = nil
451
+ raise ::ArgumentError, "request must be provided" if request.nil?
452
+
453
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest
454
+
455
+ # Converts hash and nil to an options object
456
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
457
+
458
+ # Customize the options with defaults
459
+ call_metadata = @config.rpcs.create_delivery_pipeline.metadata.to_h
460
+
461
+ # Set x-goog-api-client and x-goog-user-project headers
462
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
463
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
464
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
465
+ transports_version_send: [:rest]
466
+
467
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
468
+
469
+ options.apply_defaults timeout: @config.rpcs.create_delivery_pipeline.timeout,
470
+ metadata: call_metadata,
471
+ retry_policy: @config.rpcs.create_delivery_pipeline.retry_policy
472
+
473
+ options.apply_defaults timeout: @config.timeout,
474
+ metadata: @config.metadata,
475
+ retry_policy: @config.retry_policy
476
+
477
+ @cloud_deploy_stub.create_delivery_pipeline request, options do |result, operation|
478
+ result = ::Gapic::Operation.new result, @operations_client, options: options
479
+ yield result, operation if block_given?
480
+ return result
481
+ end
482
+ rescue ::Gapic::Rest::Error => e
483
+ raise ::Google::Cloud::Error.from_error(e)
484
+ end
485
+
486
+ ##
487
+ # Updates the parameters of a single DeliveryPipeline.
488
+ #
489
+ # @overload update_delivery_pipeline(request, options = nil)
490
+ # Pass arguments to `update_delivery_pipeline` via a request object, either of type
491
+ # {::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest} or an equivalent Hash.
492
+ #
493
+ # @param request [::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest, ::Hash]
494
+ # A request object representing the call parameters. Required. To specify no
495
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
496
+ # @param options [::Gapic::CallOptions, ::Hash]
497
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
498
+ #
499
+ # @overload update_delivery_pipeline(update_mask: nil, delivery_pipeline: nil, request_id: nil, allow_missing: nil, validate_only: nil)
500
+ # Pass arguments to `update_delivery_pipeline` via keyword arguments. Note that at
501
+ # least one keyword argument is required. To specify no parameters, or to keep all
502
+ # the default parameter values, pass an empty Hash as a request object (see above).
503
+ #
504
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
505
+ # Required. Field mask is used to specify the fields to be overwritten in the
506
+ # `DeliveryPipeline` resource by the update.
507
+ # The fields specified in the update_mask are relative to the resource, not
508
+ # the full request. A field will be overwritten if it is in the mask. If the
509
+ # user does not provide a mask then all fields will be overwritten.
510
+ # @param delivery_pipeline [::Google::Cloud::Deploy::V1::DeliveryPipeline, ::Hash]
511
+ # Required. The `DeliveryPipeline` to update.
512
+ # @param request_id [::String]
513
+ # Optional. A request ID to identify requests. Specify a unique request ID
514
+ # so that if you must retry your request, the server will know to ignore
515
+ # the request if it has already been completed. The server will guarantee
516
+ # that for at least 60 minutes since the first request.
517
+ #
518
+ # For example, consider a situation where you make an initial request and the
519
+ # request times out. If you make the request again with the same request ID,
520
+ # the server can check if original operation with the same request ID was
521
+ # received, and if so, will ignore the second request. This prevents clients
522
+ # from accidentally creating duplicate commitments.
523
+ #
524
+ # The request ID must be a valid UUID with the exception that zero UUID is
525
+ # not supported (00000000-0000-0000-0000-000000000000).
526
+ # @param allow_missing [::Boolean]
527
+ # Optional. If set to true, updating a `DeliveryPipeline` that does not exist will
528
+ # result in the creation of a new `DeliveryPipeline`.
529
+ # @param validate_only [::Boolean]
530
+ # Optional. If set to true, the request is validated and the user is provided with
531
+ # an expected result, but no actual change is made.
532
+ # @yield [result, operation] Access the result along with the TransportOperation object
533
+ # @yieldparam result [::Gapic::Operation]
534
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
535
+ #
536
+ # @return [::Gapic::Operation]
537
+ #
538
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
539
+ def update_delivery_pipeline request, options = nil
540
+ raise ::ArgumentError, "request must be provided" if request.nil?
541
+
542
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest
543
+
544
+ # Converts hash and nil to an options object
545
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
546
+
547
+ # Customize the options with defaults
548
+ call_metadata = @config.rpcs.update_delivery_pipeline.metadata.to_h
549
+
550
+ # Set x-goog-api-client and x-goog-user-project headers
551
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
552
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
553
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
554
+ transports_version_send: [:rest]
555
+
556
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
557
+
558
+ options.apply_defaults timeout: @config.rpcs.update_delivery_pipeline.timeout,
559
+ metadata: call_metadata,
560
+ retry_policy: @config.rpcs.update_delivery_pipeline.retry_policy
561
+
562
+ options.apply_defaults timeout: @config.timeout,
563
+ metadata: @config.metadata,
564
+ retry_policy: @config.retry_policy
565
+
566
+ @cloud_deploy_stub.update_delivery_pipeline request, options do |result, operation|
567
+ result = ::Gapic::Operation.new result, @operations_client, options: options
568
+ yield result, operation if block_given?
569
+ return result
570
+ end
571
+ rescue ::Gapic::Rest::Error => e
572
+ raise ::Google::Cloud::Error.from_error(e)
573
+ end
574
+
575
+ ##
576
+ # Deletes a single DeliveryPipeline.
577
+ #
578
+ # @overload delete_delivery_pipeline(request, options = nil)
579
+ # Pass arguments to `delete_delivery_pipeline` via a request object, either of type
580
+ # {::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest} or an equivalent Hash.
581
+ #
582
+ # @param request [::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest, ::Hash]
583
+ # A request object representing the call parameters. Required. To specify no
584
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
585
+ # @param options [::Gapic::CallOptions, ::Hash]
586
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
587
+ #
588
+ # @overload delete_delivery_pipeline(name: nil, request_id: nil, allow_missing: nil, validate_only: nil, force: nil, etag: nil)
589
+ # Pass arguments to `delete_delivery_pipeline` via keyword arguments. Note that at
590
+ # least one keyword argument is required. To specify no parameters, or to keep all
591
+ # the default parameter values, pass an empty Hash as a request object (see above).
592
+ #
593
+ # @param name [::String]
594
+ # Required. The name of the `DeliveryPipeline` to delete. Format should be
595
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}.
596
+ # @param request_id [::String]
597
+ # Optional. A request ID to identify requests. Specify a unique request ID
598
+ # so that if you must retry your request, the server will know to ignore
599
+ # the request if it has already been completed. The server will guarantee
600
+ # that for at least 60 minutes after the first request.
601
+ #
602
+ # For example, consider a situation where you make an initial request and the
603
+ # request times out. If you make the request again with the same request ID,
604
+ # the server can check if original operation with the same request ID was
605
+ # received, and if so, will ignore the second request. This prevents clients
606
+ # from accidentally creating duplicate commitments.
607
+ #
608
+ # The request ID must be a valid UUID with the exception that zero UUID is
609
+ # not supported (00000000-0000-0000-0000-000000000000).
610
+ # @param allow_missing [::Boolean]
611
+ # Optional. If set to true, then deleting an already deleted or non-existing
612
+ # `DeliveryPipeline` will succeed.
613
+ # @param validate_only [::Boolean]
614
+ # Optional. If set, validate the request and preview the review, but do not actually
615
+ # post it.
616
+ # @param force [::Boolean]
617
+ # Optional. If set to true, all child resources under this pipeline will also be
618
+ # deleted. Otherwise, the request will only work if the pipeline has
619
+ # no child resources.
620
+ # @param etag [::String]
621
+ # Optional. This checksum is computed by the server based on the value of other
622
+ # fields, and may be sent on update and delete requests to ensure the
623
+ # client has an up-to-date value before proceeding.
624
+ # @yield [result, operation] Access the result along with the TransportOperation object
625
+ # @yieldparam result [::Gapic::Operation]
626
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
627
+ #
628
+ # @return [::Gapic::Operation]
629
+ #
630
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
631
+ def delete_delivery_pipeline request, options = nil
632
+ raise ::ArgumentError, "request must be provided" if request.nil?
633
+
634
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest
635
+
636
+ # Converts hash and nil to an options object
637
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
638
+
639
+ # Customize the options with defaults
640
+ call_metadata = @config.rpcs.delete_delivery_pipeline.metadata.to_h
641
+
642
+ # Set x-goog-api-client and x-goog-user-project headers
643
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
644
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
645
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
646
+ transports_version_send: [:rest]
647
+
648
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
649
+
650
+ options.apply_defaults timeout: @config.rpcs.delete_delivery_pipeline.timeout,
651
+ metadata: call_metadata,
652
+ retry_policy: @config.rpcs.delete_delivery_pipeline.retry_policy
653
+
654
+ options.apply_defaults timeout: @config.timeout,
655
+ metadata: @config.metadata,
656
+ retry_policy: @config.retry_policy
657
+
658
+ @cloud_deploy_stub.delete_delivery_pipeline request, options do |result, operation|
659
+ result = ::Gapic::Operation.new result, @operations_client, options: options
660
+ yield result, operation if block_given?
661
+ return result
662
+ end
663
+ rescue ::Gapic::Rest::Error => e
664
+ raise ::Google::Cloud::Error.from_error(e)
665
+ end
666
+
667
+ ##
668
+ # Lists Targets in a given project and location.
669
+ #
670
+ # @overload list_targets(request, options = nil)
671
+ # Pass arguments to `list_targets` via a request object, either of type
672
+ # {::Google::Cloud::Deploy::V1::ListTargetsRequest} or an equivalent Hash.
673
+ #
674
+ # @param request [::Google::Cloud::Deploy::V1::ListTargetsRequest, ::Hash]
675
+ # A request object representing the call parameters. Required. To specify no
676
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
677
+ # @param options [::Gapic::CallOptions, ::Hash]
678
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
679
+ #
680
+ # @overload list_targets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
681
+ # Pass arguments to `list_targets` via keyword arguments. Note that at
682
+ # least one keyword argument is required. To specify no parameters, or to keep all
683
+ # the default parameter values, pass an empty Hash as a request object (see above).
684
+ #
685
+ # @param parent [::String]
686
+ # Required. The parent, which owns this collection of targets. Format must be
687
+ # projects/\\{project_id}/locations/\\{location_name}.
688
+ # @param page_size [::Integer]
689
+ # Optional. The maximum number of `Target` objects to return. The service may return
690
+ # fewer than this value. If unspecified, at most 50 `Target` objects will be
691
+ # returned. The maximum value is 1000; values above 1000 will be set to 1000.
692
+ # @param page_token [::String]
693
+ # Optional. A page token, received from a previous `ListTargets` call.
694
+ # Provide this to retrieve the subsequent page.
695
+ #
696
+ # When paginating, all other provided parameters match
697
+ # the call that provided the page token.
698
+ # @param filter [::String]
699
+ # Optional. Filter targets to be returned. See https://google.aip.dev/160 for more
700
+ # details.
701
+ # @param order_by [::String]
702
+ # Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
703
+ # @yield [result, operation] Access the result along with the TransportOperation object
704
+ # @yieldparam result [::Google::Cloud::Deploy::V1::ListTargetsResponse]
705
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
706
+ #
707
+ # @return [::Google::Cloud::Deploy::V1::ListTargetsResponse]
708
+ #
709
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
710
+ def list_targets request, options = nil
711
+ raise ::ArgumentError, "request must be provided" if request.nil?
712
+
713
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListTargetsRequest
714
+
715
+ # Converts hash and nil to an options object
716
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
717
+
718
+ # Customize the options with defaults
719
+ call_metadata = @config.rpcs.list_targets.metadata.to_h
720
+
721
+ # Set x-goog-api-client and x-goog-user-project headers
722
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
723
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
724
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
725
+ transports_version_send: [:rest]
726
+
727
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
728
+
729
+ options.apply_defaults timeout: @config.rpcs.list_targets.timeout,
730
+ metadata: call_metadata,
731
+ retry_policy: @config.rpcs.list_targets.retry_policy
732
+
733
+ options.apply_defaults timeout: @config.timeout,
734
+ metadata: @config.metadata,
735
+ retry_policy: @config.retry_policy
736
+
737
+ @cloud_deploy_stub.list_targets request, options do |result, operation|
738
+ yield result, operation if block_given?
739
+ return result
740
+ end
741
+ rescue ::Gapic::Rest::Error => e
742
+ raise ::Google::Cloud::Error.from_error(e)
743
+ end
744
+
745
+ ##
746
+ # Gets details of a single Target.
747
+ #
748
+ # @overload get_target(request, options = nil)
749
+ # Pass arguments to `get_target` via a request object, either of type
750
+ # {::Google::Cloud::Deploy::V1::GetTargetRequest} or an equivalent Hash.
751
+ #
752
+ # @param request [::Google::Cloud::Deploy::V1::GetTargetRequest, ::Hash]
753
+ # A request object representing the call parameters. Required. To specify no
754
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
755
+ # @param options [::Gapic::CallOptions, ::Hash]
756
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
757
+ #
758
+ # @overload get_target(name: nil)
759
+ # Pass arguments to `get_target` via keyword arguments. Note that at
760
+ # least one keyword argument is required. To specify no parameters, or to keep all
761
+ # the default parameter values, pass an empty Hash as a request object (see above).
762
+ #
763
+ # @param name [::String]
764
+ # Required. Name of the `Target`. Format must be
765
+ # projects/\\{project_id}/locations/\\{location_name}/targets/\\{target_name}.
766
+ # @yield [result, operation] Access the result along with the TransportOperation object
767
+ # @yieldparam result [::Google::Cloud::Deploy::V1::Target]
768
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
769
+ #
770
+ # @return [::Google::Cloud::Deploy::V1::Target]
771
+ #
772
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
773
+ def get_target request, options = nil
774
+ raise ::ArgumentError, "request must be provided" if request.nil?
775
+
776
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetTargetRequest
777
+
778
+ # Converts hash and nil to an options object
779
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
780
+
781
+ # Customize the options with defaults
782
+ call_metadata = @config.rpcs.get_target.metadata.to_h
783
+
784
+ # Set x-goog-api-client and x-goog-user-project headers
785
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
786
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
787
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
788
+ transports_version_send: [:rest]
789
+
790
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
791
+
792
+ options.apply_defaults timeout: @config.rpcs.get_target.timeout,
793
+ metadata: call_metadata,
794
+ retry_policy: @config.rpcs.get_target.retry_policy
795
+
796
+ options.apply_defaults timeout: @config.timeout,
797
+ metadata: @config.metadata,
798
+ retry_policy: @config.retry_policy
799
+
800
+ @cloud_deploy_stub.get_target request, options do |result, operation|
801
+ yield result, operation if block_given?
802
+ return result
803
+ end
804
+ rescue ::Gapic::Rest::Error => e
805
+ raise ::Google::Cloud::Error.from_error(e)
806
+ end
807
+
808
+ ##
809
+ # Creates a new Target in a given project and location.
810
+ #
811
+ # @overload create_target(request, options = nil)
812
+ # Pass arguments to `create_target` via a request object, either of type
813
+ # {::Google::Cloud::Deploy::V1::CreateTargetRequest} or an equivalent Hash.
814
+ #
815
+ # @param request [::Google::Cloud::Deploy::V1::CreateTargetRequest, ::Hash]
816
+ # A request object representing the call parameters. Required. To specify no
817
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
818
+ # @param options [::Gapic::CallOptions, ::Hash]
819
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
820
+ #
821
+ # @overload create_target(parent: nil, target_id: nil, target: nil, request_id: nil, validate_only: nil)
822
+ # Pass arguments to `create_target` via keyword arguments. Note that at
823
+ # least one keyword argument is required. To specify no parameters, or to keep all
824
+ # the default parameter values, pass an empty Hash as a request object (see above).
825
+ #
826
+ # @param parent [::String]
827
+ # Required. The parent collection in which the `Target` should be created.
828
+ # Format should be
829
+ # projects/\\{project_id}/locations/\\{location_name}.
830
+ # @param target_id [::String]
831
+ # Required. ID of the `Target`.
832
+ # @param target [::Google::Cloud::Deploy::V1::Target, ::Hash]
833
+ # Required. The `Target` to create.
834
+ # @param request_id [::String]
835
+ # Optional. A request ID to identify requests. Specify a unique request ID
836
+ # so that if you must retry your request, the server will know to ignore
837
+ # the request if it has already been completed. The server will guarantee
838
+ # that for at least 60 minutes since the first request.
839
+ #
840
+ # For example, consider a situation where you make an initial request and the
841
+ # request times out. If you make the request again with the same request ID,
842
+ # the server can check if original operation with the same request ID was
843
+ # received, and if so, will ignore the second request. This prevents clients
844
+ # from accidentally creating duplicate commitments.
845
+ #
846
+ # The request ID must be a valid UUID with the exception that zero UUID is
847
+ # not supported (00000000-0000-0000-0000-000000000000).
848
+ # @param validate_only [::Boolean]
849
+ # Optional. If set to true, the request is validated and the user is provided with
850
+ # an expected result, but no actual change is made.
851
+ # @yield [result, operation] Access the result along with the TransportOperation object
852
+ # @yieldparam result [::Gapic::Operation]
853
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
854
+ #
855
+ # @return [::Gapic::Operation]
856
+ #
857
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
858
+ def create_target request, options = nil
859
+ raise ::ArgumentError, "request must be provided" if request.nil?
860
+
861
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateTargetRequest
862
+
863
+ # Converts hash and nil to an options object
864
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
865
+
866
+ # Customize the options with defaults
867
+ call_metadata = @config.rpcs.create_target.metadata.to_h
868
+
869
+ # Set x-goog-api-client and x-goog-user-project headers
870
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
871
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
872
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
873
+ transports_version_send: [:rest]
874
+
875
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
876
+
877
+ options.apply_defaults timeout: @config.rpcs.create_target.timeout,
878
+ metadata: call_metadata,
879
+ retry_policy: @config.rpcs.create_target.retry_policy
880
+
881
+ options.apply_defaults timeout: @config.timeout,
882
+ metadata: @config.metadata,
883
+ retry_policy: @config.retry_policy
884
+
885
+ @cloud_deploy_stub.create_target request, options do |result, operation|
886
+ result = ::Gapic::Operation.new result, @operations_client, options: options
887
+ yield result, operation if block_given?
888
+ return result
889
+ end
890
+ rescue ::Gapic::Rest::Error => e
891
+ raise ::Google::Cloud::Error.from_error(e)
892
+ end
893
+
894
+ ##
895
+ # Updates the parameters of a single Target.
896
+ #
897
+ # @overload update_target(request, options = nil)
898
+ # Pass arguments to `update_target` via a request object, either of type
899
+ # {::Google::Cloud::Deploy::V1::UpdateTargetRequest} or an equivalent Hash.
900
+ #
901
+ # @param request [::Google::Cloud::Deploy::V1::UpdateTargetRequest, ::Hash]
902
+ # A request object representing the call parameters. Required. To specify no
903
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
904
+ # @param options [::Gapic::CallOptions, ::Hash]
905
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
906
+ #
907
+ # @overload update_target(update_mask: nil, target: nil, request_id: nil, allow_missing: nil, validate_only: nil)
908
+ # Pass arguments to `update_target` via keyword arguments. Note that at
909
+ # least one keyword argument is required. To specify no parameters, or to keep all
910
+ # the default parameter values, pass an empty Hash as a request object (see above).
911
+ #
912
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
913
+ # Required. Field mask is used to specify the fields to be overwritten in the
914
+ # Target resource by the update.
915
+ # The fields specified in the update_mask are relative to the resource, not
916
+ # the full request. A field will be overwritten if it is in the mask. If the
917
+ # user does not provide a mask then all fields will be overwritten.
918
+ # @param target [::Google::Cloud::Deploy::V1::Target, ::Hash]
919
+ # Required. The `Target` to update.
920
+ # @param request_id [::String]
921
+ # Optional. A request ID to identify requests. Specify a unique request ID
922
+ # so that if you must retry your request, the server will know to ignore
923
+ # the request if it has already been completed. The server will guarantee
924
+ # that for at least 60 minutes since the first request.
925
+ #
926
+ # For example, consider a situation where you make an initial request and the
927
+ # request times out. If you make the request again with the same request ID,
928
+ # the server can check if original operation with the same request ID was
929
+ # received, and if so, will ignore the second request. This prevents clients
930
+ # from accidentally creating duplicate commitments.
931
+ #
932
+ # The request ID must be a valid UUID with the exception that zero UUID is
933
+ # not supported (00000000-0000-0000-0000-000000000000).
934
+ # @param allow_missing [::Boolean]
935
+ # Optional. If set to true, updating a `Target` that does not exist will
936
+ # result in the creation of a new `Target`.
937
+ # @param validate_only [::Boolean]
938
+ # Optional. If set to true, the request is validated and the user is provided with
939
+ # an expected result, but no actual change is made.
940
+ # @yield [result, operation] Access the result along with the TransportOperation object
941
+ # @yieldparam result [::Gapic::Operation]
942
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
943
+ #
944
+ # @return [::Gapic::Operation]
945
+ #
946
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
947
+ def update_target request, options = nil
948
+ raise ::ArgumentError, "request must be provided" if request.nil?
949
+
950
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::UpdateTargetRequest
951
+
952
+ # Converts hash and nil to an options object
953
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
954
+
955
+ # Customize the options with defaults
956
+ call_metadata = @config.rpcs.update_target.metadata.to_h
957
+
958
+ # Set x-goog-api-client and x-goog-user-project headers
959
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
960
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
961
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
962
+ transports_version_send: [:rest]
963
+
964
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
965
+
966
+ options.apply_defaults timeout: @config.rpcs.update_target.timeout,
967
+ metadata: call_metadata,
968
+ retry_policy: @config.rpcs.update_target.retry_policy
969
+
970
+ options.apply_defaults timeout: @config.timeout,
971
+ metadata: @config.metadata,
972
+ retry_policy: @config.retry_policy
973
+
974
+ @cloud_deploy_stub.update_target request, options do |result, operation|
975
+ result = ::Gapic::Operation.new result, @operations_client, options: options
976
+ yield result, operation if block_given?
977
+ return result
978
+ end
979
+ rescue ::Gapic::Rest::Error => e
980
+ raise ::Google::Cloud::Error.from_error(e)
981
+ end
982
+
983
+ ##
984
+ # Deletes a single Target.
985
+ #
986
+ # @overload delete_target(request, options = nil)
987
+ # Pass arguments to `delete_target` via a request object, either of type
988
+ # {::Google::Cloud::Deploy::V1::DeleteTargetRequest} or an equivalent Hash.
989
+ #
990
+ # @param request [::Google::Cloud::Deploy::V1::DeleteTargetRequest, ::Hash]
991
+ # A request object representing the call parameters. Required. To specify no
992
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
993
+ # @param options [::Gapic::CallOptions, ::Hash]
994
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
995
+ #
996
+ # @overload delete_target(name: nil, request_id: nil, allow_missing: nil, validate_only: nil, etag: nil)
997
+ # Pass arguments to `delete_target` via keyword arguments. Note that at
998
+ # least one keyword argument is required. To specify no parameters, or to keep all
999
+ # the default parameter values, pass an empty Hash as a request object (see above).
1000
+ #
1001
+ # @param name [::String]
1002
+ # Required. The name of the `Target` to delete. Format should be
1003
+ # projects/\\{project_id}/locations/\\{location_name}/targets/\\{target_name}.
1004
+ # @param request_id [::String]
1005
+ # Optional. A request ID to identify requests. Specify a unique request ID
1006
+ # so that if you must retry your request, the server will know to ignore
1007
+ # the request if it has already been completed. The server will guarantee
1008
+ # that for at least 60 minutes after the first request.
1009
+ #
1010
+ # For example, consider a situation where you make an initial request and the
1011
+ # request times out. If you make the request again with the same request ID,
1012
+ # the server can check if original operation with the same request ID was
1013
+ # received, and if so, will ignore the second request. This prevents clients
1014
+ # from accidentally creating duplicate commitments.
1015
+ #
1016
+ # The request ID must be a valid UUID with the exception that zero UUID is
1017
+ # not supported (00000000-0000-0000-0000-000000000000).
1018
+ # @param allow_missing [::Boolean]
1019
+ # Optional. If set to true, then deleting an already deleted or non-existing
1020
+ # DeliveryPipeline will succeed.
1021
+ # @param validate_only [::Boolean]
1022
+ # Optional. If set, validate the request and preview the review, but do not actually
1023
+ # post it.
1024
+ # @param etag [::String]
1025
+ # Optional. This checksum is computed by the server based on the value of other
1026
+ # fields, and may be sent on update and delete requests to ensure the
1027
+ # client has an up-to-date value before proceeding.
1028
+ # @yield [result, operation] Access the result along with the TransportOperation object
1029
+ # @yieldparam result [::Gapic::Operation]
1030
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1031
+ #
1032
+ # @return [::Gapic::Operation]
1033
+ #
1034
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1035
+ def delete_target request, options = nil
1036
+ raise ::ArgumentError, "request must be provided" if request.nil?
1037
+
1038
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::DeleteTargetRequest
1039
+
1040
+ # Converts hash and nil to an options object
1041
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1042
+
1043
+ # Customize the options with defaults
1044
+ call_metadata = @config.rpcs.delete_target.metadata.to_h
1045
+
1046
+ # Set x-goog-api-client and x-goog-user-project headers
1047
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1048
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1049
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1050
+ transports_version_send: [:rest]
1051
+
1052
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1053
+
1054
+ options.apply_defaults timeout: @config.rpcs.delete_target.timeout,
1055
+ metadata: call_metadata,
1056
+ retry_policy: @config.rpcs.delete_target.retry_policy
1057
+
1058
+ options.apply_defaults timeout: @config.timeout,
1059
+ metadata: @config.metadata,
1060
+ retry_policy: @config.retry_policy
1061
+
1062
+ @cloud_deploy_stub.delete_target request, options do |result, operation|
1063
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1064
+ yield result, operation if block_given?
1065
+ return result
1066
+ end
1067
+ rescue ::Gapic::Rest::Error => e
1068
+ raise ::Google::Cloud::Error.from_error(e)
1069
+ end
1070
+
1071
+ ##
1072
+ # Lists Releases in a given project and location.
1073
+ #
1074
+ # @overload list_releases(request, options = nil)
1075
+ # Pass arguments to `list_releases` via a request object, either of type
1076
+ # {::Google::Cloud::Deploy::V1::ListReleasesRequest} or an equivalent Hash.
1077
+ #
1078
+ # @param request [::Google::Cloud::Deploy::V1::ListReleasesRequest, ::Hash]
1079
+ # A request object representing the call parameters. Required. To specify no
1080
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1081
+ # @param options [::Gapic::CallOptions, ::Hash]
1082
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1083
+ #
1084
+ # @overload list_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1085
+ # Pass arguments to `list_releases` via keyword arguments. Note that at
1086
+ # least one keyword argument is required. To specify no parameters, or to keep all
1087
+ # the default parameter values, pass an empty Hash as a request object (see above).
1088
+ #
1089
+ # @param parent [::String]
1090
+ # Required. The `DeliveryPipeline` which owns this collection of `Release` objects.
1091
+ # @param page_size [::Integer]
1092
+ # Optional. The maximum number of `Release` objects to return. The service may return
1093
+ # fewer than this value. If unspecified, at most 50 `Release` objects will be
1094
+ # returned. The maximum value is 1000; values above 1000 will be set to 1000.
1095
+ # @param page_token [::String]
1096
+ # Optional. A page token, received from a previous `ListReleases` call.
1097
+ # Provide this to retrieve the subsequent page.
1098
+ #
1099
+ # When paginating, all other provided parameters match
1100
+ # the call that provided the page token.
1101
+ # @param filter [::String]
1102
+ # Optional. Filter releases to be returned. See https://google.aip.dev/160 for more
1103
+ # details.
1104
+ # @param order_by [::String]
1105
+ # Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
1106
+ # @yield [result, operation] Access the result along with the TransportOperation object
1107
+ # @yieldparam result [::Google::Cloud::Deploy::V1::ListReleasesResponse]
1108
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1109
+ #
1110
+ # @return [::Google::Cloud::Deploy::V1::ListReleasesResponse]
1111
+ #
1112
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1113
+ def list_releases request, options = nil
1114
+ raise ::ArgumentError, "request must be provided" if request.nil?
1115
+
1116
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListReleasesRequest
1117
+
1118
+ # Converts hash and nil to an options object
1119
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1120
+
1121
+ # Customize the options with defaults
1122
+ call_metadata = @config.rpcs.list_releases.metadata.to_h
1123
+
1124
+ # Set x-goog-api-client and x-goog-user-project headers
1125
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1126
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1127
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1128
+ transports_version_send: [:rest]
1129
+
1130
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1131
+
1132
+ options.apply_defaults timeout: @config.rpcs.list_releases.timeout,
1133
+ metadata: call_metadata,
1134
+ retry_policy: @config.rpcs.list_releases.retry_policy
1135
+
1136
+ options.apply_defaults timeout: @config.timeout,
1137
+ metadata: @config.metadata,
1138
+ retry_policy: @config.retry_policy
1139
+
1140
+ @cloud_deploy_stub.list_releases request, options do |result, operation|
1141
+ yield result, operation if block_given?
1142
+ return result
1143
+ end
1144
+ rescue ::Gapic::Rest::Error => e
1145
+ raise ::Google::Cloud::Error.from_error(e)
1146
+ end
1147
+
1148
+ ##
1149
+ # Gets details of a single Release.
1150
+ #
1151
+ # @overload get_release(request, options = nil)
1152
+ # Pass arguments to `get_release` via a request object, either of type
1153
+ # {::Google::Cloud::Deploy::V1::GetReleaseRequest} or an equivalent Hash.
1154
+ #
1155
+ # @param request [::Google::Cloud::Deploy::V1::GetReleaseRequest, ::Hash]
1156
+ # A request object representing the call parameters. Required. To specify no
1157
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1158
+ # @param options [::Gapic::CallOptions, ::Hash]
1159
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1160
+ #
1161
+ # @overload get_release(name: nil)
1162
+ # Pass arguments to `get_release` via keyword arguments. Note that at
1163
+ # least one keyword argument is required. To specify no parameters, or to keep all
1164
+ # the default parameter values, pass an empty Hash as a request object (see above).
1165
+ #
1166
+ # @param name [::String]
1167
+ # Required. Name of the `Release`. Format must be
1168
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}.
1169
+ # @yield [result, operation] Access the result along with the TransportOperation object
1170
+ # @yieldparam result [::Google::Cloud::Deploy::V1::Release]
1171
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1172
+ #
1173
+ # @return [::Google::Cloud::Deploy::V1::Release]
1174
+ #
1175
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1176
+ def get_release request, options = nil
1177
+ raise ::ArgumentError, "request must be provided" if request.nil?
1178
+
1179
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetReleaseRequest
1180
+
1181
+ # Converts hash and nil to an options object
1182
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1183
+
1184
+ # Customize the options with defaults
1185
+ call_metadata = @config.rpcs.get_release.metadata.to_h
1186
+
1187
+ # Set x-goog-api-client and x-goog-user-project headers
1188
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1189
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1190
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1191
+ transports_version_send: [:rest]
1192
+
1193
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1194
+
1195
+ options.apply_defaults timeout: @config.rpcs.get_release.timeout,
1196
+ metadata: call_metadata,
1197
+ retry_policy: @config.rpcs.get_release.retry_policy
1198
+
1199
+ options.apply_defaults timeout: @config.timeout,
1200
+ metadata: @config.metadata,
1201
+ retry_policy: @config.retry_policy
1202
+
1203
+ @cloud_deploy_stub.get_release request, options do |result, operation|
1204
+ yield result, operation if block_given?
1205
+ return result
1206
+ end
1207
+ rescue ::Gapic::Rest::Error => e
1208
+ raise ::Google::Cloud::Error.from_error(e)
1209
+ end
1210
+
1211
+ ##
1212
+ # Creates a new Release in a given project and location.
1213
+ #
1214
+ # @overload create_release(request, options = nil)
1215
+ # Pass arguments to `create_release` via a request object, either of type
1216
+ # {::Google::Cloud::Deploy::V1::CreateReleaseRequest} or an equivalent Hash.
1217
+ #
1218
+ # @param request [::Google::Cloud::Deploy::V1::CreateReleaseRequest, ::Hash]
1219
+ # A request object representing the call parameters. Required. To specify no
1220
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1221
+ # @param options [::Gapic::CallOptions, ::Hash]
1222
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1223
+ #
1224
+ # @overload create_release(parent: nil, release_id: nil, release: nil, request_id: nil, validate_only: nil)
1225
+ # Pass arguments to `create_release` via keyword arguments. Note that at
1226
+ # least one keyword argument is required. To specify no parameters, or to keep all
1227
+ # the default parameter values, pass an empty Hash as a request object (see above).
1228
+ #
1229
+ # @param parent [::String]
1230
+ # Required. The parent collection in which the `Release` should be created.
1231
+ # Format should be
1232
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}.
1233
+ # @param release_id [::String]
1234
+ # Required. ID of the `Release`.
1235
+ # @param release [::Google::Cloud::Deploy::V1::Release, ::Hash]
1236
+ # Required. The `Release` to create.
1237
+ # @param request_id [::String]
1238
+ # Optional. A request ID to identify requests. Specify a unique request ID
1239
+ # so that if you must retry your request, the server will know to ignore
1240
+ # the request if it has already been completed. The server will guarantee
1241
+ # that for at least 60 minutes since the first request.
1242
+ #
1243
+ # For example, consider a situation where you make an initial request and the
1244
+ # request times out. If you make the request again with the same request ID,
1245
+ # the server can check if original operation with the same request ID was
1246
+ # received, and if so, will ignore the second request. This prevents clients
1247
+ # from accidentally creating duplicate commitments.
1248
+ #
1249
+ # The request ID must be a valid UUID with the exception that zero UUID is
1250
+ # not supported (00000000-0000-0000-0000-000000000000).
1251
+ # @param validate_only [::Boolean]
1252
+ # Optional. If set to true, the request is validated and the user is provided with
1253
+ # an expected result, but no actual change is made.
1254
+ # @yield [result, operation] Access the result along with the TransportOperation object
1255
+ # @yieldparam result [::Gapic::Operation]
1256
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1257
+ #
1258
+ # @return [::Gapic::Operation]
1259
+ #
1260
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1261
+ def create_release request, options = nil
1262
+ raise ::ArgumentError, "request must be provided" if request.nil?
1263
+
1264
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateReleaseRequest
1265
+
1266
+ # Converts hash and nil to an options object
1267
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1268
+
1269
+ # Customize the options with defaults
1270
+ call_metadata = @config.rpcs.create_release.metadata.to_h
1271
+
1272
+ # Set x-goog-api-client and x-goog-user-project headers
1273
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1274
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1275
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1276
+ transports_version_send: [:rest]
1277
+
1278
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1279
+
1280
+ options.apply_defaults timeout: @config.rpcs.create_release.timeout,
1281
+ metadata: call_metadata,
1282
+ retry_policy: @config.rpcs.create_release.retry_policy
1283
+
1284
+ options.apply_defaults timeout: @config.timeout,
1285
+ metadata: @config.metadata,
1286
+ retry_policy: @config.retry_policy
1287
+
1288
+ @cloud_deploy_stub.create_release request, options do |result, operation|
1289
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1290
+ yield result, operation if block_given?
1291
+ return result
1292
+ end
1293
+ rescue ::Gapic::Rest::Error => e
1294
+ raise ::Google::Cloud::Error.from_error(e)
1295
+ end
1296
+
1297
+ ##
1298
+ # Abandons a Release in the Delivery Pipeline.
1299
+ #
1300
+ # @overload abandon_release(request, options = nil)
1301
+ # Pass arguments to `abandon_release` via a request object, either of type
1302
+ # {::Google::Cloud::Deploy::V1::AbandonReleaseRequest} or an equivalent Hash.
1303
+ #
1304
+ # @param request [::Google::Cloud::Deploy::V1::AbandonReleaseRequest, ::Hash]
1305
+ # A request object representing the call parameters. Required. To specify no
1306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1307
+ # @param options [::Gapic::CallOptions, ::Hash]
1308
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1309
+ #
1310
+ # @overload abandon_release(name: nil)
1311
+ # Pass arguments to `abandon_release` via keyword arguments. Note that at
1312
+ # least one keyword argument is required. To specify no parameters, or to keep all
1313
+ # the default parameter values, pass an empty Hash as a request object (see above).
1314
+ #
1315
+ # @param name [::String]
1316
+ # Required. Name of the Release. Format is
1317
+ # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/
1318
+ # releases/\\{release}.
1319
+ # @yield [result, operation] Access the result along with the TransportOperation object
1320
+ # @yieldparam result [::Google::Cloud::Deploy::V1::AbandonReleaseResponse]
1321
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1322
+ #
1323
+ # @return [::Google::Cloud::Deploy::V1::AbandonReleaseResponse]
1324
+ #
1325
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1326
+ def abandon_release request, options = nil
1327
+ raise ::ArgumentError, "request must be provided" if request.nil?
1328
+
1329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::AbandonReleaseRequest
1330
+
1331
+ # Converts hash and nil to an options object
1332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1333
+
1334
+ # Customize the options with defaults
1335
+ call_metadata = @config.rpcs.abandon_release.metadata.to_h
1336
+
1337
+ # Set x-goog-api-client and x-goog-user-project headers
1338
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1340
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1341
+ transports_version_send: [:rest]
1342
+
1343
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1344
+
1345
+ options.apply_defaults timeout: @config.rpcs.abandon_release.timeout,
1346
+ metadata: call_metadata,
1347
+ retry_policy: @config.rpcs.abandon_release.retry_policy
1348
+
1349
+ options.apply_defaults timeout: @config.timeout,
1350
+ metadata: @config.metadata,
1351
+ retry_policy: @config.retry_policy
1352
+
1353
+ @cloud_deploy_stub.abandon_release request, options do |result, operation|
1354
+ yield result, operation if block_given?
1355
+ return result
1356
+ end
1357
+ rescue ::Gapic::Rest::Error => e
1358
+ raise ::Google::Cloud::Error.from_error(e)
1359
+ end
1360
+
1361
+ ##
1362
+ # Approves a Rollout.
1363
+ #
1364
+ # @overload approve_rollout(request, options = nil)
1365
+ # Pass arguments to `approve_rollout` via a request object, either of type
1366
+ # {::Google::Cloud::Deploy::V1::ApproveRolloutRequest} or an equivalent Hash.
1367
+ #
1368
+ # @param request [::Google::Cloud::Deploy::V1::ApproveRolloutRequest, ::Hash]
1369
+ # A request object representing the call parameters. Required. To specify no
1370
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1371
+ # @param options [::Gapic::CallOptions, ::Hash]
1372
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1373
+ #
1374
+ # @overload approve_rollout(name: nil, approved: nil)
1375
+ # Pass arguments to `approve_rollout` via keyword arguments. Note that at
1376
+ # least one keyword argument is required. To specify no parameters, or to keep all
1377
+ # the default parameter values, pass an empty Hash as a request object (see above).
1378
+ #
1379
+ # @param name [::String]
1380
+ # Required. Name of the Rollout. Format is
1381
+ # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/
1382
+ # releases/\\{release}/rollouts/\\{rollout}.
1383
+ # @param approved [::Boolean]
1384
+ # Required. True = approve; false = reject
1385
+ # @yield [result, operation] Access the result along with the TransportOperation object
1386
+ # @yieldparam result [::Google::Cloud::Deploy::V1::ApproveRolloutResponse]
1387
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1388
+ #
1389
+ # @return [::Google::Cloud::Deploy::V1::ApproveRolloutResponse]
1390
+ #
1391
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1392
+ def approve_rollout request, options = nil
1393
+ raise ::ArgumentError, "request must be provided" if request.nil?
1394
+
1395
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ApproveRolloutRequest
1396
+
1397
+ # Converts hash and nil to an options object
1398
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1399
+
1400
+ # Customize the options with defaults
1401
+ call_metadata = @config.rpcs.approve_rollout.metadata.to_h
1402
+
1403
+ # Set x-goog-api-client and x-goog-user-project headers
1404
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1405
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1406
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1407
+ transports_version_send: [:rest]
1408
+
1409
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1410
+
1411
+ options.apply_defaults timeout: @config.rpcs.approve_rollout.timeout,
1412
+ metadata: call_metadata,
1413
+ retry_policy: @config.rpcs.approve_rollout.retry_policy
1414
+
1415
+ options.apply_defaults timeout: @config.timeout,
1416
+ metadata: @config.metadata,
1417
+ retry_policy: @config.retry_policy
1418
+
1419
+ @cloud_deploy_stub.approve_rollout request, options do |result, operation|
1420
+ yield result, operation if block_given?
1421
+ return result
1422
+ end
1423
+ rescue ::Gapic::Rest::Error => e
1424
+ raise ::Google::Cloud::Error.from_error(e)
1425
+ end
1426
+
1427
+ ##
1428
+ # Lists Rollouts in a given project and location.
1429
+ #
1430
+ # @overload list_rollouts(request, options = nil)
1431
+ # Pass arguments to `list_rollouts` via a request object, either of type
1432
+ # {::Google::Cloud::Deploy::V1::ListRolloutsRequest} or an equivalent Hash.
1433
+ #
1434
+ # @param request [::Google::Cloud::Deploy::V1::ListRolloutsRequest, ::Hash]
1435
+ # A request object representing the call parameters. Required. To specify no
1436
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1437
+ # @param options [::Gapic::CallOptions, ::Hash]
1438
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1439
+ #
1440
+ # @overload list_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1441
+ # Pass arguments to `list_rollouts` via keyword arguments. Note that at
1442
+ # least one keyword argument is required. To specify no parameters, or to keep all
1443
+ # the default parameter values, pass an empty Hash as a request object (see above).
1444
+ #
1445
+ # @param parent [::String]
1446
+ # Required. The `Release` which owns this collection of `Rollout` objects.
1447
+ # @param page_size [::Integer]
1448
+ # Optional. The maximum number of `Rollout` objects to return. The service may return
1449
+ # fewer than this value. If unspecified, at most 50 `Rollout` objects will be
1450
+ # returned. The maximum value is 1000; values above 1000 will be set to 1000.
1451
+ # @param page_token [::String]
1452
+ # Optional. A page token, received from a previous `ListRollouts` call.
1453
+ # Provide this to retrieve the subsequent page.
1454
+ #
1455
+ # When paginating, all other provided parameters match
1456
+ # the call that provided the page token.
1457
+ # @param filter [::String]
1458
+ # Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more
1459
+ # details.
1460
+ # @param order_by [::String]
1461
+ # Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
1462
+ # @yield [result, operation] Access the result along with the TransportOperation object
1463
+ # @yieldparam result [::Google::Cloud::Deploy::V1::ListRolloutsResponse]
1464
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1465
+ #
1466
+ # @return [::Google::Cloud::Deploy::V1::ListRolloutsResponse]
1467
+ #
1468
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1469
+ def list_rollouts request, options = nil
1470
+ raise ::ArgumentError, "request must be provided" if request.nil?
1471
+
1472
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListRolloutsRequest
1473
+
1474
+ # Converts hash and nil to an options object
1475
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1476
+
1477
+ # Customize the options with defaults
1478
+ call_metadata = @config.rpcs.list_rollouts.metadata.to_h
1479
+
1480
+ # Set x-goog-api-client and x-goog-user-project headers
1481
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1482
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1483
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1484
+ transports_version_send: [:rest]
1485
+
1486
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1487
+
1488
+ options.apply_defaults timeout: @config.rpcs.list_rollouts.timeout,
1489
+ metadata: call_metadata,
1490
+ retry_policy: @config.rpcs.list_rollouts.retry_policy
1491
+
1492
+ options.apply_defaults timeout: @config.timeout,
1493
+ metadata: @config.metadata,
1494
+ retry_policy: @config.retry_policy
1495
+
1496
+ @cloud_deploy_stub.list_rollouts request, options do |result, operation|
1497
+ yield result, operation if block_given?
1498
+ return result
1499
+ end
1500
+ rescue ::Gapic::Rest::Error => e
1501
+ raise ::Google::Cloud::Error.from_error(e)
1502
+ end
1503
+
1504
+ ##
1505
+ # Gets details of a single Rollout.
1506
+ #
1507
+ # @overload get_rollout(request, options = nil)
1508
+ # Pass arguments to `get_rollout` via a request object, either of type
1509
+ # {::Google::Cloud::Deploy::V1::GetRolloutRequest} or an equivalent Hash.
1510
+ #
1511
+ # @param request [::Google::Cloud::Deploy::V1::GetRolloutRequest, ::Hash]
1512
+ # A request object representing the call parameters. Required. To specify no
1513
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1514
+ # @param options [::Gapic::CallOptions, ::Hash]
1515
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1516
+ #
1517
+ # @overload get_rollout(name: nil)
1518
+ # Pass arguments to `get_rollout` via keyword arguments. Note that at
1519
+ # least one keyword argument is required. To specify no parameters, or to keep all
1520
+ # the default parameter values, pass an empty Hash as a request object (see above).
1521
+ #
1522
+ # @param name [::String]
1523
+ # Required. Name of the `Rollout`. Format must be
1524
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}/rollouts/\\{rollout_name}.
1525
+ # @yield [result, operation] Access the result along with the TransportOperation object
1526
+ # @yieldparam result [::Google::Cloud::Deploy::V1::Rollout]
1527
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1528
+ #
1529
+ # @return [::Google::Cloud::Deploy::V1::Rollout]
1530
+ #
1531
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1532
+ def get_rollout request, options = nil
1533
+ raise ::ArgumentError, "request must be provided" if request.nil?
1534
+
1535
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetRolloutRequest
1536
+
1537
+ # Converts hash and nil to an options object
1538
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1539
+
1540
+ # Customize the options with defaults
1541
+ call_metadata = @config.rpcs.get_rollout.metadata.to_h
1542
+
1543
+ # Set x-goog-api-client and x-goog-user-project headers
1544
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1545
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1546
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1547
+ transports_version_send: [:rest]
1548
+
1549
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1550
+
1551
+ options.apply_defaults timeout: @config.rpcs.get_rollout.timeout,
1552
+ metadata: call_metadata,
1553
+ retry_policy: @config.rpcs.get_rollout.retry_policy
1554
+
1555
+ options.apply_defaults timeout: @config.timeout,
1556
+ metadata: @config.metadata,
1557
+ retry_policy: @config.retry_policy
1558
+
1559
+ @cloud_deploy_stub.get_rollout request, options do |result, operation|
1560
+ yield result, operation if block_given?
1561
+ return result
1562
+ end
1563
+ rescue ::Gapic::Rest::Error => e
1564
+ raise ::Google::Cloud::Error.from_error(e)
1565
+ end
1566
+
1567
+ ##
1568
+ # Creates a new Rollout in a given project and location.
1569
+ #
1570
+ # @overload create_rollout(request, options = nil)
1571
+ # Pass arguments to `create_rollout` via a request object, either of type
1572
+ # {::Google::Cloud::Deploy::V1::CreateRolloutRequest} or an equivalent Hash.
1573
+ #
1574
+ # @param request [::Google::Cloud::Deploy::V1::CreateRolloutRequest, ::Hash]
1575
+ # A request object representing the call parameters. Required. To specify no
1576
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1577
+ # @param options [::Gapic::CallOptions, ::Hash]
1578
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1579
+ #
1580
+ # @overload create_rollout(parent: nil, rollout_id: nil, rollout: nil, request_id: nil, validate_only: nil)
1581
+ # Pass arguments to `create_rollout` via keyword arguments. Note that at
1582
+ # least one keyword argument is required. To specify no parameters, or to keep all
1583
+ # the default parameter values, pass an empty Hash as a request object (see above).
1584
+ #
1585
+ # @param parent [::String]
1586
+ # Required. The parent collection in which the `Rollout` should be created.
1587
+ # Format should be
1588
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}.
1589
+ # @param rollout_id [::String]
1590
+ # Required. ID of the `Rollout`.
1591
+ # @param rollout [::Google::Cloud::Deploy::V1::Rollout, ::Hash]
1592
+ # Required. The `Rollout` to create.
1593
+ # @param request_id [::String]
1594
+ # Optional. A request ID to identify requests. Specify a unique request ID
1595
+ # so that if you must retry your request, the server will know to ignore
1596
+ # the request if it has already been completed. The server will guarantee
1597
+ # that for at least 60 minutes since the first request.
1598
+ #
1599
+ # For example, consider a situation where you make an initial request and the
1600
+ # request times out. If you make the request again with the same request ID,
1601
+ # the server can check if original operation with the same request ID was
1602
+ # received, and if so, will ignore the second request. This prevents clients
1603
+ # from accidentally creating duplicate commitments.
1604
+ #
1605
+ # The request ID must be a valid UUID with the exception that zero UUID is
1606
+ # not supported (00000000-0000-0000-0000-000000000000).
1607
+ # @param validate_only [::Boolean]
1608
+ # Optional. If set to true, the request is validated and the user is provided with
1609
+ # an expected result, but no actual change is made.
1610
+ # @yield [result, operation] Access the result along with the TransportOperation object
1611
+ # @yieldparam result [::Gapic::Operation]
1612
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1613
+ #
1614
+ # @return [::Gapic::Operation]
1615
+ #
1616
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1617
+ def create_rollout request, options = nil
1618
+ raise ::ArgumentError, "request must be provided" if request.nil?
1619
+
1620
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateRolloutRequest
1621
+
1622
+ # Converts hash and nil to an options object
1623
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1624
+
1625
+ # Customize the options with defaults
1626
+ call_metadata = @config.rpcs.create_rollout.metadata.to_h
1627
+
1628
+ # Set x-goog-api-client and x-goog-user-project headers
1629
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1630
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1631
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1632
+ transports_version_send: [:rest]
1633
+
1634
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1635
+
1636
+ options.apply_defaults timeout: @config.rpcs.create_rollout.timeout,
1637
+ metadata: call_metadata,
1638
+ retry_policy: @config.rpcs.create_rollout.retry_policy
1639
+
1640
+ options.apply_defaults timeout: @config.timeout,
1641
+ metadata: @config.metadata,
1642
+ retry_policy: @config.retry_policy
1643
+
1644
+ @cloud_deploy_stub.create_rollout request, options do |result, operation|
1645
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1646
+ yield result, operation if block_given?
1647
+ return result
1648
+ end
1649
+ rescue ::Gapic::Rest::Error => e
1650
+ raise ::Google::Cloud::Error.from_error(e)
1651
+ end
1652
+
1653
+ ##
1654
+ # Retries the specified Job in a Rollout.
1655
+ #
1656
+ # @overload retry_job(request, options = nil)
1657
+ # Pass arguments to `retry_job` via a request object, either of type
1658
+ # {::Google::Cloud::Deploy::V1::RetryJobRequest} or an equivalent Hash.
1659
+ #
1660
+ # @param request [::Google::Cloud::Deploy::V1::RetryJobRequest, ::Hash]
1661
+ # A request object representing the call parameters. Required. To specify no
1662
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1663
+ # @param options [::Gapic::CallOptions, ::Hash]
1664
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1665
+ #
1666
+ # @overload retry_job(rollout: nil, phase_id: nil, job_id: nil)
1667
+ # Pass arguments to `retry_job` via keyword arguments. Note that at
1668
+ # least one keyword argument is required. To specify no parameters, or to keep all
1669
+ # the default parameter values, pass an empty Hash as a request object (see above).
1670
+ #
1671
+ # @param rollout [::String]
1672
+ # Required. Name of the Rollout. Format is
1673
+ # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/
1674
+ # releases/\\{release}/rollouts/\\{rollout}.
1675
+ # @param phase_id [::String]
1676
+ # Required. The phase ID the Job to retry belongs to.
1677
+ # @param job_id [::String]
1678
+ # Required. The job ID for the Job to retry.
1679
+ # @yield [result, operation] Access the result along with the TransportOperation object
1680
+ # @yieldparam result [::Google::Cloud::Deploy::V1::RetryJobResponse]
1681
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1682
+ #
1683
+ # @return [::Google::Cloud::Deploy::V1::RetryJobResponse]
1684
+ #
1685
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1686
+ def retry_job request, options = nil
1687
+ raise ::ArgumentError, "request must be provided" if request.nil?
1688
+
1689
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::RetryJobRequest
1690
+
1691
+ # Converts hash and nil to an options object
1692
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1693
+
1694
+ # Customize the options with defaults
1695
+ call_metadata = @config.rpcs.retry_job.metadata.to_h
1696
+
1697
+ # Set x-goog-api-client and x-goog-user-project headers
1698
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1699
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1700
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1701
+ transports_version_send: [:rest]
1702
+
1703
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1704
+
1705
+ options.apply_defaults timeout: @config.rpcs.retry_job.timeout,
1706
+ metadata: call_metadata,
1707
+ retry_policy: @config.rpcs.retry_job.retry_policy
1708
+
1709
+ options.apply_defaults timeout: @config.timeout,
1710
+ metadata: @config.metadata,
1711
+ retry_policy: @config.retry_policy
1712
+
1713
+ @cloud_deploy_stub.retry_job request, options do |result, operation|
1714
+ yield result, operation if block_given?
1715
+ return result
1716
+ end
1717
+ rescue ::Gapic::Rest::Error => e
1718
+ raise ::Google::Cloud::Error.from_error(e)
1719
+ end
1720
+
1721
+ ##
1722
+ # Lists JobRuns in a given project and location.
1723
+ #
1724
+ # @overload list_job_runs(request, options = nil)
1725
+ # Pass arguments to `list_job_runs` via a request object, either of type
1726
+ # {::Google::Cloud::Deploy::V1::ListJobRunsRequest} or an equivalent Hash.
1727
+ #
1728
+ # @param request [::Google::Cloud::Deploy::V1::ListJobRunsRequest, ::Hash]
1729
+ # A request object representing the call parameters. Required. To specify no
1730
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1731
+ # @param options [::Gapic::CallOptions, ::Hash]
1732
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1733
+ #
1734
+ # @overload list_job_runs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1735
+ # Pass arguments to `list_job_runs` via keyword arguments. Note that at
1736
+ # least one keyword argument is required. To specify no parameters, or to keep all
1737
+ # the default parameter values, pass an empty Hash as a request object (see above).
1738
+ #
1739
+ # @param parent [::String]
1740
+ # Required. The `Rollout` which owns this collection of `JobRun` objects.
1741
+ # @param page_size [::Integer]
1742
+ # Optional. The maximum number of `JobRun` objects to return. The service may return
1743
+ # fewer than this value. If unspecified, at most 50 `JobRun` objects will be
1744
+ # returned. The maximum value is 1000; values above 1000 will be set to 1000.
1745
+ # @param page_token [::String]
1746
+ # Optional. A page token, received from a previous `ListJobRuns` call. Provide this
1747
+ # to retrieve the subsequent page.
1748
+ #
1749
+ # When paginating, all other provided parameters match the call that provided
1750
+ # the page token.
1751
+ # @param filter [::String]
1752
+ # Optional. Filter results to be returned. See https://google.aip.dev/160 for more
1753
+ # details.
1754
+ # @param order_by [::String]
1755
+ # Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
1756
+ # @yield [result, operation] Access the result along with the TransportOperation object
1757
+ # @yieldparam result [::Google::Cloud::Deploy::V1::ListJobRunsResponse]
1758
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1759
+ #
1760
+ # @return [::Google::Cloud::Deploy::V1::ListJobRunsResponse]
1761
+ #
1762
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1763
+ def list_job_runs request, options = nil
1764
+ raise ::ArgumentError, "request must be provided" if request.nil?
1765
+
1766
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListJobRunsRequest
1767
+
1768
+ # Converts hash and nil to an options object
1769
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1770
+
1771
+ # Customize the options with defaults
1772
+ call_metadata = @config.rpcs.list_job_runs.metadata.to_h
1773
+
1774
+ # Set x-goog-api-client and x-goog-user-project headers
1775
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1776
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1777
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1778
+ transports_version_send: [:rest]
1779
+
1780
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1781
+
1782
+ options.apply_defaults timeout: @config.rpcs.list_job_runs.timeout,
1783
+ metadata: call_metadata,
1784
+ retry_policy: @config.rpcs.list_job_runs.retry_policy
1785
+
1786
+ options.apply_defaults timeout: @config.timeout,
1787
+ metadata: @config.metadata,
1788
+ retry_policy: @config.retry_policy
1789
+
1790
+ @cloud_deploy_stub.list_job_runs request, options do |result, operation|
1791
+ yield result, operation if block_given?
1792
+ return result
1793
+ end
1794
+ rescue ::Gapic::Rest::Error => e
1795
+ raise ::Google::Cloud::Error.from_error(e)
1796
+ end
1797
+
1798
+ ##
1799
+ # Gets details of a single JobRun.
1800
+ #
1801
+ # @overload get_job_run(request, options = nil)
1802
+ # Pass arguments to `get_job_run` via a request object, either of type
1803
+ # {::Google::Cloud::Deploy::V1::GetJobRunRequest} or an equivalent Hash.
1804
+ #
1805
+ # @param request [::Google::Cloud::Deploy::V1::GetJobRunRequest, ::Hash]
1806
+ # A request object representing the call parameters. Required. To specify no
1807
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1808
+ # @param options [::Gapic::CallOptions, ::Hash]
1809
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1810
+ #
1811
+ # @overload get_job_run(name: nil)
1812
+ # Pass arguments to `get_job_run` via keyword arguments. Note that at
1813
+ # least one keyword argument is required. To specify no parameters, or to keep all
1814
+ # the default parameter values, pass an empty Hash as a request object (see above).
1815
+ #
1816
+ # @param name [::String]
1817
+ # Required. Name of the `JobRun`. Format must be
1818
+ # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}/rollouts/\\{rollout_name}/jobRuns/\\{job_run_name}.
1819
+ # @yield [result, operation] Access the result along with the TransportOperation object
1820
+ # @yieldparam result [::Google::Cloud::Deploy::V1::JobRun]
1821
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1822
+ #
1823
+ # @return [::Google::Cloud::Deploy::V1::JobRun]
1824
+ #
1825
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1826
+ def get_job_run request, options = nil
1827
+ raise ::ArgumentError, "request must be provided" if request.nil?
1828
+
1829
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetJobRunRequest
1830
+
1831
+ # Converts hash and nil to an options object
1832
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1833
+
1834
+ # Customize the options with defaults
1835
+ call_metadata = @config.rpcs.get_job_run.metadata.to_h
1836
+
1837
+ # Set x-goog-api-client and x-goog-user-project headers
1838
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1839
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1840
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1841
+ transports_version_send: [:rest]
1842
+
1843
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1844
+
1845
+ options.apply_defaults timeout: @config.rpcs.get_job_run.timeout,
1846
+ metadata: call_metadata,
1847
+ retry_policy: @config.rpcs.get_job_run.retry_policy
1848
+
1849
+ options.apply_defaults timeout: @config.timeout,
1850
+ metadata: @config.metadata,
1851
+ retry_policy: @config.retry_policy
1852
+
1853
+ @cloud_deploy_stub.get_job_run request, options do |result, operation|
1854
+ yield result, operation if block_given?
1855
+ return result
1856
+ end
1857
+ rescue ::Gapic::Rest::Error => e
1858
+ raise ::Google::Cloud::Error.from_error(e)
1859
+ end
1860
+
1861
+ ##
1862
+ # Gets the configuration for a location.
1863
+ #
1864
+ # @overload get_config(request, options = nil)
1865
+ # Pass arguments to `get_config` via a request object, either of type
1866
+ # {::Google::Cloud::Deploy::V1::GetConfigRequest} or an equivalent Hash.
1867
+ #
1868
+ # @param request [::Google::Cloud::Deploy::V1::GetConfigRequest, ::Hash]
1869
+ # A request object representing the call parameters. Required. To specify no
1870
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1871
+ # @param options [::Gapic::CallOptions, ::Hash]
1872
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1873
+ #
1874
+ # @overload get_config(name: nil)
1875
+ # Pass arguments to `get_config` via keyword arguments. Note that at
1876
+ # least one keyword argument is required. To specify no parameters, or to keep all
1877
+ # the default parameter values, pass an empty Hash as a request object (see above).
1878
+ #
1879
+ # @param name [::String]
1880
+ # Required. Name of requested configuration.
1881
+ # @yield [result, operation] Access the result along with the TransportOperation object
1882
+ # @yieldparam result [::Google::Cloud::Deploy::V1::Config]
1883
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1884
+ #
1885
+ # @return [::Google::Cloud::Deploy::V1::Config]
1886
+ #
1887
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1888
+ def get_config request, options = nil
1889
+ raise ::ArgumentError, "request must be provided" if request.nil?
1890
+
1891
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetConfigRequest
1892
+
1893
+ # Converts hash and nil to an options object
1894
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1895
+
1896
+ # Customize the options with defaults
1897
+ call_metadata = @config.rpcs.get_config.metadata.to_h
1898
+
1899
+ # Set x-goog-api-client and x-goog-user-project headers
1900
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1901
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1902
+ gapic_version: ::Google::Cloud::Deploy::V1::VERSION,
1903
+ transports_version_send: [:rest]
1904
+
1905
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1906
+
1907
+ options.apply_defaults timeout: @config.rpcs.get_config.timeout,
1908
+ metadata: call_metadata,
1909
+ retry_policy: @config.rpcs.get_config.retry_policy
1910
+
1911
+ options.apply_defaults timeout: @config.timeout,
1912
+ metadata: @config.metadata,
1913
+ retry_policy: @config.retry_policy
1914
+
1915
+ @cloud_deploy_stub.get_config request, options do |result, operation|
1916
+ yield result, operation if block_given?
1917
+ return result
1918
+ end
1919
+ rescue ::Gapic::Rest::Error => e
1920
+ raise ::Google::Cloud::Error.from_error(e)
1921
+ end
1922
+
1923
+ ##
1924
+ # Configuration class for the CloudDeploy REST API.
1925
+ #
1926
+ # This class represents the configuration for CloudDeploy REST,
1927
+ # providing control over timeouts, retry behavior, logging, transport
1928
+ # parameters, and other low-level controls. Certain parameters can also be
1929
+ # applied individually to specific RPCs. See
1930
+ # {::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client::Configuration::Rpcs}
1931
+ # for a list of RPCs that can be configured independently.
1932
+ #
1933
+ # Configuration can be applied globally to all clients, or to a single client
1934
+ # on construction.
1935
+ #
1936
+ # @example
1937
+ #
1938
+ # # Modify the global config, setting the timeout for
1939
+ # # list_delivery_pipelines to 20 seconds,
1940
+ # # and all remaining timeouts to 10 seconds.
1941
+ # ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.configure do |config|
1942
+ # config.timeout = 10.0
1943
+ # config.rpcs.list_delivery_pipelines.timeout = 20.0
1944
+ # end
1945
+ #
1946
+ # # Apply the above configuration only to a new client.
1947
+ # client = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new do |config|
1948
+ # config.timeout = 10.0
1949
+ # config.rpcs.list_delivery_pipelines.timeout = 20.0
1950
+ # end
1951
+ #
1952
+ # @!attribute [rw] endpoint
1953
+ # The hostname or hostname:port of the service endpoint.
1954
+ # Defaults to `"clouddeploy.googleapis.com"`.
1955
+ # @return [::String]
1956
+ # @!attribute [rw] credentials
1957
+ # Credentials to send with calls. You may provide any of the following types:
1958
+ # * (`String`) The path to a service account key file in JSON format
1959
+ # * (`Hash`) A service account key as a Hash
1960
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1961
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1962
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1963
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1964
+ # * (`nil`) indicating no credentials
1965
+ # @return [::Object]
1966
+ # @!attribute [rw] scope
1967
+ # The OAuth scopes
1968
+ # @return [::Array<::String>]
1969
+ # @!attribute [rw] lib_name
1970
+ # The library name as recorded in instrumentation and logging
1971
+ # @return [::String]
1972
+ # @!attribute [rw] lib_version
1973
+ # The library version as recorded in instrumentation and logging
1974
+ # @return [::String]
1975
+ # @!attribute [rw] timeout
1976
+ # The call timeout in seconds.
1977
+ # @return [::Numeric]
1978
+ # @!attribute [rw] metadata
1979
+ # Additional headers to be sent with the call.
1980
+ # @return [::Hash{::Symbol=>::String}]
1981
+ # @!attribute [rw] retry_policy
1982
+ # The retry policy. The value is a hash with the following keys:
1983
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1984
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1985
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1986
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1987
+ # trigger a retry.
1988
+ # @return [::Hash]
1989
+ # @!attribute [rw] quota_project
1990
+ # A separate project against which to charge quota.
1991
+ # @return [::String]
1992
+ #
1993
+ class Configuration
1994
+ extend ::Gapic::Config
1995
+
1996
+ config_attr :endpoint, "clouddeploy.googleapis.com", ::String
1997
+ config_attr :credentials, nil do |value|
1998
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1999
+ allowed.any? { |klass| klass === value }
2000
+ end
2001
+ config_attr :scope, nil, ::String, ::Array, nil
2002
+ config_attr :lib_name, nil, ::String, nil
2003
+ config_attr :lib_version, nil, ::String, nil
2004
+ config_attr :timeout, nil, ::Numeric, nil
2005
+ config_attr :metadata, nil, ::Hash, nil
2006
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2007
+ config_attr :quota_project, nil, ::String, nil
2008
+
2009
+ # @private
2010
+ # Overrides for http bindings for the RPCs of this service
2011
+ # are only used when this service is used as mixin, and only
2012
+ # by the host service.
2013
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2014
+ config_attr :bindings_override, {}, ::Hash, nil
2015
+
2016
+ # @private
2017
+ def initialize parent_config = nil
2018
+ @parent_config = parent_config unless parent_config.nil?
2019
+
2020
+ yield self if block_given?
2021
+ end
2022
+
2023
+ ##
2024
+ # Configurations for individual RPCs
2025
+ # @return [Rpcs]
2026
+ #
2027
+ def rpcs
2028
+ @rpcs ||= begin
2029
+ parent_rpcs = nil
2030
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2031
+ Rpcs.new parent_rpcs
2032
+ end
2033
+ end
2034
+
2035
+ ##
2036
+ # Configuration RPC class for the CloudDeploy API.
2037
+ #
2038
+ # Includes fields providing the configuration for each RPC in this service.
2039
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2040
+ # the following configuration fields:
2041
+ #
2042
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2043
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2044
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2045
+ # include the following keys:
2046
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2047
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2048
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2049
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2050
+ # trigger a retry.
2051
+ #
2052
+ class Rpcs
2053
+ ##
2054
+ # RPC-specific configuration for `list_delivery_pipelines`
2055
+ # @return [::Gapic::Config::Method]
2056
+ #
2057
+ attr_reader :list_delivery_pipelines
2058
+ ##
2059
+ # RPC-specific configuration for `get_delivery_pipeline`
2060
+ # @return [::Gapic::Config::Method]
2061
+ #
2062
+ attr_reader :get_delivery_pipeline
2063
+ ##
2064
+ # RPC-specific configuration for `create_delivery_pipeline`
2065
+ # @return [::Gapic::Config::Method]
2066
+ #
2067
+ attr_reader :create_delivery_pipeline
2068
+ ##
2069
+ # RPC-specific configuration for `update_delivery_pipeline`
2070
+ # @return [::Gapic::Config::Method]
2071
+ #
2072
+ attr_reader :update_delivery_pipeline
2073
+ ##
2074
+ # RPC-specific configuration for `delete_delivery_pipeline`
2075
+ # @return [::Gapic::Config::Method]
2076
+ #
2077
+ attr_reader :delete_delivery_pipeline
2078
+ ##
2079
+ # RPC-specific configuration for `list_targets`
2080
+ # @return [::Gapic::Config::Method]
2081
+ #
2082
+ attr_reader :list_targets
2083
+ ##
2084
+ # RPC-specific configuration for `get_target`
2085
+ # @return [::Gapic::Config::Method]
2086
+ #
2087
+ attr_reader :get_target
2088
+ ##
2089
+ # RPC-specific configuration for `create_target`
2090
+ # @return [::Gapic::Config::Method]
2091
+ #
2092
+ attr_reader :create_target
2093
+ ##
2094
+ # RPC-specific configuration for `update_target`
2095
+ # @return [::Gapic::Config::Method]
2096
+ #
2097
+ attr_reader :update_target
2098
+ ##
2099
+ # RPC-specific configuration for `delete_target`
2100
+ # @return [::Gapic::Config::Method]
2101
+ #
2102
+ attr_reader :delete_target
2103
+ ##
2104
+ # RPC-specific configuration for `list_releases`
2105
+ # @return [::Gapic::Config::Method]
2106
+ #
2107
+ attr_reader :list_releases
2108
+ ##
2109
+ # RPC-specific configuration for `get_release`
2110
+ # @return [::Gapic::Config::Method]
2111
+ #
2112
+ attr_reader :get_release
2113
+ ##
2114
+ # RPC-specific configuration for `create_release`
2115
+ # @return [::Gapic::Config::Method]
2116
+ #
2117
+ attr_reader :create_release
2118
+ ##
2119
+ # RPC-specific configuration for `abandon_release`
2120
+ # @return [::Gapic::Config::Method]
2121
+ #
2122
+ attr_reader :abandon_release
2123
+ ##
2124
+ # RPC-specific configuration for `approve_rollout`
2125
+ # @return [::Gapic::Config::Method]
2126
+ #
2127
+ attr_reader :approve_rollout
2128
+ ##
2129
+ # RPC-specific configuration for `list_rollouts`
2130
+ # @return [::Gapic::Config::Method]
2131
+ #
2132
+ attr_reader :list_rollouts
2133
+ ##
2134
+ # RPC-specific configuration for `get_rollout`
2135
+ # @return [::Gapic::Config::Method]
2136
+ #
2137
+ attr_reader :get_rollout
2138
+ ##
2139
+ # RPC-specific configuration for `create_rollout`
2140
+ # @return [::Gapic::Config::Method]
2141
+ #
2142
+ attr_reader :create_rollout
2143
+ ##
2144
+ # RPC-specific configuration for `retry_job`
2145
+ # @return [::Gapic::Config::Method]
2146
+ #
2147
+ attr_reader :retry_job
2148
+ ##
2149
+ # RPC-specific configuration for `list_job_runs`
2150
+ # @return [::Gapic::Config::Method]
2151
+ #
2152
+ attr_reader :list_job_runs
2153
+ ##
2154
+ # RPC-specific configuration for `get_job_run`
2155
+ # @return [::Gapic::Config::Method]
2156
+ #
2157
+ attr_reader :get_job_run
2158
+ ##
2159
+ # RPC-specific configuration for `get_config`
2160
+ # @return [::Gapic::Config::Method]
2161
+ #
2162
+ attr_reader :get_config
2163
+
2164
+ # @private
2165
+ def initialize parent_rpcs = nil
2166
+ list_delivery_pipelines_config = parent_rpcs.list_delivery_pipelines if parent_rpcs.respond_to? :list_delivery_pipelines
2167
+ @list_delivery_pipelines = ::Gapic::Config::Method.new list_delivery_pipelines_config
2168
+ get_delivery_pipeline_config = parent_rpcs.get_delivery_pipeline if parent_rpcs.respond_to? :get_delivery_pipeline
2169
+ @get_delivery_pipeline = ::Gapic::Config::Method.new get_delivery_pipeline_config
2170
+ create_delivery_pipeline_config = parent_rpcs.create_delivery_pipeline if parent_rpcs.respond_to? :create_delivery_pipeline
2171
+ @create_delivery_pipeline = ::Gapic::Config::Method.new create_delivery_pipeline_config
2172
+ update_delivery_pipeline_config = parent_rpcs.update_delivery_pipeline if parent_rpcs.respond_to? :update_delivery_pipeline
2173
+ @update_delivery_pipeline = ::Gapic::Config::Method.new update_delivery_pipeline_config
2174
+ delete_delivery_pipeline_config = parent_rpcs.delete_delivery_pipeline if parent_rpcs.respond_to? :delete_delivery_pipeline
2175
+ @delete_delivery_pipeline = ::Gapic::Config::Method.new delete_delivery_pipeline_config
2176
+ list_targets_config = parent_rpcs.list_targets if parent_rpcs.respond_to? :list_targets
2177
+ @list_targets = ::Gapic::Config::Method.new list_targets_config
2178
+ get_target_config = parent_rpcs.get_target if parent_rpcs.respond_to? :get_target
2179
+ @get_target = ::Gapic::Config::Method.new get_target_config
2180
+ create_target_config = parent_rpcs.create_target if parent_rpcs.respond_to? :create_target
2181
+ @create_target = ::Gapic::Config::Method.new create_target_config
2182
+ update_target_config = parent_rpcs.update_target if parent_rpcs.respond_to? :update_target
2183
+ @update_target = ::Gapic::Config::Method.new update_target_config
2184
+ delete_target_config = parent_rpcs.delete_target if parent_rpcs.respond_to? :delete_target
2185
+ @delete_target = ::Gapic::Config::Method.new delete_target_config
2186
+ list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases
2187
+ @list_releases = ::Gapic::Config::Method.new list_releases_config
2188
+ get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release
2189
+ @get_release = ::Gapic::Config::Method.new get_release_config
2190
+ create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release
2191
+ @create_release = ::Gapic::Config::Method.new create_release_config
2192
+ abandon_release_config = parent_rpcs.abandon_release if parent_rpcs.respond_to? :abandon_release
2193
+ @abandon_release = ::Gapic::Config::Method.new abandon_release_config
2194
+ approve_rollout_config = parent_rpcs.approve_rollout if parent_rpcs.respond_to? :approve_rollout
2195
+ @approve_rollout = ::Gapic::Config::Method.new approve_rollout_config
2196
+ list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts
2197
+ @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config
2198
+ get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout
2199
+ @get_rollout = ::Gapic::Config::Method.new get_rollout_config
2200
+ create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout
2201
+ @create_rollout = ::Gapic::Config::Method.new create_rollout_config
2202
+ retry_job_config = parent_rpcs.retry_job if parent_rpcs.respond_to? :retry_job
2203
+ @retry_job = ::Gapic::Config::Method.new retry_job_config
2204
+ list_job_runs_config = parent_rpcs.list_job_runs if parent_rpcs.respond_to? :list_job_runs
2205
+ @list_job_runs = ::Gapic::Config::Method.new list_job_runs_config
2206
+ get_job_run_config = parent_rpcs.get_job_run if parent_rpcs.respond_to? :get_job_run
2207
+ @get_job_run = ::Gapic::Config::Method.new get_job_run_config
2208
+ get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config
2209
+ @get_config = ::Gapic::Config::Method.new get_config_config
2210
+
2211
+ yield self if block_given?
2212
+ end
2213
+ end
2214
+ end
2215
+ end
2216
+ end
2217
+ end
2218
+ end
2219
+ end
2220
+ end
2221
+ end