Class: Google::Apis::CloudbuildV2::CloudBuildService

Inherits:
Google::Apis::Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/cloudbuild_v2/service.rb

Overview

Cloud Build API

Creates and manages builds on Google Cloud Platform.

Examples:

require 'google/apis/cloudbuild_v2'

Cloudbuild = Google::Apis::CloudbuildV2 # Alias the module
service = Cloudbuild::CloudBuildService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCloudBuildService

Returns a new instance of CloudBuildService.



45
46
47
48
49
50
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 45

def initialize
  super('https://cloudbuild.googleapis.com/', '',
        client_name: 'google-apis-cloudbuild_v2',
        client_version: Google::Apis::CloudbuildV2::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



38
39
40
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 38

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



43
44
45
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#access_project_location_connection_repository_read_token(repository, fetch_read_token_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::FetchReadTokenResponse

Fetches read token of a given repository.

Parameters:

  • repository (String)

    Required. The resource name of the repository in the format projects/*/ locations/*/connections/*/repositories/*.

  • fetch_read_token_request_object (Google::Apis::CloudbuildV2::FetchReadTokenRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



465
466
467
468
469
470
471
472
473
474
475
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 465

def access_project_location_connection_repository_read_token(repository, fetch_read_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+repository}:accessReadToken', options)
  command.request_representation = Google::Apis::CloudbuildV2::FetchReadTokenRequest::Representation
  command.request_object = fetch_read_token_request_object
  command.response_representation = Google::Apis::CloudbuildV2::FetchReadTokenResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::FetchReadTokenResponse
  command.params['repository'] = repository unless repository.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#access_project_location_connection_repository_read_write_token(repository, fetch_read_write_token_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse

Fetches read/write token of a given repository.

Parameters:

  • repository (String)

    Required. The resource name of the repository in the format projects/*/ locations/*/connections/*/repositories/*.

  • fetch_read_write_token_request_object (Google::Apis::CloudbuildV2::FetchReadWriteTokenRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



499
500
501
502
503
504
505
506
507
508
509
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 499

def access_project_location_connection_repository_read_write_token(repository, fetch_read_write_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+repository}:accessReadWriteToken', options)
  command.request_representation = Google::Apis::CloudbuildV2::FetchReadWriteTokenRequest::Representation
  command.request_object = fetch_read_write_token_request_object
  command.response_representation = Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse
  command.params['repository'] = repository unless repository.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_repository_create_repositories(parent, batch_create_repositories_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Creates multiple repositories inside a connection.

Parameters:

  • parent (String)

    Required. The connection to contain all the repositories being created. Format: projects//locations//connections/* The parent field in the CreateRepositoryRequest messages must either be empty or match this field.

  • batch_create_repositories_request_object (Google::Apis::CloudbuildV2::BatchCreateRepositoriesRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



534
535
536
537
538
539
540
541
542
543
544
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 534

def batch_repository_create_repositories(parent, batch_create_repositories_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/repositories:batchCreate', options)
  command.request_representation = Google::Apis::CloudbuildV2::BatchCreateRepositoriesRequest::Representation
  command.request_object = batch_create_repositories_request_object
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Empty

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

Parameters:

  • name (String)

    The name of the operation resource to be cancelled.

  • cancel_operation_request_object (Google::Apis::CloudbuildV2::CancelOperationRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



766
767
768
769
770
771
772
773
774
775
776
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 766

def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:cancel', options)
  command.request_representation = Google::Apis::CloudbuildV2::CancelOperationRequest::Representation
  command.request_object = cancel_operation_request_object
  command.response_representation = Google::Apis::CloudbuildV2::Empty::Representation
  command.response_class = Google::Apis::CloudbuildV2::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_connection(parent, connection_object = nil, connection_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Creates a Connection.

Parameters:

  • parent (String)

    Required. Project and location where the connection will be created. Format: projects/*/locations/*.

  • connection_object (Google::Apis::CloudbuildV2::Connection) (defaults to: nil)
  • connection_id (String) (defaults to: nil)

    Required. The ID to use for the Connection, which will become the final component of the Connection's resource name. Names must be unique per-project per-location. Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 78

def create_project_location_connection(parent, connection_object = nil, connection_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/connections', options)
  command.request_representation = Google::Apis::CloudbuildV2::Connection::Representation
  command.request_object = connection_object
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['connectionId'] = connection_id unless connection_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_connection_repository(parent, repository_object = nil, repository_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Creates a Repository.

Parameters:

  • parent (String)

    Required. The connection to contain the repository. If the request is part of a BatchCreateRepositoriesRequest, this field should be empty or match the parent specified there.

  • repository_object (Google::Apis::CloudbuildV2::Repository) (defaults to: nil)
  • repository_id (String) (defaults to: nil)

    Required. The ID to use for the repository, which will become the final component of the repository's resource name. This ID should be unique in the connection. Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 573

def create_project_location_connection_repository(parent, repository_object = nil, repository_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/repositories', options)
  command.request_representation = Google::Apis::CloudbuildV2::Repository::Representation
  command.request_object = repository_object
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['repositoryId'] = repository_id unless repository_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_connection(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Deletes a single connection.

Parameters:

  • name (String)

    Required. The name of the Connection to delete. Format: projects/*/locations/* /connections/*.

  • etag (String) (defaults to: nil)

    The current etag of the connection. If an etag is provided and does not match the current etag of the connection, deletion will be blocked and an ABORTED error will be returned.

  • validate_only (Boolean) (defaults to: nil)

    If set, validate the request, but do not actually post it.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



118
119
120
121
122
123
124
125
126
127
128
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 118

def delete_project_location_connection(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['validateOnly'] = validate_only unless validate_only.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_connection_repository(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Deletes a single repository.

Parameters:

  • name (String)

    Required. The name of the Repository to delete. Format: projects/*/locations/* /connections/*/repositories/*.

  • etag (String) (defaults to: nil)

    The current etag of the repository. If an etag is provided and does not match the current etag of the repository, deletion will be blocked and an ABORTED error will be returned.

  • validate_only (Boolean) (defaults to: nil)

    If set, validate the request, but do not actually post it.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



613
614
615
616
617
618
619
620
621
622
623
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 613

def delete_project_location_connection_repository(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['validateOnly'] = validate_only unless validate_only.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#fetch_project_location_connection_linkable_repositories(connection, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse

FetchLinkableRepositories get repositories from SCM that are accessible and could be added to the connection.

Parameters:

  • connection (String)

    Required. The name of the Connection. Format: projects/*/locations/*/ connections/*.

  • page_size (Fixnum) (defaults to: nil)

    Number of results to return in the list. Default to 20.

  • page_token (String) (defaults to: nil)

    Page start.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



156
157
158
159
160
161
162
163
164
165
166
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 156

def fetch_project_location_connection_linkable_repositories(connection, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+connection}:fetchLinkableRepositories', options)
  command.response_representation = Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse
  command.params['connection'] = connection unless connection.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#fetch_project_location_connection_repository_git_refs(repository, page_size: nil, page_token: nil, ref_type: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::FetchGitRefsResponse

Fetch the list of branches or tags for a given repository.

Parameters:

  • repository (String)

    Required. The resource name of the repository in the format projects/*/ locations/*/connections/*/repositories/*.

  • page_size (Fixnum) (defaults to: nil)

    Optional. Number of results to return in the list. Default to 100.

  • page_token (String) (defaults to: nil)

    Optional. Page start.

  • ref_type (String) (defaults to: nil)

    Type of refs to fetch

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



652
653
654
655
656
657
658
659
660
661
662
663
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 652

def fetch_project_location_connection_repository_git_refs(repository, page_size: nil, page_token: nil, ref_type: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+repository}:fetchGitRefs', options)
  command.response_representation = Google::Apis::CloudbuildV2::FetchGitRefsResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::FetchGitRefsResponse
  command.params['repository'] = repository unless repository.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['refType'] = ref_type unless ref_type.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_connection(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Connection

Gets details of a single connection.

Parameters:

  • name (String)

    Required. The name of the Connection to retrieve. Format: projects/*/ locations/*/connections/*.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



189
190
191
192
193
194
195
196
197
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 189

def get_project_location_connection(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV2::Connection::Representation
  command.response_class = Google::Apis::CloudbuildV2::Connection
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_connection_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Policy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the IAM documentation.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



233
234
235
236
237
238
239
240
241
242
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 233

def get_project_location_connection_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::CloudbuildV2::Policy::Representation
  command.response_class = Google::Apis::CloudbuildV2::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_connection_repository(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Repository

Gets details of a single repository.

Parameters:

  • name (String)

    Required. The name of the Repository to retrieve. Format: projects/*/ locations/*/connections/*/repositories/*.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



686
687
688
689
690
691
692
693
694
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 686

def get_project_location_connection_repository(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV2::Repository::Representation
  command.response_class = Google::Apis::CloudbuildV2::Repository
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



799
800
801
802
803
804
805
806
807
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 799

def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_connection_repositories(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::ListRepositoriesResponse

Lists Repositories in a given connection.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of Repositories. Format: projects/*/locations/*/connections/*.

  • filter (String) (defaults to: nil)

    A filter expression that filters resources listed in the response. Expressions must follow API improvement proposal AIP-160. e. g. remote_uri:"https://github.com*".

  • page_size (Fixnum) (defaults to: nil)

    Number of results to return in the list.

  • page_token (String) (defaults to: nil)

    Page start.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 725

def list_project_location_connection_repositories(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/repositories', options)
  command.response_representation = Google::Apis::CloudbuildV2::ListRepositoriesResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::ListRepositoriesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_connections(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::ListConnectionsResponse

Lists Connections in a given project and location.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of Connections. Format: projects/*/locations/*.

  • page_size (Fixnum) (defaults to: nil)

    Number of results to return in the list.

  • page_token (String) (defaults to: nil)

    Page start.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



269
270
271
272
273
274
275
276
277
278
279
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 269

def list_project_location_connections(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/connections', options)
  command.response_representation = Google::Apis::CloudbuildV2::ListConnectionsResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::ListConnectionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_location_connection(name, connection_object = nil, allow_missing: nil, etag: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Operation

Updates a single connection.

Parameters:

  • name (String)

    Immutable. The resource name of the connection, in the format projects/ project/locations/location/connections/connection_id``.

  • connection_object (Google::Apis::CloudbuildV2::Connection) (defaults to: nil)
  • allow_missing (Boolean) (defaults to: nil)

    If set to true, and the connection is not found a new connection will be created. In this situation update_mask is ignored. The creation will succeed only if the input connection has all the necessary information (e.g a github_config with both user_oauth_token and installation_id properties).

  • etag (String) (defaults to: nil)

    The current etag of the connection. If an etag is provided and does not match the current etag of the connection, update will be blocked and an ABORTED error will be returned.

  • update_mask (String) (defaults to: nil)

    The list of fields to be updated.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 314

def patch_project_location_connection(name, connection_object = nil, allow_missing: nil, etag: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::CloudbuildV2::Connection::Representation
  command.request_object = connection_object
  command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV2::Operation
  command.params['name'] = name unless name.nil?
  command.query['allowMissing'] = allow_missing unless allow_missing.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#process_project_location_connection_webhook(parent, http_body_object = nil, webhook_key: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Empty

ProcessWebhook is called by the external SCM for notifying of events.

Parameters:

  • parent (String)

    Required. Project and location where the webhook will be received. Format: projects/*/locations/*.

  • http_body_object (Google::Apis::CloudbuildV2::HttpBody) (defaults to: nil)
  • webhook_key (String) (defaults to: nil)

    Arbitrary additional key to find the maching repository for a webhook event if needed.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 354

def process_project_location_connection_webhook(parent, http_body_object = nil, webhook_key: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/connections:processWebhook', options)
  command.request_representation = Google::Apis::CloudbuildV2::HttpBody::Representation
  command.request_object = http_body_object
  command.response_representation = Google::Apis::CloudbuildV2::Empty::Representation
  command.response_class = Google::Apis::CloudbuildV2::Empty
  command.params['parent'] = parent unless parent.nil?
  command.query['webhookKey'] = webhook_key unless webhook_key.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_connection_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::Policy

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

  • set_iam_policy_request_object (Google::Apis::CloudbuildV2::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



392
393
394
395
396
397
398
399
400
401
402
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 392

def set_connection_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::CloudbuildV2::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::CloudbuildV2::Policy::Representation
  command.response_class = Google::Apis::CloudbuildV2::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_connection_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV2::TestIamPermissionsResponse

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters:

  • resource (String)

    REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

  • test_iam_permissions_request_object (Google::Apis::CloudbuildV2::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



431
432
433
434
435
436
437
438
439
440
441
# File 'lib/google/apis/cloudbuild_v2/service.rb', line 431

def test_connection_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::CloudbuildV2::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::CloudbuildV2::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::CloudbuildV2::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end