Class v1.DeveloperConnectClient (0.1.0)

Service describing handlers for resources v1

Package

@google-cloud/developerconnect

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of DeveloperConnectClient.

Parameters
Name Description
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 DeveloperConnectClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

developerConnectStub

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

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.

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.

universeDomain

get universeDomain(): string;

warn

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

Methods

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
Name Description
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
Type Description
Promise<protos.google.protobuf.Empty>
Example

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

checkCreateConnectionProgress(name)

checkCreateConnectionProgress(name: string): Promise<LROperation<protos.google.cloud.developerconnect.v1.Connection, protos.google.cloud.developerconnect.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.developerconnect.v1.Connection, protos.google.cloud.developerconnect.v1.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. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. Id of the requesting object
   *  If auto-generating Id server-side, remove this field and
   *  connection_id from the method_signature of Create RPC
   */
  // const connectionId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const connection = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callCreateConnection();

checkCreateGitRepositoryLinkProgress(name)

checkCreateGitRepositoryLinkProgress(name: string): Promise<LROperation<protos.google.cloud.developerconnect.v1.GitRepositoryLink, protos.google.cloud.developerconnect.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.developerconnect.v1.GitRepositoryLink, protos.google.cloud.developerconnect.v1.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. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const gitRepositoryLink = {}
  /**
   *  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 gitRepositoryLinkId = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

  async function callCreateGitRepositoryLink() {
    // Construct request
    const request = {
      parent,
      gitRepositoryLink,
      gitRepositoryLinkId,
    };

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

  callCreateGitRepositoryLink();

checkDeleteConnectionProgress(name)

checkDeleteConnectionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.developerconnect.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.developerconnect.v1.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. Name of the resource
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true
  /**
   *  Optional. 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'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callDeleteConnection();

checkDeleteGitRepositoryLinkProgress(name)

checkDeleteGitRepositoryLinkProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.developerconnect.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.developerconnect.v1.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. Name of the resource
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true
  /**
   *  Optional. This checksum is computed by the server based on the value of
   *  other fields, and may be sent on update and delete requests to ensure the
   *  client has an up-to-date value before proceeding.
   */
  // const etag = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callDeleteGitRepositoryLink();

checkUpdateConnectionProgress(name)

checkUpdateConnectionProgress(name: string): Promise<LROperation<protos.google.cloud.developerconnect.v1.Connection, protos.google.cloud.developerconnect.v1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.developerconnect.v1.Connection, protos.google.cloud.developerconnect.v1.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. Field mask is used to specify the fields to be overwritten in the
   *  Connection resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const connection = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. 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
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

    // Run request
    const [operation] = await developerconnectClient.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
Type Description
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
Name Description
project string
location string
connection string
Returns
Type Description
string

{string} Resource name string.

createConnection(request, options)

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

Creates a new Connection in a given project and location.

Parameters
Name Description
request ICreateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.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. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. Id of the requesting object
   *  If auto-generating Id server-side, remove this field and
   *  connection_id from the method_signature of Create RPC
   */
  // const connectionId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const connection = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callCreateConnection();

createConnection(request, options, callback)

