# frozen_string_literal: true # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/cloud/deploy/v1/cloud_deploy_pb" require "google/cloud/location" require "google/iam/v1" module Google module Cloud module Deploy module V1 module CloudDeploy ## # Client for the CloudDeploy service. # # CloudDeploy service creates and manages Continuous Delivery operations # on Google Cloud Platform via Skaffold (https://skaffold.dev). # class Client include Paths # @private attr_reader :cloud_deploy_stub ## # Configure the CloudDeploy Client class. # # See {::Google::Cloud::Deploy::V1::CloudDeploy::Client::Configuration} # for a description of the configuration fields. # # @example # # # Modify the configuration for all CloudDeploy clients # ::Google::Cloud::Deploy::V1::CloudDeploy::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Deploy", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_delivery_pipelines.timeout = 60.0 default_config.rpcs.list_delivery_pipelines.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_delivery_pipeline.timeout = 60.0 default_config.rpcs.get_delivery_pipeline.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_delivery_pipeline.timeout = 60.0 default_config.rpcs.update_delivery_pipeline.timeout = 60.0 default_config.rpcs.delete_delivery_pipeline.timeout = 60.0 default_config.rpcs.list_targets.timeout = 60.0 default_config.rpcs.list_targets.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_target.timeout = 60.0 default_config.rpcs.get_target.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_target.timeout = 60.0 default_config.rpcs.update_target.timeout = 60.0 default_config.rpcs.delete_target.timeout = 60.0 default_config.rpcs.list_releases.timeout = 60.0 default_config.rpcs.list_releases.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_release.timeout = 60.0 default_config.rpcs.get_release.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_release.timeout = 60.0 default_config.rpcs.abandon_release.timeout = 60.0 default_config.rpcs.approve_rollout.timeout = 60.0 default_config.rpcs.advance_rollout.timeout = 60.0 default_config.rpcs.cancel_rollout.timeout = 60.0 default_config.rpcs.list_rollouts.timeout = 60.0 default_config.rpcs.list_rollouts.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_rollout.timeout = 60.0 default_config.rpcs.get_rollout.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_rollout.timeout = 60.0 default_config.rpcs.ignore_job.timeout = 60.0 default_config.rpcs.retry_job.timeout = 60.0 default_config.rpcs.list_job_runs.timeout = 60.0 default_config.rpcs.list_job_runs.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_job_run.timeout = 60.0 default_config.rpcs.get_job_run.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.terminate_job_run.timeout = 60.0 default_config.rpcs.get_config.timeout = 60.0 default_config.rpcs.get_config.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config end yield @configure if block_given? @configure end ## # Configure the CloudDeploy Client instance. # # The configuration is set to the derived mode, meaning that values can be changed, # but structural changes (adding new fields, etc.) are not allowed. Structural changes # should be made on {Client.configure}. # # See {::Google::Cloud::Deploy::V1::CloudDeploy::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # Create a new CloudDeploy client object. # # @example # # # Create a client using the default configuration # client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a client using a custom configuration # client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the CloudDeploy client. # @yieldparam config [Client::Configuration] # def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/deploy/v1/cloud_deploy_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @location_client = Google::Cloud::Location::Locations::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @cloud_deploy_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Deploy::V1::CloudDeploy::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end ## # Get the associated client for long-running operations. # # @return [::Google::Cloud::Deploy::V1::CloudDeploy::Operations] # attr_reader :operations_client ## # Get the associated client for mix-in of the Locations. # # @return [Google::Cloud::Location::Locations::Client] # attr_reader :location_client ## # Get the associated client for mix-in of the IAMPolicy. # # @return [Google::Iam::V1::IAMPolicy::Client] # attr_reader :iam_policy_client # Service calls ## # Lists DeliveryPipelines in a given project and location. # # @overload list_delivery_pipelines(request, options = nil) # Pass arguments to `list_delivery_pipelines` via a request object, either of type # {::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_delivery_pipelines(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # Pass arguments to `list_delivery_pipelines` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent, which owns this collection of pipelines. Format must # be projects/\\{project_id}/locations/\\{location_name}. # @param page_size [::Integer] # The maximum number of pipelines to return. The service may return # fewer than this value. If unspecified, at most 50 pipelines will # be returned. The maximum value is 1000; values above 1000 will be set # to 1000. # @param page_token [::String] # A page token, received from a previous `ListDeliveryPipelines` call. # Provide this to retrieve the subsequent page. # # When paginating, all other provided parameters match # the call that provided the page token. # @param filter [::String] # Filter pipelines to be returned. See https://google.aip.dev/160 for more # details. # @param order_by [::String] # Field to sort by. See https://google.aip.dev/132#ordering for more details. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::DeliveryPipeline>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::DeliveryPipeline>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest.new # # # Call the list_delivery_pipelines method. # result = client.list_delivery_pipelines request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::Deploy::V1::DeliveryPipeline. # p item # end # def list_delivery_pipelines request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_delivery_pipelines.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_delivery_pipelines.timeout, metadata: metadata, retry_policy: @config.rpcs.list_delivery_pipelines.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_delivery_pipelines, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_delivery_pipelines, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single DeliveryPipeline. # # @overload get_delivery_pipeline(request, options = nil) # Pass arguments to `get_delivery_pipeline` via a request object, either of type # {::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_delivery_pipeline(name: nil) # Pass arguments to `get_delivery_pipeline` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the `DeliveryPipeline`. Format must be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::DeliveryPipeline] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::DeliveryPipeline] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest.new # # # Call the get_delivery_pipeline method. # result = client.get_delivery_pipeline request # # # The returned object is of type Google::Cloud::Deploy::V1::DeliveryPipeline. # p result # def get_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.get_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_delivery_pipeline, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new DeliveryPipeline in a given project and location. # # @overload create_delivery_pipeline(request, options = nil) # Pass arguments to `create_delivery_pipeline` via a request object, either of type # {::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_delivery_pipeline(parent: nil, delivery_pipeline_id: nil, delivery_pipeline: nil, request_id: nil, validate_only: nil) # Pass arguments to `create_delivery_pipeline` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent collection in which the `DeliveryPipeline` should be # created. Format should be projects/\\{project_id}/locations/\\{location_name}. # @param delivery_pipeline_id [::String] # Required. ID of the `DeliveryPipeline`. # @param delivery_pipeline [::Google::Cloud::Deploy::V1::DeliveryPipeline, ::Hash] # Required. The `DeliveryPipeline` to create. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes since the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param validate_only [::Boolean] # Optional. If set to true, the request is validated and the user is provided # with an expected result, but no actual change is made. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest.new # # # Call the create_delivery_pipeline method. # result = client.create_delivery_pipeline request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.create_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_delivery_pipeline, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single DeliveryPipeline. # # @overload update_delivery_pipeline(request, options = nil) # Pass arguments to `update_delivery_pipeline` via a request object, either of type # {::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_delivery_pipeline(update_mask: nil, delivery_pipeline: nil, request_id: nil, allow_missing: nil, validate_only: nil) # Pass arguments to `update_delivery_pipeline` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Field mask is used to specify the fields to be overwritten in the # `DeliveryPipeline` resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param delivery_pipeline [::Google::Cloud::Deploy::V1::DeliveryPipeline, ::Hash] # Required. The `DeliveryPipeline` to update. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes since the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param allow_missing [::Boolean] # Optional. If set to true, updating a `DeliveryPipeline` that does not exist # will result in the creation of a new `DeliveryPipeline`. # @param validate_only [::Boolean] # Optional. If set to true, the request is validated and the user is provided # with an expected result, but no actual change is made. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest.new # # # Call the update_delivery_pipeline method. # result = client.update_delivery_pipeline request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.delivery_pipeline&.name header_params["delivery_pipeline.name"] = request.delivery_pipeline.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.update_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :update_delivery_pipeline, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single DeliveryPipeline. # # @overload delete_delivery_pipeline(request, options = nil) # Pass arguments to `delete_delivery_pipeline` via a request object, either of type # {::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_delivery_pipeline(name: nil, request_id: nil, allow_missing: nil, validate_only: nil, force: nil, etag: nil) # Pass arguments to `delete_delivery_pipeline` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the `DeliveryPipeline` to delete. Format should be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param allow_missing [::Boolean] # Optional. If set to true, then deleting an already deleted or non-existing # `DeliveryPipeline` will succeed. # @param validate_only [::Boolean] # Optional. If set, validate the request and preview the review, but do not # actually post it. # @param force [::Boolean] # Optional. If set to true, all child resources under this pipeline will also # be deleted. Otherwise, the request will only work if the pipeline has no # child resources. # @param etag [::String] # Optional. This checksum is computed by the server based on the value of # other fields, and may be sent on update and delete requests to ensure the # client has an up-to-date value before proceeding. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest.new # # # Call the delete_delivery_pipeline method. # result = client.delete_delivery_pipeline request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :delete_delivery_pipeline, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists Targets in a given project and location. # # @overload list_targets(request, options = nil) # Pass arguments to `list_targets` via a request object, either of type # {::Google::Cloud::Deploy::V1::ListTargetsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::ListTargetsRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_targets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # Pass arguments to `list_targets` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent, which owns this collection of targets. Format must be # projects/\\{project_id}/locations/\\{location_name}. # @param page_size [::Integer] # Optional. The maximum number of `Target` objects to return. The service may # return fewer than this value. If unspecified, at most 50 `Target` objects # will be returned. The maximum value is 1000; values above 1000 will be set # to 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListTargets` call. # Provide this to retrieve the subsequent page. # # When paginating, all other provided parameters match # the call that provided the page token. # @param filter [::String] # Optional. Filter targets to be returned. See https://google.aip.dev/160 for # more details. # @param order_by [::String] # Optional. Field to sort by. See https://google.aip.dev/132#ordering for # more details. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Target>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Target>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::ListTargetsRequest.new # # # Call the list_targets method. # result = client.list_targets request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::Deploy::V1::Target. # p item # end # def list_targets request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListTargetsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_targets.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_targets.timeout, metadata: metadata, retry_policy: @config.rpcs.list_targets.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_targets, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_targets, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single Target. # # @overload get_target(request, options = nil) # Pass arguments to `get_target` via a request object, either of type # {::Google::Cloud::Deploy::V1::GetTargetRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::GetTargetRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_target(name: nil) # Pass arguments to `get_target` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the `Target`. Format must be # projects/\\{project_id}/locations/\\{location_name}/targets/\\{target_name}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::Target] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::Target] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::GetTargetRequest.new # # # Call the get_target method. # result = client.get_target request # # # The returned object is of type Google::Cloud::Deploy::V1::Target. # p result # def get_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetTargetRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_target.timeout, metadata: metadata, retry_policy: @config.rpcs.get_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_target, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new Target in a given project and location. # # @overload create_target(request, options = nil) # Pass arguments to `create_target` via a request object, either of type # {::Google::Cloud::Deploy::V1::CreateTargetRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::CreateTargetRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_target(parent: nil, target_id: nil, target: nil, request_id: nil, validate_only: nil) # Pass arguments to `create_target` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent collection in which the `Target` should be created. # Format should be # projects/\\{project_id}/locations/\\{location_name}. # @param target_id [::String] # Required. ID of the `Target`. # @param target [::Google::Cloud::Deploy::V1::Target, ::Hash] # Required. The `Target` to create. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes since the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param validate_only [::Boolean] # Optional. If set to true, the request is validated and the user is provided # with an expected result, but no actual change is made. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::CreateTargetRequest.new # # # Call the create_target method. # result = client.create_target request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateTargetRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_target.timeout, metadata: metadata, retry_policy: @config.rpcs.create_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_target, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single Target. # # @overload update_target(request, options = nil) # Pass arguments to `update_target` via a request object, either of type # {::Google::Cloud::Deploy::V1::UpdateTargetRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::UpdateTargetRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_target(update_mask: nil, target: nil, request_id: nil, allow_missing: nil, validate_only: nil) # Pass arguments to `update_target` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Field mask is used to specify the fields to be overwritten in the # Target resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param target [::Google::Cloud::Deploy::V1::Target, ::Hash] # Required. The `Target` to update. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes since the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param allow_missing [::Boolean] # Optional. If set to true, updating a `Target` that does not exist will # result in the creation of a new `Target`. # @param validate_only [::Boolean] # Optional. If set to true, the request is validated and the user is provided # with an expected result, but no actual change is made. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::UpdateTargetRequest.new # # # Call the update_target method. # result = client.update_target request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::UpdateTargetRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.target&.name header_params["target.name"] = request.target.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_target.timeout, metadata: metadata, retry_policy: @config.rpcs.update_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :update_target, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single Target. # # @overload delete_target(request, options = nil) # Pass arguments to `delete_target` via a request object, either of type # {::Google::Cloud::Deploy::V1::DeleteTargetRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::DeleteTargetRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_target(name: nil, request_id: nil, allow_missing: nil, validate_only: nil, etag: nil) # Pass arguments to `delete_target` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the `Target` to delete. Format should be # projects/\\{project_id}/locations/\\{location_name}/targets/\\{target_name}. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes after the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param allow_missing [::Boolean] # Optional. If set to true, then deleting an already deleted or non-existing # `Target` will succeed. # @param validate_only [::Boolean] # Optional. If set, validate the request and preview the review, but do not # actually post it. # @param etag [::String] # Optional. This checksum is computed by the server based on the value of # other fields, and may be sent on update and delete requests to ensure the # client has an up-to-date value before proceeding. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::DeleteTargetRequest.new # # # Call the delete_target method. # result = client.delete_target request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::DeleteTargetRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_target.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :delete_target, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists Releases in a given project and location. # # @overload list_releases(request, options = nil) # Pass arguments to `list_releases` via a request object, either of type # {::Google::Cloud::Deploy::V1::ListReleasesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::ListReleasesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # Pass arguments to `list_releases` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The `DeliveryPipeline` which owns this collection of `Release` # objects. # @param page_size [::Integer] # Optional. The maximum number of `Release` objects to return. The service # may return fewer than this value. If unspecified, at most 50 `Release` # objects will be returned. The maximum value is 1000; values above 1000 will # be set to 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListReleases` call. # Provide this to retrieve the subsequent page. # # When paginating, all other provided parameters match # the call that provided the page token. # @param filter [::String] # Optional. Filter releases to be returned. See https://google.aip.dev/160 # for more details. # @param order_by [::String] # Optional. Field to sort by. See https://google.aip.dev/132#ordering for # more details. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Release>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Release>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::ListReleasesRequest.new # # # Call the list_releases method. # result = client.list_releases request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::Deploy::V1::Release. # p item # end # def list_releases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListReleasesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_releases.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_releases.timeout, metadata: metadata, retry_policy: @config.rpcs.list_releases.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_releases, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_releases, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single Release. # # @overload get_release(request, options = nil) # Pass arguments to `get_release` via a request object, either of type # {::Google::Cloud::Deploy::V1::GetReleaseRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::GetReleaseRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_release(name: nil) # Pass arguments to `get_release` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the `Release`. Format must be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::Release] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::Release] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::GetReleaseRequest.new # # # Call the get_release method. # result = client.get_release request # # # The returned object is of type Google::Cloud::Deploy::V1::Release. # p result # def get_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetReleaseRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_release.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_release.timeout, metadata: metadata, retry_policy: @config.rpcs.get_release.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_release, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new Release in a given project and location. # # @overload create_release(request, options = nil) # Pass arguments to `create_release` via a request object, either of type # {::Google::Cloud::Deploy::V1::CreateReleaseRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::CreateReleaseRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_release(parent: nil, release_id: nil, release: nil, request_id: nil, validate_only: nil) # Pass arguments to `create_release` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent collection in which the `Release` should be created. # Format should be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}. # @param release_id [::String] # Required. ID of the `Release`. # @param release [::Google::Cloud::Deploy::V1::Release, ::Hash] # Required. The `Release` to create. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes since the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param validate_only [::Boolean] # Optional. If set to true, the request is validated and the user is provided # with an expected result, but no actual change is made. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::CreateReleaseRequest.new # # # Call the create_release method. # result = client.create_release request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateReleaseRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_release.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_release.timeout, metadata: metadata, retry_policy: @config.rpcs.create_release.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_release, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Abandons a Release in the Delivery Pipeline. # # @overload abandon_release(request, options = nil) # Pass arguments to `abandon_release` via a request object, either of type # {::Google::Cloud::Deploy::V1::AbandonReleaseRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::AbandonReleaseRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload abandon_release(name: nil) # Pass arguments to `abandon_release` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the Release. Format is # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::AbandonReleaseResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::AbandonReleaseResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::AbandonReleaseRequest.new # # # Call the abandon_release method. # result = client.abandon_release request # # # The returned object is of type Google::Cloud::Deploy::V1::AbandonReleaseResponse. # p result # def abandon_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::AbandonReleaseRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.abandon_release.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.abandon_release.timeout, metadata: metadata, retry_policy: @config.rpcs.abandon_release.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :abandon_release, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Approves a Rollout. # # @overload approve_rollout(request, options = nil) # Pass arguments to `approve_rollout` via a request object, either of type # {::Google::Cloud::Deploy::V1::ApproveRolloutRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::ApproveRolloutRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload approve_rollout(name: nil, approved: nil) # Pass arguments to `approve_rollout` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the Rollout. Format is # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}/rollouts/\\{rollout}. # @param approved [::Boolean] # Required. True = approve; false = reject # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::ApproveRolloutResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::ApproveRolloutResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::ApproveRolloutRequest.new # # # Call the approve_rollout method. # result = client.approve_rollout request # # # The returned object is of type Google::Cloud::Deploy::V1::ApproveRolloutResponse. # p result # def approve_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ApproveRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.approve_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.approve_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.approve_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :approve_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Advances a Rollout in a given project and location. # # @overload advance_rollout(request, options = nil) # Pass arguments to `advance_rollout` via a request object, either of type # {::Google::Cloud::Deploy::V1::AdvanceRolloutRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::AdvanceRolloutRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload advance_rollout(name: nil, phase_id: nil) # Pass arguments to `advance_rollout` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the Rollout. Format is # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}/rollouts/\\{rollout}. # @param phase_id [::String] # Required. The phase ID to advance the `Rollout` to. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::AdvanceRolloutResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::AdvanceRolloutResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::AdvanceRolloutRequest.new # # # Call the advance_rollout method. # result = client.advance_rollout request # # # The returned object is of type Google::Cloud::Deploy::V1::AdvanceRolloutResponse. # p result # def advance_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::AdvanceRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.advance_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.advance_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.advance_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :advance_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Cancels a Rollout in a given project and location. # # @overload cancel_rollout(request, options = nil) # Pass arguments to `cancel_rollout` via a request object, either of type # {::Google::Cloud::Deploy::V1::CancelRolloutRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::CancelRolloutRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload cancel_rollout(name: nil) # Pass arguments to `cancel_rollout` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the Rollout. Format is # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}/rollouts/\\{rollout}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::CancelRolloutResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::CancelRolloutResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::CancelRolloutRequest.new # # # Call the cancel_rollout method. # result = client.cancel_rollout request # # # The returned object is of type Google::Cloud::Deploy::V1::CancelRolloutResponse. # p result # def cancel_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CancelRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.cancel_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.cancel_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.cancel_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :cancel_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists Rollouts in a given project and location. # # @overload list_rollouts(request, options = nil) # Pass arguments to `list_rollouts` via a request object, either of type # {::Google::Cloud::Deploy::V1::ListRolloutsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::ListRolloutsRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # Pass arguments to `list_rollouts` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The `Release` which owns this collection of `Rollout` objects. # @param page_size [::Integer] # Optional. The maximum number of `Rollout` objects to return. The service # may return fewer than this value. If unspecified, at most 50 `Rollout` # objects will be returned. The maximum value is 1000; values above 1000 will # be set to 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListRollouts` call. # Provide this to retrieve the subsequent page. # # When paginating, all other provided parameters match # the call that provided the page token. # @param filter [::String] # Optional. Filter rollouts to be returned. See https://google.aip.dev/160 # for more details. # @param order_by [::String] # Optional. Field to sort by. See https://google.aip.dev/132#ordering for # more details. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Rollout>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Rollout>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::ListRolloutsRequest.new # # # Call the list_rollouts method. # result = client.list_rollouts request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::Deploy::V1::Rollout. # p item # end # def list_rollouts request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListRolloutsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_rollouts.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_rollouts.timeout, metadata: metadata, retry_policy: @config.rpcs.list_rollouts.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_rollouts, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_rollouts, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single Rollout. # # @overload get_rollout(request, options = nil) # Pass arguments to `get_rollout` via a request object, either of type # {::Google::Cloud::Deploy::V1::GetRolloutRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::GetRolloutRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_rollout(name: nil) # Pass arguments to `get_rollout` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the `Rollout`. Format must be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}/rollouts/\\{rollout_name}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::Rollout] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::Rollout] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::GetRolloutRequest.new # # # Call the get_rollout method. # result = client.get_rollout request # # # The returned object is of type Google::Cloud::Deploy::V1::Rollout. # p result # def get_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.get_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new Rollout in a given project and location. # # @overload create_rollout(request, options = nil) # Pass arguments to `create_rollout` via a request object, either of type # {::Google::Cloud::Deploy::V1::CreateRolloutRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::CreateRolloutRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_rollout(parent: nil, rollout_id: nil, rollout: nil, request_id: nil, validate_only: nil, starting_phase_id: nil) # Pass arguments to `create_rollout` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent collection in which the `Rollout` should be created. # Format should be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}. # @param rollout_id [::String] # Required. ID of the `Rollout`. # @param rollout [::Google::Cloud::Deploy::V1::Rollout, ::Hash] # Required. The `Rollout` to create. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID # so that if you must retry your request, the server will know to ignore # the request if it has already been completed. The server will guarantee # that for at least 60 minutes since the first request. # # For example, consider a situation where you make an initial request and the # request times out. If you make the request again with the same request ID, # the server can check if original operation with the same request ID was # received, and if so, will ignore the second request. This prevents clients # from accidentally creating duplicate commitments. # # The request ID must be a valid UUID with the exception that zero UUID is # not supported (00000000-0000-0000-0000-000000000000). # @param validate_only [::Boolean] # Optional. If set to true, the request is validated and the user is provided # with an expected result, but no actual change is made. # @param starting_phase_id [::String] # Optional. The starting phase ID for the `Rollout`. If empty the `Rollout` # will start at the first phase. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::CreateRolloutRequest.new # # # Call the create_rollout method. # result = client.create_rollout request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.create_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_rollout, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Ignores the specified Job in a Rollout. # # @overload ignore_job(request, options = nil) # Pass arguments to `ignore_job` via a request object, either of type # {::Google::Cloud::Deploy::V1::IgnoreJobRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::IgnoreJobRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload ignore_job(rollout: nil, phase_id: nil, job_id: nil) # Pass arguments to `ignore_job` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param rollout [::String] # Required. Name of the Rollout. Format is # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}/rollouts/\\{rollout}. # @param phase_id [::String] # Required. The phase ID the Job to ignore belongs to. # @param job_id [::String] # Required. The job ID for the Job to ignore. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::IgnoreJobResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::IgnoreJobResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::IgnoreJobRequest.new # # # Call the ignore_job method. # result = client.ignore_job request # # # The returned object is of type Google::Cloud::Deploy::V1::IgnoreJobResponse. # p result # def ignore_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::IgnoreJobRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.ignore_job.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.rollout header_params["rollout"] = request.rollout end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.ignore_job.timeout, metadata: metadata, retry_policy: @config.rpcs.ignore_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :ignore_job, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Retries the specified Job in a Rollout. # # @overload retry_job(request, options = nil) # Pass arguments to `retry_job` via a request object, either of type # {::Google::Cloud::Deploy::V1::RetryJobRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::RetryJobRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload retry_job(rollout: nil, phase_id: nil, job_id: nil) # Pass arguments to `retry_job` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param rollout [::String] # Required. Name of the Rollout. Format is # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}/rollouts/\\{rollout}. # @param phase_id [::String] # Required. The phase ID the Job to retry belongs to. # @param job_id [::String] # Required. The job ID for the Job to retry. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::RetryJobResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::RetryJobResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::RetryJobRequest.new # # # Call the retry_job method. # result = client.retry_job request # # # The returned object is of type Google::Cloud::Deploy::V1::RetryJobResponse. # p result # def retry_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::RetryJobRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.retry_job.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.rollout header_params["rollout"] = request.rollout end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.retry_job.timeout, metadata: metadata, retry_policy: @config.rpcs.retry_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :retry_job, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists JobRuns in a given project and location. # # @overload list_job_runs(request, options = nil) # Pass arguments to `list_job_runs` via a request object, either of type # {::Google::Cloud::Deploy::V1::ListJobRunsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::ListJobRunsRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_job_runs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # Pass arguments to `list_job_runs` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The `Rollout` which owns this collection of `JobRun` objects. # @param page_size [::Integer] # Optional. The maximum number of `JobRun` objects to return. The service may # return fewer than this value. If unspecified, at most 50 `JobRun` objects # will be returned. The maximum value is 1000; values above 1000 will be set # to 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListJobRuns` call. # Provide this to retrieve the subsequent page. # # When paginating, all other provided parameters match the call that provided # the page token. # @param filter [::String] # Optional. Filter results to be returned. See https://google.aip.dev/160 for # more details. # @param order_by [::String] # Optional. Field to sort by. See https://google.aip.dev/132#ordering for # more details. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::JobRun>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::JobRun>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::ListJobRunsRequest.new # # # Call the list_job_runs method. # result = client.list_job_runs request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::Deploy::V1::JobRun. # p item # end # def list_job_runs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListJobRunsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_job_runs.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_job_runs.timeout, metadata: metadata, retry_policy: @config.rpcs.list_job_runs.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_job_runs, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_job_runs, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single JobRun. # # @overload get_job_run(request, options = nil) # Pass arguments to `get_job_run` via a request object, either of type # {::Google::Cloud::Deploy::V1::GetJobRunRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::GetJobRunRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_job_run(name: nil) # Pass arguments to `get_job_run` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the `JobRun`. Format must be # projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}/rollouts/\\{rollout_name}/jobRuns/\\{job_run_name}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::JobRun] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::JobRun] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::GetJobRunRequest.new # # # Call the get_job_run method. # result = client.get_job_run request # # # The returned object is of type Google::Cloud::Deploy::V1::JobRun. # p result # def get_job_run request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetJobRunRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_job_run.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_job_run.timeout, metadata: metadata, retry_policy: @config.rpcs.get_job_run.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_job_run, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Terminates a Job Run in a given project and location. # # @overload terminate_job_run(request, options = nil) # Pass arguments to `terminate_job_run` via a request object, either of type # {::Google::Cloud::Deploy::V1::TerminateJobRunRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::TerminateJobRunRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload terminate_job_run(name: nil) # Pass arguments to `terminate_job_run` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of the `JobRun`. Format must be # projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ # releases/\\{release}/rollouts/\\{rollout}/jobRuns/\\{jobRun}. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::TerminateJobRunResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::TerminateJobRunResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::TerminateJobRunRequest.new # # # Call the terminate_job_run method. # result = client.terminate_job_run request # # # The returned object is of type Google::Cloud::Deploy::V1::TerminateJobRunResponse. # p result # def terminate_job_run request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::TerminateJobRunRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.terminate_job_run.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.terminate_job_run.timeout, metadata: metadata, retry_policy: @config.rpcs.terminate_job_run.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :terminate_job_run, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets the configuration for a location. # # @overload get_config(request, options = nil) # Pass arguments to `get_config` via a request object, either of type # {::Google::Cloud::Deploy::V1::GetConfigRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Deploy::V1::GetConfigRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_config(name: nil) # Pass arguments to `get_config` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. Name of requested configuration. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Deploy::V1::Config] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Deploy::V1::Config] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # # @example Basic example # require "google/cloud/deploy/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::Deploy::V1::GetConfigRequest.new # # # Call the get_config method. # result = client.get_config request # # # The returned object is of type Google::Cloud::Deploy::V1::Config. # p result # def get_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetConfigRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_config.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_config.timeout, metadata: metadata, retry_policy: @config.rpcs.get_config.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_config, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the CloudDeploy API. # # This class represents the configuration for CloudDeploy, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::Deploy::V1::CloudDeploy::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # list_delivery_pipelines to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::Deploy::V1::CloudDeploy::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_delivery_pipelines.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_delivery_pipelines.timeout = 20.0 # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"clouddeploy.googleapis.com"`. # @return [::String] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`String`) The path to a service account key file in JSON format # * (`Hash`) A service account key as a Hash # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # class Configuration extend ::Gapic::Config DEFAULT_ENDPOINT = "clouddeploy.googleapis.com" config_attr :endpoint, DEFAULT_ENDPOINT, ::String config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration RPC class for the CloudDeploy API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `list_delivery_pipelines` # @return [::Gapic::Config::Method] # attr_reader :list_delivery_pipelines ## # RPC-specific configuration for `get_delivery_pipeline` # @return [::Gapic::Config::Method] # attr_reader :get_delivery_pipeline ## # RPC-specific configuration for `create_delivery_pipeline` # @return [::Gapic::Config::Method] # attr_reader :create_delivery_pipeline ## # RPC-specific configuration for `update_delivery_pipeline` # @return [::Gapic::Config::Method] # attr_reader :update_delivery_pipeline ## # RPC-specific configuration for `delete_delivery_pipeline` # @return [::Gapic::Config::Method] # attr_reader :delete_delivery_pipeline ## # RPC-specific configuration for `list_targets` # @return [::Gapic::Config::Method] # attr_reader :list_targets ## # RPC-specific configuration for `get_target` # @return [::Gapic::Config::Method] # attr_reader :get_target ## # RPC-specific configuration for `create_target` # @return [::Gapic::Config::Method] # attr_reader :create_target ## # RPC-specific configuration for `update_target` # @return [::Gapic::Config::Method] # attr_reader :update_target ## # RPC-specific configuration for `delete_target` # @return [::Gapic::Config::Method] # attr_reader :delete_target ## # RPC-specific configuration for `list_releases` # @return [::Gapic::Config::Method] # attr_reader :list_releases ## # RPC-specific configuration for `get_release` # @return [::Gapic::Config::Method] # attr_reader :get_release ## # RPC-specific configuration for `create_release` # @return [::Gapic::Config::Method] # attr_reader :create_release ## # RPC-specific configuration for `abandon_release` # @return [::Gapic::Config::Method] # attr_reader :abandon_release ## # RPC-specific configuration for `approve_rollout` # @return [::Gapic::Config::Method] # attr_reader :approve_rollout ## # RPC-specific configuration for `advance_rollout` # @return [::Gapic::Config::Method] # attr_reader :advance_rollout ## # RPC-specific configuration for `cancel_rollout` # @return [::Gapic::Config::Method] # attr_reader :cancel_rollout ## # RPC-specific configuration for `list_rollouts` # @return [::Gapic::Config::Method] # attr_reader :list_rollouts ## # RPC-specific configuration for `get_rollout` # @return [::Gapic::Config::Method] # attr_reader :get_rollout ## # RPC-specific configuration for `create_rollout` # @return [::Gapic::Config::Method] # attr_reader :create_rollout ## # RPC-specific configuration for `ignore_job` # @return [::Gapic::Config::Method] # attr_reader :ignore_job ## # RPC-specific configuration for `retry_job` # @return [::Gapic::Config::Method] # attr_reader :retry_job ## # RPC-specific configuration for `list_job_runs` # @return [::Gapic::Config::Method] # attr_reader :list_job_runs ## # RPC-specific configuration for `get_job_run` # @return [::Gapic::Config::Method] # attr_reader :get_job_run ## # RPC-specific configuration for `terminate_job_run` # @return [::Gapic::Config::Method] # attr_reader :terminate_job_run ## # RPC-specific configuration for `get_config` # @return [::Gapic::Config::Method] # attr_reader :get_config # @private def initialize parent_rpcs = nil list_delivery_pipelines_config = parent_rpcs.list_delivery_pipelines if parent_rpcs.respond_to? :list_delivery_pipelines @list_delivery_pipelines = ::Gapic::Config::Method.new list_delivery_pipelines_config get_delivery_pipeline_config = parent_rpcs.get_delivery_pipeline if parent_rpcs.respond_to? :get_delivery_pipeline @get_delivery_pipeline = ::Gapic::Config::Method.new get_delivery_pipeline_config create_delivery_pipeline_config = parent_rpcs.create_delivery_pipeline if parent_rpcs.respond_to? :create_delivery_pipeline @create_delivery_pipeline = ::Gapic::Config::Method.new create_delivery_pipeline_config update_delivery_pipeline_config = parent_rpcs.update_delivery_pipeline if parent_rpcs.respond_to? :update_delivery_pipeline @update_delivery_pipeline = ::Gapic::Config::Method.new update_delivery_pipeline_config delete_delivery_pipeline_config = parent_rpcs.delete_delivery_pipeline if parent_rpcs.respond_to? :delete_delivery_pipeline @delete_delivery_pipeline = ::Gapic::Config::Method.new delete_delivery_pipeline_config list_targets_config = parent_rpcs.list_targets if parent_rpcs.respond_to? :list_targets @list_targets = ::Gapic::Config::Method.new list_targets_config get_target_config = parent_rpcs.get_target if parent_rpcs.respond_to? :get_target @get_target = ::Gapic::Config::Method.new get_target_config create_target_config = parent_rpcs.create_target if parent_rpcs.respond_to? :create_target @create_target = ::Gapic::Config::Method.new create_target_config update_target_config = parent_rpcs.update_target if parent_rpcs.respond_to? :update_target @update_target = ::Gapic::Config::Method.new update_target_config delete_target_config = parent_rpcs.delete_target if parent_rpcs.respond_to? :delete_target @delete_target = ::Gapic::Config::Method.new delete_target_config list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases @list_releases = ::Gapic::Config::Method.new list_releases_config get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release @get_release = ::Gapic::Config::Method.new get_release_config create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release @create_release = ::Gapic::Config::Method.new create_release_config abandon_release_config = parent_rpcs.abandon_release if parent_rpcs.respond_to? :abandon_release @abandon_release = ::Gapic::Config::Method.new abandon_release_config approve_rollout_config = parent_rpcs.approve_rollout if parent_rpcs.respond_to? :approve_rollout @approve_rollout = ::Gapic::Config::Method.new approve_rollout_config advance_rollout_config = parent_rpcs.advance_rollout if parent_rpcs.respond_to? :advance_rollout @advance_rollout = ::Gapic::Config::Method.new advance_rollout_config cancel_rollout_config = parent_rpcs.cancel_rollout if parent_rpcs.respond_to? :cancel_rollout @cancel_rollout = ::Gapic::Config::Method.new cancel_rollout_config list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout @get_rollout = ::Gapic::Config::Method.new get_rollout_config create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout @create_rollout = ::Gapic::Config::Method.new create_rollout_config ignore_job_config = parent_rpcs.ignore_job if parent_rpcs.respond_to? :ignore_job @ignore_job = ::Gapic::Config::Method.new ignore_job_config retry_job_config = parent_rpcs.retry_job if parent_rpcs.respond_to? :retry_job @retry_job = ::Gapic::Config::Method.new retry_job_config list_job_runs_config = parent_rpcs.list_job_runs if parent_rpcs.respond_to? :list_job_runs @list_job_runs = ::Gapic::Config::Method.new list_job_runs_config get_job_run_config = parent_rpcs.get_job_run if parent_rpcs.respond_to? :get_job_run @get_job_run = ::Gapic::Config::Method.new get_job_run_config terminate_job_run_config = parent_rpcs.terminate_job_run if parent_rpcs.respond_to? :terminate_job_run @terminate_job_run = ::Gapic::Config::Method.new terminate_job_run_config get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config @get_config = ::Gapic::Config::Method.new get_config_config yield self if block_given? end end end end end end end end end