Class v2.RepositoryManagerClient (4.1.1)

Manages connections to source code repositories. v2

Package

@google-cloud/cloudbuild

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of RepositoryManagerClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new RepositoryManagerClient({fallback: true}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

locationsClient

locationsClient: LocationsClient;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

repositoryManagerStub

repositoryManagerStub?: Promise<{
        [name: string]: Function;
    }>;

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

batchCreateRepositories(request, options)

batchCreateRepositories(request?: protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates multiple repositories inside a connection.

Parameters
NameDescription
request IBatchCreateRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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.
   */
  // const parent = 'abc123'
  /**
   *  Required. The request messages specifying the repositories to create.
   */
  // const requests = [1,2,3,4]

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callBatchCreateRepositories() {
    // Construct request
    const request = {
      parent,
      requests,
    };

    // Run request
    const [operation] = await cloudbuildClient.batchCreateRepositories(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBatchCreateRepositories();

batchCreateRepositories(request, options, callback)

batchCreateRepositories(request: protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IBatchCreateRepositoriesRequest
options CallOptions
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

batchCreateRepositories(request, callback)

batchCreateRepositories(request: protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesRequest, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IBatchCreateRepositoriesRequest
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IBatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelOperation(request, options, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.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 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 value with a of 1, corresponding to Code.CANCELLED.

Parameters
NameDescription
request CancelOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkBatchCreateRepositoriesProgress(name)

checkBatchCreateRepositoriesProgress(name: string): Promise<LROperation<protos.google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.OperationMetadata>>;

Check the status of the long running operation returned by batchCreateRepositories().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse, protos.google.devtools.cloudbuild.v2.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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.
   */
  // const parent = 'abc123'
  /**
   *  Required. The request messages specifying the repositories to create.
   */
  // const requests = [1,2,3,4]

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callBatchCreateRepositories() {
    // Construct request
    const request = {
      parent,
      requests,
    };

    // Run request
    const [operation] = await cloudbuildClient.batchCreateRepositories(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBatchCreateRepositories();

checkCreateConnectionProgress(name)

checkCreateConnectionProgress(name: string): Promise<LROperation<protos.google.devtools.cloudbuild.v2.Connection, protos.google.devtools.cloudbuild.v2.OperationMetadata>>;

Check the status of the long running operation returned by createConnection().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.devtools.cloudbuild.v2.Connection, protos.google.devtools.cloudbuild.v2.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location where the connection will be created.
   *  Format: `projects/* /locations/*`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Connection to create.
   */
  // const connection = {}
  /**
   *  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
   *  -._~%!$&'()*+,;=@.
   */
  // const connectionId = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callCreateConnection() {
    // Construct request
    const request = {
      parent,
      connection,
      connectionId,
    };

    // Run request
    const [operation] = await cloudbuildClient.createConnection(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateConnection();

checkCreateRepositoryProgress(name)

checkCreateRepositoryProgress(name: string): Promise<LROperation<protos.google.devtools.cloudbuild.v2.Repository, protos.google.devtools.cloudbuild.v2.OperationMetadata>>;

Check the status of the long running operation returned by createRepository().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.devtools.cloudbuild.v2.Repository, protos.google.devtools.cloudbuild.v2.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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.
   */
  // const parent = 'abc123'
  /**
   *  Required. The repository to create.
   */
  // const repository = {}
  /**
   *  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
   *  -._~%!$&'()*+,;=@.
   */
  // const repositoryId = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callCreateRepository() {
    // Construct request
    const request = {
      parent,
      repository,
      repositoryId,
    };

    // Run request
    const [operation] = await cloudbuildClient.createRepository(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateRepository();

checkDeleteConnectionProgress(name)

checkDeleteConnectionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.devtools.cloudbuild.v2.OperationMetadata>>;

Check the status of the long running operation returned by deleteConnection().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.devtools.cloudbuild.v2.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Connection to delete.
   *  Format: `projects/* /locations/* /connections/*`.
   */
  // const name = 'abc123'
  /**
   *  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.
   */
  // const etag = 'abc123'
  /**
   *  If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callDeleteConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await cloudbuildClient.deleteConnection(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteConnection();

checkDeleteRepositoryProgress(name)

checkDeleteRepositoryProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.devtools.cloudbuild.v2.OperationMetadata>>;

Check the status of the long running operation returned by deleteRepository().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.devtools.cloudbuild.v2.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Repository to delete.
   *  Format: `projects/* /locations/* /connections/* /repositories/*`.
   */
  // const name = 'abc123'
  /**
   *  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.
   */
  // const etag = 'abc123'
  /**
   *  If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callDeleteRepository() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await cloudbuildClient.deleteRepository(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteRepository();

checkUpdateConnectionProgress(name)

checkUpdateConnectionProgress(name: string): Promise<LROperation<protos.google.devtools.cloudbuild.v2.Connection, protos.google.devtools.cloudbuild.v2.OperationMetadata>>;

Check the status of the long running operation returned by updateConnection().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.devtools.cloudbuild.v2.Connection, protos.google.devtools.cloudbuild.v2.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The Connection to update.
   */
  // const connection = {}
  /**
   *  The list of fields to be updated.
   */
  // const updateMask = {}
  /**
   *  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).
   */
  // const allowMissing = true
  /**
   *  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.
   */
  // const etag = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callUpdateConnection() {
    // Construct request
    const request = {
      connection,
    };

    // Run request
    const [operation] = await cloudbuildClient.updateConnection(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateConnection();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

connectionPath(project, location, connection)

connectionPath(project: string, location: string, connection: string): string;

Return a fully-qualified connection resource name string.

Parameters
NameDescription
project string
location string
connection string
Returns
TypeDescription
string

{string} Resource name string.

createConnection(request, options)

createConnection(request?: protos.google.devtools.cloudbuild.v2.ICreateConnectionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a Connection.

Parameters
NameDescription
request ICreateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Project and location where the connection will be created.
   *  Format: `projects/* /locations/*`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Connection to create.
   */
  // const connection = {}
  /**
   *  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
   *  -._~%!$&'()*+,;=@.
   */
  // const connectionId = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callCreateConnection() {
    // Construct request
    const request = {
      parent,
      connection,
      connectionId,
    };

    // Run request
    const [operation] = await cloudbuildClient.createConnection(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateConnection();

createConnection(request, options, callback)

createConnection(request: protos.google.devtools.cloudbuild.v2.ICreateConnectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateConnectionRequest
options CallOptions
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createConnection(request, callback)

createConnection(request: protos.google.devtools.cloudbuild.v2.ICreateConnectionRequest, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateConnectionRequest
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createRepository(request, options)

createRepository(request?: protos.google.devtools.cloudbuild.v2.ICreateRepositoryRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a Repository.

Parameters
NameDescription
request ICreateRepositoryRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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.
   */
  // const parent = 'abc123'
  /**
   *  Required. The repository to create.
   */
  // const repository = {}
  /**
   *  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
   *  -._~%!$&'()*+,;=@.
   */
  // const repositoryId = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callCreateRepository() {
    // Construct request
    const request = {
      parent,
      repository,
      repositoryId,
    };

    // Run request
    const [operation] = await cloudbuildClient.createRepository(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateRepository();

createRepository(request, options, callback)

createRepository(request: protos.google.devtools.cloudbuild.v2.ICreateRepositoryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateRepositoryRequest
options CallOptions
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createRepository(request, callback)

createRepository(request: protos.google.devtools.cloudbuild.v2.ICreateRepositoryRequest, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateRepositoryRequest
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConnection(request, options)

deleteConnection(request?: protos.google.devtools.cloudbuild.v2.IDeleteConnectionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single connection.

Parameters
NameDescription
request IDeleteConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Connection to delete.
   *  Format: `projects/* /locations/* /connections/*`.
   */
  // const name = 'abc123'
  /**
   *  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.
   */
  // const etag = 'abc123'
  /**
   *  If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callDeleteConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await cloudbuildClient.deleteConnection(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteConnection();

deleteConnection(request, options, callback)

deleteConnection(request: protos.google.devtools.cloudbuild.v2.IDeleteConnectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteConnectionRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConnection(request, callback)

deleteConnection(request: protos.google.devtools.cloudbuild.v2.IDeleteConnectionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteConnectionRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteOperation(request, options, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
NameDescription
request DeleteOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

deleteRepository(request, options)

deleteRepository(request?: protos.google.devtools.cloudbuild.v2.IDeleteRepositoryRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single repository.

Parameters
NameDescription
request IDeleteRepositoryRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Repository to delete.
   *  Format: `projects/* /locations/* /connections/* /repositories/*`.
   */
  // const name = 'abc123'
  /**
   *  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.
   */
  // const etag = 'abc123'
  /**
   *  If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callDeleteRepository() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await cloudbuildClient.deleteRepository(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteRepository();

deleteRepository(request, options, callback)

deleteRepository(request: protos.google.devtools.cloudbuild.v2.IDeleteRepositoryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteRepositoryRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteRepository(request, callback)

deleteRepository(request: protos.google.devtools.cloudbuild.v2.IDeleteRepositoryRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteRepositoryRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

fetchGitRefs(request, options)

fetchGitRefs(request?: protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IFetchGitRefsResponse,
        protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest | undefined,
        {} | undefined
    ]>;

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

Parameters
NameDescription
request IFetchGitRefsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IFetchGitRefsResponse, protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing FetchGitRefsResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the repository in the format
   *  `projects/* /locations/* /connections/* /repositories/*`.
   */
  // const repository = 'abc123'
  /**
   *  Type of refs to fetch
   */
  // const refType = {}

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callFetchGitRefs() {
    // Construct request
    const request = {
      repository,
    };

    // Run request
    const response = await cloudbuildClient.fetchGitRefs(request);
    console.log(response);
  }

  callFetchGitRefs();

fetchGitRefs(request, options, callback)

fetchGitRefs(request: protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest, options: CallOptions, callback: Callback<protos.google.devtools.cloudbuild.v2.IFetchGitRefsResponse, protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IFetchGitRefsRequest
options CallOptions
callback Callback<protos.google.devtools.cloudbuild.v2.IFetchGitRefsResponse, protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

fetchGitRefs(request, callback)

fetchGitRefs(request: protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest, callback: Callback<protos.google.devtools.cloudbuild.v2.IFetchGitRefsResponse, protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IFetchGitRefsRequest
callback Callback<protos.google.devtools.cloudbuild.v2.IFetchGitRefsResponse, protos.google.devtools.cloudbuild.v2.IFetchGitRefsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

fetchLinkableRepositories(request, options)

fetchLinkableRepositories(request?: protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IRepository[],
        protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest | null,
        protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesResponse
    ]>;

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

Parameters
NameDescription
request IFetchLinkableRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IRepository[], protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest | null, protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Repository. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using fetchLinkableRepositoriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

fetchLinkableRepositories(request, options, callback)

fetchLinkableRepositories(request: protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, options: CallOptions, callback: PaginationCallback<protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>): void;
Parameters
NameDescription
request IFetchLinkableRepositoriesRequest
options CallOptions
callback PaginationCallback<protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>
Returns
TypeDescription
void

fetchLinkableRepositories(request, callback)

fetchLinkableRepositories(request: protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, callback: PaginationCallback<protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>): void;
Parameters
NameDescription
request IFetchLinkableRepositoriesRequest
callback PaginationCallback<protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>
Returns
TypeDescription
void

fetchLinkableRepositoriesAsync(request, options)

fetchLinkableRepositoriesAsync(request?: protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, options?: CallOptions): AsyncIterable<protos.google.devtools.cloudbuild.v2.IRepository>;

Equivalent to fetchLinkableRepositories, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IFetchLinkableRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.devtools.cloudbuild.v2.IRepository>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Repository. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Connection.
   *  Format: `projects/* /locations/* /connections/*`.
   */
  // const connection = 'abc123'
  /**
   *  Number of results to return in the list. Default to 20.
   */
  // const pageSize = 1234
  /**
   *  Page start.
   */
  // const pageToken = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callFetchLinkableRepositories() {
    // Construct request
    const request = {
      connection,
    };

    // Run request
    const iterable = await cloudbuildClient.fetchLinkableRepositoriesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callFetchLinkableRepositories();

fetchLinkableRepositoriesStream(request, options)

fetchLinkableRepositoriesStream(request?: protos.google.devtools.cloudbuild.v2.IFetchLinkableRepositoriesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IFetchLinkableRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing Repository on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using fetchLinkableRepositoriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

fetchReadToken(request, options)

fetchReadToken(request?: protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IFetchReadTokenResponse,
        protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest | undefined,
        {} | undefined
    ]>;

Fetches read token of a given repository.

Parameters
NameDescription
request IFetchReadTokenRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IFetchReadTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing FetchReadTokenResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the repository in the format
   *  `projects/* /locations/* /connections/* /repositories/*`.
   */
  // const repository = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callFetchReadToken() {
    // Construct request
    const request = {
      repository,
    };

    // Run request
    const response = await cloudbuildClient.fetchReadToken(request);
    console.log(response);
  }

  callFetchReadToken();

fetchReadToken(request, options, callback)

fetchReadToken(request: protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest, options: CallOptions, callback: Callback<protos.google.devtools.cloudbuild.v2.IFetchReadTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IFetchReadTokenRequest
options CallOptions
callback Callback<protos.google.devtools.cloudbuild.v2.IFetchReadTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

fetchReadToken(request, callback)

fetchReadToken(request: protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest, callback: Callback<protos.google.devtools.cloudbuild.v2.IFetchReadTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IFetchReadTokenRequest
callback Callback<protos.google.devtools.cloudbuild.v2.IFetchReadTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadTokenRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

fetchReadWriteToken(request, options)

fetchReadWriteToken(request?: protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenResponse,
        (protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest | undefined),
        {} | undefined
    ]>;

Fetches read/write token of a given repository.

Parameters
NameDescription
request IFetchReadWriteTokenRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenResponse, (protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing FetchReadWriteTokenResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the repository in the format
   *  `projects/* /locations/* /connections/* /repositories/*`.
   */
  // const repository = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callFetchReadWriteToken() {
    // Construct request
    const request = {
      repository,
    };

    // Run request
    const response = await cloudbuildClient.fetchReadWriteToken(request);
    console.log(response);
  }

  callFetchReadWriteToken();

fetchReadWriteToken(request, options, callback)

fetchReadWriteToken(request: protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest, options: CallOptions, callback: Callback<protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IFetchReadWriteTokenRequest
options CallOptions
callback Callback<protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

fetchReadWriteToken(request, callback)

fetchReadWriteToken(request: protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest, callback: Callback<protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IFetchReadWriteTokenRequest
callback Callback<protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenResponse, protos.google.devtools.cloudbuild.v2.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConnection(request, options)

getConnection(request?: protos.google.devtools.cloudbuild.v2.IGetConnectionRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IConnection,
        protos.google.devtools.cloudbuild.v2.IGetConnectionRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single connection.

Parameters
NameDescription
request IGetConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IGetConnectionRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Connection. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Connection to retrieve.
   *  Format: `projects/* /locations/* /connections/*`.
   */
  // const name = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callGetConnection() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await cloudbuildClient.getConnection(request);
    console.log(response);
  }

  callGetConnection();

getConnection(request, options, callback)

getConnection(request: protos.google.devtools.cloudbuild.v2.IGetConnectionRequest, options: CallOptions, callback: Callback<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConnectionRequest
options CallOptions
callback Callback<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConnection(request, callback)

getConnection(request: protos.google.devtools.cloudbuild.v2.IGetConnectionRequest, callback: Callback<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConnectionRequest
callback Callback<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.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
NameDescription
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
NameDescription
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
Promise<google.cloud.location.ILocation>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

const [response] = await client.getLocation(request);

getOperation(request, options, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.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
NameDescription
request GetOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

getRepository(request, options)

getRepository(request?: protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IRepository,
        protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single repository.

Parameters
NameDescription
request IGetRepositoryRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Repository. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the Repository to retrieve.
   *  Format: `projects/* /locations/* /connections/* /repositories/*`.
   */
  // const name = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callGetRepository() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await cloudbuildClient.getRepository(request);
    console.log(response);
  }

  callGetRepository();

getRepository(request, options, callback)

getRepository(request: protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest, options: CallOptions, callback: Callback<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetRepositoryRequest
options CallOptions
callback Callback<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getRepository(request, callback)

getRepository(request: protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest, callback: Callback<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetRepositoryRequest
callback Callback<protos.google.devtools.cloudbuild.v2.IRepository, protos.google.devtools.cloudbuild.v2.IGetRepositoryRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listConnections(request, options)

listConnections(request?: protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IConnection[],
        protos.google.devtools.cloudbuild.v2.IListConnectionsRequest | null,
        protos.google.devtools.cloudbuild.v2.IListConnectionsResponse
    ]>;

Lists Connections in a given project and location.

Parameters
NameDescription
request IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IConnection[], protos.google.devtools.cloudbuild.v2.IListConnectionsRequest | null, protos.google.devtools.cloudbuild.v2.IListConnectionsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Connection. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listConnectionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listConnections(request, options, callback)

listConnections(request: protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, protos.google.devtools.cloudbuild.v2.IListConnectionsResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IConnection>): void;
Parameters
NameDescription
request IListConnectionsRequest
options CallOptions
callback PaginationCallback<protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, protos.google.devtools.cloudbuild.v2.IListConnectionsResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IConnection>
Returns
TypeDescription
void

listConnections(request, callback)

listConnections(request: protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, callback: PaginationCallback<protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, protos.google.devtools.cloudbuild.v2.IListConnectionsResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IConnection>): void;
Parameters
NameDescription
request IListConnectionsRequest
callback PaginationCallback<protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, protos.google.devtools.cloudbuild.v2.IListConnectionsResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IConnection>
Returns
TypeDescription
void

listConnectionsAsync(request, options)

listConnectionsAsync(request?: protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, options?: CallOptions): AsyncIterable<protos.google.devtools.cloudbuild.v2.IConnection>;

Equivalent to listConnections, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.devtools.cloudbuild.v2.IConnection>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Connection. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent, which owns this collection of Connections.
   *  Format: `projects/* /locations/*`.
   */
  // const parent = 'abc123'
  /**
   *  Number of results to return in the list.
   */
  // const pageSize = 1234
  /**
   *  Page start.
   */
  // const pageToken = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callListConnections() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await cloudbuildClient.listConnectionsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListConnections();

listConnectionsStream(request, options)

listConnectionsStream(request?: protos.google.devtools.cloudbuild.v2.IListConnectionsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing Connection on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listConnectionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<google.cloud.location.ILocation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}

listOperationsAsync(request, options)

listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
NameDescription
request ListOperationsRequest

The request object that will be sent.

options CallOptions

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns
TypeDescription
AsyncIterable<protos.google.longrunning.ListOperationsResponse>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

listRepositories(request, options)

listRepositories(request?: protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, options?: CallOptions): Promise<[
        protos.google.devtools.cloudbuild.v2.IRepository[],
        protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest | null,
        protos.google.devtools.cloudbuild.v2.IListRepositoriesResponse
    ]>;

Lists Repositories in a given connection.

Parameters
NameDescription
request IListRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.devtools.cloudbuild.v2.IRepository[], protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest | null, protos.google.devtools.cloudbuild.v2.IListRepositoriesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Repository. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listRepositoriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listRepositories(request, options, callback)

listRepositories(request: protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, options: CallOptions, callback: PaginationCallback<protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IListRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>): void;
Parameters
NameDescription
request IListRepositoriesRequest
options CallOptions
callback PaginationCallback<protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IListRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>
Returns
TypeDescription
void

listRepositories(request, callback)

listRepositories(request: protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, callback: PaginationCallback<protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IListRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>): void;
Parameters
NameDescription
request IListRepositoriesRequest
callback PaginationCallback<protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, protos.google.devtools.cloudbuild.v2.IListRepositoriesResponse | null | undefined, protos.google.devtools.cloudbuild.v2.IRepository>
Returns
TypeDescription
void

listRepositoriesAsync(request, options)

listRepositoriesAsync(request?: protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, options?: CallOptions): AsyncIterable<protos.google.devtools.cloudbuild.v2.IRepository>;

Equivalent to listRepositories, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.devtools.cloudbuild.v2.IRepository>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Repository. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent, which owns this collection of Repositories.
   *  Format: `projects/* /locations/* /connections/*`.
   */
  // const parent = 'abc123'
  /**
   *  Number of results to return in the list.
   */
  // const pageSize = 1234
  /**
   *  Page start.
   */
  // const pageToken = 'abc123'
  /**
   *  A filter expression that filters resources listed in the response.
   *  Expressions must follow API improvement proposal
   *  AIP-160 (https://google.aip.dev/160). e.g.
   *  `remote_uri:"https://github.com*"`.
   */
  // const filter = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callListRepositories() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await cloudbuildClient.listRepositoriesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListRepositories();

listRepositoriesStream(request, options)

listRepositoriesStream(request?: protos.google.devtools.cloudbuild.v2.IListRepositoriesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing Repository on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listRepositoriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchConnectionFromConnectionName(connectionName)

matchConnectionFromConnectionName(connectionName: string): string | number;

Parse the connection from Connection resource.

Parameter
NameDescription
connectionName string

A fully-qualified path representing Connection resource.

Returns
TypeDescription
string | number

{string} A string representing the connection.

matchConnectionFromRepositoryName(repositoryName)

matchConnectionFromRepositoryName(repositoryName: string): string | number;

Parse the connection from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the connection.

matchLocationFromConnectionName(connectionName)

matchLocationFromConnectionName(connectionName: string): string | number;

Parse the location from Connection resource.

Parameter
NameDescription
connectionName string

A fully-qualified path representing Connection resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromRepositoryName(repositoryName)

matchLocationFromRepositoryName(repositoryName: string): string | number;

Parse the location from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromServiceName(serviceName)

matchLocationFromServiceName(serviceName: string): string | number;

Parse the location from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchNamespaceFromServiceName(serviceName)

matchNamespaceFromServiceName(serviceName: string): string | number;

Parse the namespace from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchProjectFromConnectionName(connectionName)

matchProjectFromConnectionName(connectionName: string): string | number;

Parse the project from Connection resource.

Parameter
NameDescription
connectionName string

A fully-qualified path representing Connection resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromRepositoryName(repositoryName)

matchProjectFromRepositoryName(repositoryName: string): string | number;

Parse the project from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSecretVersionName(secretVersionName)

matchProjectFromSecretVersionName(secretVersionName: string): string | number;

Parse the project from SecretVersion resource.

Parameter
NameDescription
secretVersionName string

A fully-qualified path representing SecretVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromServiceName(serviceName)

matchProjectFromServiceName(serviceName: string): string | number;

Parse the project from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchRepositoryFromRepositoryName(repositoryName)

matchRepositoryFromRepositoryName(repositoryName: string): string | number;

Parse the repository from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the repository.

matchSecretFromSecretVersionName(secretVersionName)

matchSecretFromSecretVersionName(secretVersionName: string): string | number;

Parse the secret from SecretVersion resource.

Parameter
NameDescription
secretVersionName string

A fully-qualified path representing SecretVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the secret.

matchServiceFromServiceName(serviceName)

matchServiceFromServiceName(serviceName: string): string | number;

Parse the service from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchVersionFromSecretVersionName(secretVersionName)

matchVersionFromSecretVersionName(secretVersionName: string): string | number;

Parse the version from SecretVersion resource.

Parameter
NameDescription
secretVersionName string

A fully-qualified path representing SecretVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the version.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

repositoryPath(project, location, connection, repository)

repositoryPath(project: string, location: string, connection: string, repository: string): string;

Return a fully-qualified repository resource name string.

Parameters
NameDescription
project string
location string
connection string
repository string
Returns
TypeDescription
string

{string} Resource name string.

secretVersionPath(project, secret, version)

secretVersionPath(project: string, secret: string, version: string): string;

Return a fully-qualified secretVersion resource name string.

Parameters
NameDescription
project string
secret string
version string
Returns
TypeDescription
string

{string} Resource name string.

servicePath(project, location, namespace, service)

servicePath(project: string, location: string, namespace: string, service: string): string;

Return a fully-qualified service resource name string.

Parameters
NameDescription
project string
location string
namespace string
service string
Returns
TypeDescription
string

{string} Resource name string.

setIamPolicy(request, options, callback)

setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

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
NameDescription
request IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

testIamPermissions(request, options, callback)

testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.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
NameDescription
request IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.TestIamPermissionsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

updateConnection(request, options)

updateConnection(request?: protos.google.devtools.cloudbuild.v2.IUpdateConnectionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates a single connection.

Parameters
NameDescription
request IUpdateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The Connection to update.
   */
  // const connection = {}
  /**
   *  The list of fields to be updated.
   */
  // const updateMask = {}
  /**
   *  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).
   */
  // const allowMissing = true
  /**
   *  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.
   */
  // const etag = 'abc123'

  // Imports the Cloudbuild library
  const {RepositoryManagerClient} = require('@google-cloud/cloudbuild').v2;

  // Instantiates a client
  const cloudbuildClient = new RepositoryManagerClient();

  async function callUpdateConnection() {
    // Construct request
    const request = {
      connection,
    };

    // Run request
    const [operation] = await cloudbuildClient.updateConnection(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateConnection();

updateConnection(request, options, callback)

updateConnection(request: protos.google.devtools.cloudbuild.v2.IUpdateConnectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateConnectionRequest
options CallOptions
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConnection(request, callback)

updateConnection(request: protos.google.devtools.cloudbuild.v2.IUpdateConnectionRequest, callback: Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateConnectionRequest
callback Callback<LROperation<protos.google.devtools.cloudbuild.v2.IConnection, protos.google.devtools.cloudbuild.v2.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void