createConnection(request: protos.google.cloud.developerconnect.v1.ICreateConnectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateConnectionRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createConnection(request, callback)

createConnection(request: protos.google.cloud.developerconnect.v1.ICreateConnectionRequest, callback: Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateConnectionRequest
callback Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void
createGitRepositoryLink(request?: protos.google.cloud.developerconnect.v1.ICreateGitRepositoryLinkRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

Parameters
Name Description
request ICreateGitRepositoryLinkRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.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. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const gitRepositoryLink = {}
  /**
   *  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 gitRepositoryLinkId = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

  async function callCreateGitRepositoryLink() {
    // Construct request
    const request = {
      parent,
      gitRepositoryLink,
      gitRepositoryLinkId,
    };

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

  callCreateGitRepositoryLink();

createGitRepositoryLink(request: protos.google.cloud.developerconnect.v1.ICreateGitRepositoryLinkRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateGitRepositoryLinkRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void
createGitRepositoryLink(request: protos.google.cloud.developerconnect.v1.ICreateGitRepositoryLinkRequest, callback: Callback<LROperation<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateGitRepositoryLinkRequest
callback Callback<LROperation<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteConnection(request, options)

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

Deletes a single Connection.

Parameters
Name Description
request IDeleteConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.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. Name of the resource
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true
  /**
   *  Optional. 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'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callDeleteConnection();

deleteConnection(request, options, callback)

deleteConnection(request: protos.google.cloud.developerconnect.v1.IDeleteConnectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteConnectionRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteConnection(request, callback)

deleteConnection(request: protos.google.cloud.developerconnect.v1.IDeleteConnectionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteConnectionRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void
deleteGitRepositoryLink(request?: protos.google.cloud.developerconnect.v1.IDeleteGitRepositoryLinkRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single GitRepositoryLink.

Parameters
Name Description
request IDeleteGitRepositoryLinkRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.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. Name of the resource
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true
  /**
   *  Optional. This checksum is computed by the server based on the value of
   *  other fields, and may be sent on update and delete requests to ensure the
   *  client has an up-to-date value before proceeding.
   */
  // const etag = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callDeleteGitRepositoryLink();

deleteGitRepositoryLink(request: protos.google.cloud.developerconnect.v1.IDeleteGitRepositoryLinkRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteGitRepositoryLinkRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void
deleteGitRepositoryLink(request: protos.google.cloud.developerconnect.v1.IDeleteGitRepositoryLinkRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteGitRepositoryLinkRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
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
Type Description
Promise<protos.google.protobuf.Empty>
Example

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

fetchGitHubInstallations(request, options)

fetchGitHubInstallations(request?: protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsResponse,
        (protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest | undefined),
        {} | undefined
    ]>;

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

Parameters
Name Description
request IFetchGitHubInstallationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsResponse, (protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest | undefined), {} | undefined ]>

{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

  /**
   * 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 connection in the format
   *  `projects/* /locations/* /connections/*`.
   */
  // const connection = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

    // Run request
    const response = await developerconnectClient.fetchGitHubInstallations(request);
    console.log(response);
  }

  callFetchGitHubInstallations();

fetchGitHubInstallations(request, options, callback)

fetchGitHubInstallations(request: protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest, options: CallOptions, callback: Callback<protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsResponse, protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFetchGitHubInstallationsRequest
options CallOptions
callback Callback<protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsResponse, protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

fetchGitHubInstallations(request, callback)

fetchGitHubInstallations(request: protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest, callback: Callback<protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsResponse, protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFetchGitHubInstallationsRequest
callback Callback<protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsResponse, protos.google.cloud.developerconnect.v1.IFetchGitHubInstallationsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

fetchGitRefs(request, options)

fetchGitRefs(request?: protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, options?: CallOptions): Promise<[
        string[],
        protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest | null,
        protos.google.cloud.developerconnect.v1.IFetchGitRefsResponse
    ]>;

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

Parameters
Name Description
request IFetchGitRefsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ string[], protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest | null, protos.google.cloud.developerconnect.v1.IFetchGitRefsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of string. 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 fetchGitRefsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

fetchGitRefs(request, options, callback)

fetchGitRefs(request: protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, protos.google.cloud.developerconnect.v1.IFetchGitRefsResponse | null | undefined, string>): void;
Parameters
Name Description
request IFetchGitRefsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, protos.google.cloud.developerconnect.v1.IFetchGitRefsResponse | null | undefined, string>
Returns
Type Description
void

fetchGitRefs(request, callback)

fetchGitRefs(request: protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, protos.google.cloud.developerconnect.v1.IFetchGitRefsResponse | null | undefined, string>): void;
Parameters
Name Description
request IFetchGitRefsRequest
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, protos.google.cloud.developerconnect.v1.IFetchGitRefsResponse | null | undefined, string>
Returns
Type Description
void

fetchGitRefsAsync(request, options)

fetchGitRefsAsync(request?: protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, options?: CallOptions): AsyncIterable<string>;

Equivalent to fetchGitRefs, but returns an iterable object.

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

Parameters
Name Description
request IFetchGitRefsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<string>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing string. 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 resource name of GitRepositoryLink in the format
   *  `projects/* /locations/* /connections/* /gitRepositoryLinks/*`.
   */
  // const gitRepositoryLink = 'abc123'
  /**
   *  Required. Type of refs to fetch.
   */
  // const refType = {}
  /**
   *  Optional. Number of results to return in the list. Default to 20.
   */
  // const pageSize = 1234
  /**
   *  Optional. Page start.
   */
  // const pageToken = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callFetchGitRefs();

fetchGitRefsStream(request, options)

fetchGitRefsStream(request?: protos.google.cloud.developerconnect.v1.IFetchGitRefsRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IFetchGitRefsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing string 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 fetchGitRefsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

fetchLinkableGitRepositories(request, options)

fetchLinkableGitRepositories(request?: protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.developerconnect.v1.ILinkableGitRepository[],
        protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest | null,
        protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesResponse
    ]>;

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to a Connection.

Parameters
Name Description
request IFetchLinkableGitRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.ILinkableGitRepository[], protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest | null, protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of LinkableGitRepository. 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 fetchLinkableGitRepositoriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

fetchLinkableGitRepositories(request, options, callback)

fetchLinkableGitRepositories(request: protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesResponse | null | undefined, protos.google.cloud.developerconnect.v1.ILinkableGitRepository>): void;
Parameters
Name Description
request IFetchLinkableGitRepositoriesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesResponse | null | undefined, protos.google.cloud.developerconnect.v1.ILinkableGitRepository>
Returns
Type Description
void

fetchLinkableGitRepositories(request, callback)

fetchLinkableGitRepositories(request: protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesResponse | null | undefined, protos.google.cloud.developerconnect.v1.ILinkableGitRepository>): void;
Parameters
Name Description
request IFetchLinkableGitRepositoriesRequest
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesResponse | null | undefined, protos.google.cloud.developerconnect.v1.ILinkableGitRepository>
Returns
Type Description
void

fetchLinkableGitRepositoriesAsync(request, options)

fetchLinkableGitRepositoriesAsync(request?: protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.developerconnect.v1.ILinkableGitRepository>;

Equivalent to fetchLinkableGitRepositories, but returns an iterable object.

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

Parameters
Name Description
request IFetchLinkableGitRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.developerconnect.v1.ILinkableGitRepository>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing LinkableGitRepository. 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'
  /**
   *  Optional. Number of results to return in the list. Defaults to 20.
   */
  // const pageSize = 1234
  /**
   *  Optional. Page start.
   */
  // const pageToken = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callFetchLinkableGitRepositories();

fetchLinkableGitRepositoriesStream(request, options)

fetchLinkableGitRepositoriesStream(request?: protos.google.cloud.developerconnect.v1.IFetchLinkableGitRepositoriesRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IFetchLinkableGitRepositoriesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing LinkableGitRepository 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 fetchLinkableGitRepositoriesAsync() 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.cloud.developerconnect.v1.IFetchReadTokenRequest, options?: CallOptions): Promise<[
        protos.google.cloud.developerconnect.v1.IFetchReadTokenResponse,
        (protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest | undefined),
        {} | undefined
    ]>;

Fetches read token of a given gitRepositoryLink.

Parameters
Name Description
request IFetchReadTokenRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IFetchReadTokenResponse, (protos.google.cloud.developerconnect.v1.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 gitRepositoryLink in the format
   *  `projects/* /locations/* /connections/* /gitRepositoryLinks/*`.
   */
  // const gitRepositoryLink = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callFetchReadToken();

fetchReadToken(request, options, callback)

fetchReadToken(request: protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest, options: CallOptions, callback: Callback<protos.google.cloud.developerconnect.v1.IFetchReadTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFetchReadTokenRequest
options CallOptions
callback Callback<protos.google.cloud.developerconnect.v1.IFetchReadTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

fetchReadToken(request, callback)

fetchReadToken(request: protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest, callback: Callback<protos.google.cloud.developerconnect.v1.IFetchReadTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFetchReadTokenRequest
callback Callback<protos.google.cloud.developerconnect.v1.IFetchReadTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadTokenRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

fetchReadWriteToken(request, options)

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

Fetches read/write token of a given gitRepositoryLink.

Parameters
Name Description
request IFetchReadWriteTokenRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenResponse, (protos.google.cloud.developerconnect.v1.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 gitRepositoryLink in the format
   *  `projects/* /locations/* /connections/* /gitRepositoryLinks/*`.
   */
  // const gitRepositoryLink = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callFetchReadWriteToken();

fetchReadWriteToken(request, options, callback)

fetchReadWriteToken(request: protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenRequest, options: CallOptions, callback: Callback<protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFetchReadWriteTokenRequest
options CallOptions
callback Callback<protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

fetchReadWriteToken(request, callback)

fetchReadWriteToken(request: protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenRequest, callback: Callback<protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IFetchReadWriteTokenRequest
callback Callback<protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenResponse, protos.google.cloud.developerconnect.v1.IFetchReadWriteTokenRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getConnection(request, options)

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

Gets details of a single Connection.

Parameters
Name Description
request IGetConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.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. Name of the resource
   */
  // const name = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callGetConnection();

getConnection(request, options, callback)

getConnection(request: protos.google.cloud.developerconnect.v1.IGetConnectionRequest, options: CallOptions, callback: Callback<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetConnectionRequest
options CallOptions
callback Callback<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getConnection(request, callback)

getConnection(request: protos.google.cloud.developerconnect.v1.IGetConnectionRequest, callback: Callback<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetConnectionRequest
callback Callback<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IGetConnectionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void
getGitRepositoryLink(request?: protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest, options?: CallOptions): Promise<[
        protos.google.cloud.developerconnect.v1.IGitRepositoryLink,
        (protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single GitRepositoryLink.

Parameters
Name Description
request IGetGitRepositoryLinkRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IGitRepositoryLink, (protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing GitRepositoryLink. 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. Name of the resource
   */
  // const name = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

    // Run request
    const response = await developerconnectClient.getGitRepositoryLink(request);
    console.log(response);
  }

  callGetGitRepositoryLink();

getGitRepositoryLink(request: protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest, options: CallOptions, callback: Callback<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetGitRepositoryLinkRequest
options CallOptions
callback Callback<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void
getGitRepositoryLink(request: protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest, callback: Callback<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetGitRepositoryLinkRequest
callback Callback<protos.google.cloud.developerconnect.v1.IGitRepositoryLink, protos.google.cloud.developerconnect.v1.IGetGitRepositoryLinkRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

gitRepositoryLinkPath(project, location, connection, gitRepositoryLink)

gitRepositoryLinkPath(project: string, location: string, connection: string, gitRepositoryLink: string): string;

Return a fully-qualified gitRepositoryLink resource name string.

Parameters
Name Description
project string
location string
connection string
gitRepositoryLink string
Returns
Type Description
string

{string} Resource name string.

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
Type Description
Promise<{ [name: string]: Function; }>

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

listConnections(request, options)

listConnections(request?: protos.google.cloud.developerconnect.v1.IListConnectionsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.developerconnect.v1.IConnection[],
        protos.google.cloud.developerconnect.v1.IListConnectionsRequest | null,
        protos.google.cloud.developerconnect.v1.IListConnectionsResponse
    ]>;

Lists Connections in a given project and location.

Parameters
Name Description
request IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IConnection[], protos.google.cloud.developerconnect.v1.IListConnectionsRequest | null, protos.google.cloud.developerconnect.v1.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.cloud.developerconnect.v1.IListConnectionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IListConnectionsRequest, protos.google.cloud.developerconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.developerconnect.v1.IConnection>): void;
Parameters
Name Description
request IListConnectionsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IListConnectionsRequest, protos.google.cloud.developerconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.developerconnect.v1.IConnection>
Returns
Type Description
void

listConnections(request, callback)

listConnections(request: protos.google.cloud.developerconnect.v1.IListConnectionsRequest, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IListConnectionsRequest, protos.google.cloud.developerconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.developerconnect.v1.IConnection>): void;
Parameters
Name Description
request IListConnectionsRequest
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IListConnectionsRequest, protos.google.cloud.developerconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.developerconnect.v1.IConnection>
Returns
Type Description
void

listConnectionsAsync(request, options)

listConnectionsAsync(request?: protos.google.cloud.developerconnect.v1.IListConnectionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.developerconnect.v1.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
Name Description
request IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.developerconnect.v1.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. Parent value for ListConnectionsRequest
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results
   */
  // const orderBy = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callListConnections();

listConnectionsStream(request, options)

listConnectionsStream(request?: protos.google.cloud.developerconnect.v1.IListConnectionsRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IListConnectionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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.

listGitRepositoryLinks(request?: protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, options?: CallOptions): Promise<[
        protos.google.cloud.developerconnect.v1.IGitRepositoryLink[],
        protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest | null,
        protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksResponse
    ]>;

Lists GitRepositoryLinks in a given project, location, and connection.

Parameters
Name Description
request IListGitRepositoryLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.developerconnect.v1.IGitRepositoryLink[], protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest | null, protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of GitRepositoryLink. 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 listGitRepositoryLinksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listGitRepositoryLinks(request: protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksResponse | null | undefined, protos.google.cloud.developerconnect.v1.IGitRepositoryLink>): void;
Parameters
Name Description
request IListGitRepositoryLinksRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksResponse | null | undefined, protos.google.cloud.developerconnect.v1.IGitRepositoryLink>
Returns
Type Description
void
listGitRepositoryLinks(request: protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, callback: PaginationCallback<protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksResponse | null | undefined, protos.google.cloud.developerconnect.v1.IGitRepositoryLink>): void;
Parameters
Name Description
request IListGitRepositoryLinksRequest
callback PaginationCallback<protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksResponse | null | undefined, protos.google.cloud.developerconnect.v1.IGitRepositoryLink>
Returns
Type Description
void

listGitRepositoryLinksAsync(request, options)

listGitRepositoryLinksAsync(request?: protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.developerconnect.v1.IGitRepositoryLink>;

Equivalent to listGitRepositoryLinks, but returns an iterable object.

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

Parameters
Name Description
request IListGitRepositoryLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.developerconnect.v1.IGitRepositoryLink>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing GitRepositoryLink. 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. Parent value for ListGitRepositoryLinksRequest
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filtering results
   */
  // const filter = 'abc123'
  /**
   *  Optional. Hint for how to order the results
   */
  // const orderBy = 'abc123'

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callListGitRepositoryLinks();

listGitRepositoryLinksStream(request, options)

listGitRepositoryLinksStream(request?: protos.google.cloud.developerconnect.v1.IListGitRepositoryLinksRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IListGitRepositoryLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing GitRepositoryLink 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 listGitRepositoryLinksAsync() 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
Name Description
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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)

locationPath(project, location)

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

Return a fully-qualified location resource name string.

Parameters
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

matchConnectionFromConnectionName(connectionName)

matchConnectionFromConnectionName(connectionName: string): string | number;

Parse the connection from Connection resource.

Parameter
Name Description
connectionName string

A fully-qualified path representing Connection resource.

Returns
Type Description
string | number

{string} A string representing the connection.

matchConnectionFromGitRepositoryLinkName(gitRepositoryLinkName)

matchConnectionFromGitRepositoryLinkName(gitRepositoryLinkName: string): string | number;

Parse the connection from GitRepositoryLink resource.

Parameter
Name Description
gitRepositoryLinkName string

A fully-qualified path representing GitRepositoryLink resource.

Returns
Type Description
string | number

{string} A string representing the connection.

matchGitRepositoryLinkFromGitRepositoryLinkName(gitRepositoryLinkName)

matchGitRepositoryLinkFromGitRepositoryLinkName(gitRepositoryLinkName: string): string | number;

Parse the git_repository_link from GitRepositoryLink resource.

Parameter
Name Description
gitRepositoryLinkName string

A fully-qualified path representing GitRepositoryLink resource.

Returns
Type Description
string | number

{string} A string representing the git_repository_link.

matchLocationFromConnectionName(connectionName)

matchLocationFromConnectionName(connectionName: string): string | number;

Parse the location from Connection resource.

Parameter
Name Description
connectionName string

A fully-qualified path representing Connection resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromGitRepositoryLinkName(gitRepositoryLinkName)

matchLocationFromGitRepositoryLinkName(gitRepositoryLinkName: string): string | number;

Parse the location from GitRepositoryLink resource.

Parameter
Name Description
gitRepositoryLinkName string

A fully-qualified path representing GitRepositoryLink resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchProjectFromConnectionName(connectionName)

matchProjectFromConnectionName(connectionName: string): string | number;

Parse the project from Connection resource.

Parameter
Name Description
connectionName string

A fully-qualified path representing Connection resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromGitRepositoryLinkName(gitRepositoryLinkName)

matchProjectFromGitRepositoryLinkName(gitRepositoryLinkName: string): string | number;

Parse the project from GitRepositoryLink resource.

Parameter
Name Description
gitRepositoryLinkName string

A fully-qualified path representing GitRepositoryLink resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
Name Description
projectName string

A fully-qualified path representing Project resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromSecretVersionName(secretVersionName)

matchProjectFromSecretVersionName(secretVersionName: string): string | number;

Parse the project from SecretVersion resource.

Parameter
Name Description
secretVersionName string

A fully-qualified path representing SecretVersion resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchSecretFromSecretVersionName(secretVersionName)

matchSecretFromSecretVersionName(secretVersionName: string): string | number;

Parse the secret from SecretVersion resource.

Parameter
Name Description
secretVersionName string

A fully-qualified path representing SecretVersion resource.

Returns
Type Description
string | number

{string} A string representing the secret.

matchSecretVersionFromSecretVersionName(secretVersionName)

matchSecretVersionFromSecretVersionName(secretVersionName: string): string | number;

Parse the secret_version from SecretVersion resource.

Parameter
Name Description
secretVersionName string

A fully-qualified path representing SecretVersion resource.

Returns
Type Description
string | number

{string} A string representing the secret_version.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
Name Description
project string
Returns
Type Description
string

{string} Resource name string.

secretVersionPath(project, secret, secretVersion)

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

Return a fully-qualified secretVersion resource name string.

Parameters
Name Description
project string
secret string
secretVersion string
Returns
Type Description
string

{string} Resource name string.

updateConnection(request, options)

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

Updates the parameters of a single Connection.

Parameters
Name Description
request IUpdateConnectionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.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. Field mask is used to specify the fields to be overwritten in the
   *  Connection resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const connection = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and the
   *  request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. 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
  /**
   *  Optional. If set, validate the request, but do not actually post it.
   */
  // const validateOnly = true

  // Imports the Developerconnect library
  const {DeveloperConnectClient} = require('@google-cloud/developerconnect').v1;

  // Instantiates a client
  const developerconnectClient = new DeveloperConnectClient();

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

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

  callUpdateConnection();

updateConnection(request, options, callback)

updateConnection(request: protos.google.cloud.developerconnect.v1.IUpdateConnectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateConnectionRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateConnection(request, callback)

updateConnection(request: protos.google.cloud.developerconnect.v1.IUpdateConnectionRequest, callback: Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateConnectionRequest
callback Callback<LROperation<protos.google.cloud.developerconnect.v1.IConnection, protos.google.cloud.developerconnect.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void