Class v2alpha.FunctionServiceClient (3.1.0)

Google Cloud Functions is used to deploy functions that are executed by Google in response to various events. Data connected with that event is passed to a function as the input data.

A **function** is a resource which describes a function that should be executed and how it is triggered. v2alpha

Package

@google-cloud/functions

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of FunctionServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

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

Properties

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

functionServiceStub

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

iamClient

iamClient: IamClient;

innerApiCalls

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

locationsClient

locationsClient: LocationsClient;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

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

Methods

buildPath(project, location, build)

buildPath(project: string, location: string, build: string): string;

Return a fully-qualified build resource name string.

Parameters
NameDescription
project string
location string
build string
Returns
TypeDescription
string

{string} Resource name string.

cancelOperation(request, options, callback)

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

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

Parameters
NameDescription
request CancelOperationRequest

The request object that will be sent.

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

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

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

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

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

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

channelPath(project, location, channel)

channelPath(project: string, location: string, channel: string): string;

Return a fully-qualified channel resource name string.

Parameters
NameDescription
project string
location string
channel string
Returns
TypeDescription
string

{string} Resource name string.

checkCreateFunctionProgress(name)

checkCreateFunctionProgress(name: string): Promise<LROperation<protos.google.cloud.functions.v2alpha.Function, protos.google.cloud.functions.v2alpha.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.functions.v2alpha.Function, protos.google.cloud.functions.v2alpha.OperationMetadata>>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The project and location in which the function should be created,
   *  specified in the format `projects/* /locations/*`
   */
  // const parent = 'abc123'
  /**
   *  Required. Function to be created.
   */
  // const function = {}
  /**
   *  The ID to use for the function, which will become the final component of
   *  the function's resource name.
   *  This value should be 4-63 characters, and valid characters
   *  are /[a-z][0-9]-/.
   */
  // const functionId = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

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

  callCreateFunction();

checkDeleteFunctionProgress(name)

checkDeleteFunctionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.functions.v2alpha.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.functions.v2alpha.OperationMetadata>>

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

Example

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

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

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

  callDeleteFunction();

checkUpdateFunctionProgress(name)

checkUpdateFunctionProgress(name: string): Promise<LROperation<protos.google.cloud.functions.v2alpha.Function, protos.google.cloud.functions.v2alpha.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.functions.v2alpha.Function, protos.google.cloud.functions.v2alpha.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. New version of the function.
   */
  // const function = {}
  /**
   *  The list of fields to be updated.
   *  If no field mask is provided, all provided fields in the request will be
   *  updated.
   */
  // const updateMask = {}

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

  async function callUpdateFunction() {
    // Construct request
    const request = {
      function1,
    };

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

  callUpdateFunction();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

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

Returns
TypeDescription
Promise<void>

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

connectorPath(project, location, connector)

connectorPath(project: string, location: string, connector: string): string;

Return a fully-qualified connector resource name string.

Parameters
NameDescription
project string
location string
connector string
Returns
TypeDescription
string

{string} Resource name string.

createFunction(request, options)

createFunction(request?: protos.google.cloud.functions.v2alpha.ICreateFunctionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return ALREADY_EXISTS error.

Parameters
NameDescription
request ICreateFunctionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The project and location in which the function should be created,
   *  specified in the format `projects/* /locations/*`
   */
  // const parent = 'abc123'
  /**
   *  Required. Function to be created.
   */
  // const function = {}
  /**
   *  The ID to use for the function, which will become the final component of
   *  the function's resource name.
   *  This value should be 4-63 characters, and valid characters
   *  are /[a-z][0-9]-/.
   */
  // const functionId = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

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

  callCreateFunction();

createFunction(request, options, callback)

createFunction(request: protos.google.cloud.functions.v2alpha.ICreateFunctionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateFunctionRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createFunction(request, callback)

createFunction(request: protos.google.cloud.functions.v2alpha.ICreateFunctionRequest, callback: Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateFunctionRequest
callback Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cryptoKeyPath(project, location, keyRing, cryptoKey)

cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string;

Return a fully-qualified cryptoKey resource name string.

Parameters
NameDescription
project string
location string
keyRing string
cryptoKey string
Returns
TypeDescription
string

{string} Resource name string.

deleteFunction(request, options)

deleteFunction(request?: protos.google.cloud.functions.v2alpha.IDeleteFunctionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.functions.v2alpha.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function.

Parameters
NameDescription
request IDeleteFunctionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

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

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

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

  callDeleteFunction();

deleteFunction(request, options, callback)

deleteFunction(request: protos.google.cloud.functions.v2alpha.IDeleteFunctionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteFunctionRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteFunction(request, callback)

deleteFunction(request: protos.google.cloud.functions.v2alpha.IDeleteFunctionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteFunctionRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteOperation(request, options, callback)

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

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

Parameters
NameDescription
request DeleteOperationRequest

The request object that will be sent.

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

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

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

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

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

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

functionPath(project, location, functionParam)

functionPath(project: string, location: string, functionParam: string): string;

Return a fully-qualified function resource name string.

Parameters
NameDescription
project string
location string
functionParam string
Returns
TypeDescription
string

{string} Resource name string.

generateDownloadUrl(request, options)

generateDownloadUrl(request?: protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest, options?: CallOptions): Promise<[
        protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlResponse,
        (protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest | undefined),
        {} | undefined
    ]>;

Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within 30 minutes of generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls

Parameters
NameDescription
request IGenerateDownloadUrlRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlResponse, (protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing GenerateDownloadUrlResponse. 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 function for which source code Google Cloud Storage
   *  signed URL should be generated.
   */
  // const name = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

    // Run request
    const response = await functionsClient.generateDownloadUrl(request);
    console.log(response);
  }

  callGenerateDownloadUrl();

generateDownloadUrl(request, options, callback)

generateDownloadUrl(request: protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest, options: CallOptions, callback: Callback<protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateDownloadUrlRequest
options CallOptions
callback Callback<protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateDownloadUrl(request, callback)

generateDownloadUrl(request: protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest, callback: Callback<protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateDownloadUrlRequest
callback Callback<protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateDownloadUrlRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateUploadUrl(request, options)

generateUploadUrl(request?: protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest, options?: CallOptions): Promise<[
        protos.google.cloud.functions.v2alpha.IGenerateUploadUrlResponse,
        (protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest | undefined),
        {} | undefined
    ]>;

Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code.

When uploading source code to the generated signed URL, please follow these restrictions:

* Source file type should be a zip file. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL.

When making a HTTP PUT request, these two headers need to be specified:

* content-type: application/zip

And this header SHOULD NOT be specified:

* Authorization: Bearer YOUR_TOKEN

Parameters
NameDescription
request IGenerateUploadUrlRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.functions.v2alpha.IGenerateUploadUrlResponse, (protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing GenerateUploadUrlResponse. 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 project and location in which the Google Cloud Storage signed
   *  URL should be generated, specified in the format `projects/* /locations/*`.
   */
  // const parent = 'abc123'
  /**
   *  Preview  Resource name of a KMS crypto key (managed by the user) used to
   *  encrypt/decrypt function source code objects in intermediate Cloud Storage
   *  buckets. When you generate an upload url and upload your source code, it
   *  gets copied to an intermediate Cloud Storage bucket. The source code is
   *  then copied to a versioned directory in the sources bucket in the consumer
   *  project during the function deployment.
   *  It must match the pattern
   *  `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
   *  The Google Cloud Functions service account
   *  (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
   *  granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
   *  (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
   *  Key/KeyRing/Project/Organization (least access preferred).
   */
  // const kmsKeyName = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

    // Run request
    const response = await functionsClient.generateUploadUrl(request);
    console.log(response);
  }

  callGenerateUploadUrl();

generateUploadUrl(request, options, callback)

generateUploadUrl(request: protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest, options: CallOptions, callback: Callback<protos.google.cloud.functions.v2alpha.IGenerateUploadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateUploadUrlRequest
options CallOptions
callback Callback<protos.google.cloud.functions.v2alpha.IGenerateUploadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateUploadUrl(request, callback)

generateUploadUrl(request: protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest, callback: Callback<protos.google.cloud.functions.v2alpha.IGenerateUploadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateUploadUrlRequest
callback Callback<protos.google.cloud.functions.v2alpha.IGenerateUploadUrlResponse, protos.google.cloud.functions.v2alpha.IGenerateUploadUrlRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getFunction(request, options)

getFunction(request?: protos.google.cloud.functions.v2alpha.IGetFunctionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.functions.v2alpha.IFunction,
        protos.google.cloud.functions.v2alpha.IGetFunctionRequest | undefined,
        {} | undefined
    ]>;

Returns a function with the given name from the requested project.

Parameters
NameDescription
request IGetFunctionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IGetFunctionRequest | 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 name of the function which details should be obtained.
   */
  // const name = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

    // Run request
    const response = await functionsClient.getFunction(request);
    console.log(response);
  }

  callGetFunction();

getFunction(request, options, callback)

getFunction(request: protos.google.cloud.functions.v2alpha.IGetFunctionRequest, options: CallOptions, callback: Callback<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IGetFunctionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetFunctionRequest
options CallOptions
callback Callback<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IGetFunctionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getFunction(request, callback)

getFunction(request: protos.google.cloud.functions.v2alpha.IGetFunctionRequest, callback: Callback<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IGetFunctionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetFunctionRequest
callback Callback<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IGetFunctionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options, callback)

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

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

Parameters
NameDescription
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

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

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

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

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

The second parameter to the callback is an object representing .

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

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

getLocation(request, options, callback)

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

Gets information about a location.

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

The request object that will be sent.

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

Call options. See CallOptions for more details.

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

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

Example

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

getOperation(request, options, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

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

Parameters
NameDescription
request GetOperationRequest

The request object that will be sent.

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

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

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

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

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

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

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

getProjectId()

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

getProjectId(callback)

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

initialize()

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

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

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

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

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

listFunctions(request, options)

listFunctions(request?: protos.google.cloud.functions.v2alpha.IListFunctionsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.functions.v2alpha.IFunction[],
        protos.google.cloud.functions.v2alpha.IListFunctionsRequest | null,
        protos.google.cloud.functions.v2alpha.IListFunctionsResponse
    ]>;

Returns a list of functions that belong to the requested project.

Parameters
NameDescription
request IListFunctionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.functions.v2alpha.IFunction[], protos.google.cloud.functions.v2alpha.IListFunctionsRequest | null, protos.google.cloud.functions.v2alpha.IListFunctionsResponse ]>

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

listFunctions(request, options, callback)

listFunctions(request: protos.google.cloud.functions.v2alpha.IListFunctionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.functions.v2alpha.IListFunctionsRequest, protos.google.cloud.functions.v2alpha.IListFunctionsResponse | null | undefined, protos.google.cloud.functions.v2alpha.IFunction>): void;
Parameters
NameDescription
request IListFunctionsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.functions.v2alpha.IListFunctionsRequest, protos.google.cloud.functions.v2alpha.IListFunctionsResponse | null | undefined, protos.google.cloud.functions.v2alpha.IFunction>
Returns
TypeDescription
void

listFunctions(request, callback)

listFunctions(request: protos.google.cloud.functions.v2alpha.IListFunctionsRequest, callback: PaginationCallback<protos.google.cloud.functions.v2alpha.IListFunctionsRequest, protos.google.cloud.functions.v2alpha.IListFunctionsResponse | null | undefined, protos.google.cloud.functions.v2alpha.IFunction>): void;
Parameters
NameDescription
request IListFunctionsRequest
callback PaginationCallback<protos.google.cloud.functions.v2alpha.IListFunctionsRequest, protos.google.cloud.functions.v2alpha.IListFunctionsResponse | null | undefined, protos.google.cloud.functions.v2alpha.IFunction>
Returns
TypeDescription
void

listFunctionsAsync(request, options)

listFunctionsAsync(request?: protos.google.cloud.functions.v2alpha.IListFunctionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.functions.v2alpha.IFunction>;

Equivalent to listFunctions, but returns an iterable object.

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

Parameters
NameDescription
request IListFunctionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.functions.v2alpha.IFunction>

{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

  /**
   * 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 project and location from which the function should be
   *  listed, specified in the format `projects/* /locations/*` If you want to
   *  list functions in all locations, use "-" in place of a location. When
   *  listing functions in all locations, if one or more location(s) are
   *  unreachable, the response will contain functions from all reachable
   *  locations along with the names of any unreachable locations.
   */
  // const parent = 'abc123'
  /**
   *  Maximum number of functions to return per call. The largest allowed
   *  page_size is 1,000, if the page_size is omitted or specified as greater
   *  than 1,000 then it will be replaced as 1,000. The size of the list
   *  response can be less than specified when used with filters.
   */
  // const pageSize = 1234
  /**
   *  The value returned by the last
   *  `ListFunctionsResponse`; indicates that
   *  this is a continuation of a prior `ListFunctions` call, and that the
   *  system should return the next page of data.
   */
  // const pageToken = 'abc123'
  /**
   *  The filter for Functions that match the filter expression,
   *  following the syntax outlined in https://google.aip.dev/160.
   */
  // const filter = 'abc123'
  /**
   *  The sorting order of the resources returned. Value should be a comma
   *  separated list of fields. The default sorting oder is ascending.
   *  See https://google.aip.dev/132#ordering.
   */
  // const orderBy = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

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

  callListFunctions();

listFunctionsStream(request, options)

listFunctionsStream(request?: protos.google.cloud.functions.v2alpha.IListFunctionsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListFunctionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

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

listLocationsAsync(request, options)

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

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

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

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

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

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

Example

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

listOperationsAsync(request, options)

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

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

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

Parameters
NameDescription
request ListOperationsRequest

The request object that will be sent.

options CallOptions

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

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

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

Example

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

listRuntimes(request, options)

listRuntimes(request?: protos.google.cloud.functions.v2alpha.IListRuntimesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.functions.v2alpha.IListRuntimesResponse,
        protos.google.cloud.functions.v2alpha.IListRuntimesRequest | undefined,
        {} | undefined
    ]>;

Returns a list of runtimes that are supported for the requested project.

Parameters
NameDescription
request IListRuntimesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.functions.v2alpha.IListRuntimesResponse, protos.google.cloud.functions.v2alpha.IListRuntimesRequest | 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 project and location from which the runtimes should be
   *  listed, specified in the format `projects/* /locations/*`
   */
  // const parent = 'abc123'
  /**
   *  The filter for Runtimes that match the filter expression,
   *  following the syntax outlined in https://google.aip.dev/160.
   */
  // const filter = 'abc123'

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

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

    // Run request
    const response = await functionsClient.listRuntimes(request);
    console.log(response);
  }

  callListRuntimes();

listRuntimes(request, options, callback)

listRuntimes(request: protos.google.cloud.functions.v2alpha.IListRuntimesRequest, options: CallOptions, callback: Callback<protos.google.cloud.functions.v2alpha.IListRuntimesResponse, protos.google.cloud.functions.v2alpha.IListRuntimesRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IListRuntimesRequest
options CallOptions
callback Callback<protos.google.cloud.functions.v2alpha.IListRuntimesResponse, protos.google.cloud.functions.v2alpha.IListRuntimesRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

listRuntimes(request, callback)

listRuntimes(request: protos.google.cloud.functions.v2alpha.IListRuntimesRequest, callback: Callback<protos.google.cloud.functions.v2alpha.IListRuntimesResponse, protos.google.cloud.functions.v2alpha.IListRuntimesRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IListRuntimesRequest
callback Callback<protos.google.cloud.functions.v2alpha.IListRuntimesResponse, protos.google.cloud.functions.v2alpha.IListRuntimesRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

locationPath(project, location)

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

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchBuildFromBuildName(buildName)

matchBuildFromBuildName(buildName: string): string | number;

Parse the build from Build resource.

Parameter
NameDescription
buildName string

A fully-qualified path representing Build resource.

Returns
TypeDescription
string | number

{string} A string representing the build.

matchChannelFromChannelName(channelName)

matchChannelFromChannelName(channelName: string): string | number;

Parse the channel from Channel resource.

Parameter
NameDescription
channelName string

A fully-qualified path representing Channel resource.

Returns
TypeDescription
string | number

{string} A string representing the channel.

matchConnectorFromConnectorName(connectorName)

matchConnectorFromConnectorName(connectorName: string): string | number;

Parse the connector from Connector resource.

Parameter
NameDescription
connectorName string

A fully-qualified path representing Connector resource.

Returns
TypeDescription
string | number

{string} A string representing the connector.

matchCryptoKeyFromCryptoKeyName(cryptoKeyName)

matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the crypto_key from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key.

matchFunctionFromFunctionName(functionName)

matchFunctionFromFunctionName(functionName: string): string | number;

Parse the function from Function resource.

Parameter
NameDescription
functionName string

A fully-qualified path representing Function resource.

Returns
TypeDescription
string | number

{string} A string representing the function.

matchKeyRingFromCryptoKeyName(cryptoKeyName)

matchKeyRingFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the key_ring from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchLocationFromBuildName(buildName)

matchLocationFromBuildName(buildName: string): string | number;

Parse the location from Build resource.

Parameter
NameDescription
buildName string

A fully-qualified path representing Build resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromChannelName(channelName)

matchLocationFromChannelName(channelName: string): string | number;

Parse the location from Channel resource.

Parameter
NameDescription
channelName string

A fully-qualified path representing Channel resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromConnectorName(connectorName)

matchLocationFromConnectorName(connectorName: string): string | number;

Parse the location from Connector resource.

Parameter
NameDescription
connectorName string

A fully-qualified path representing Connector resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromCryptoKeyName(cryptoKeyName)

matchLocationFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the location from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromFunctionName(functionName)

matchLocationFromFunctionName(functionName: string): string | number;

Parse the location from Function resource.

Parameter
NameDescription
functionName string

A fully-qualified path representing Function resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromRepositoryName(repositoryName)

matchLocationFromRepositoryName(repositoryName: string): string | number;

Parse the location from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromServiceName(serviceName)

matchLocationFromServiceName(serviceName: string): string | number;

Parse the location from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromTriggerName(triggerName)

matchLocationFromTriggerName(triggerName: string): string | number;

Parse the location from Trigger resource.

Parameter
NameDescription
triggerName string

A fully-qualified path representing Trigger resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromWorkerPoolName(workerPoolName)

matchLocationFromWorkerPoolName(workerPoolName: string): string | number;

Parse the location from WorkerPool resource.

Parameter
NameDescription
workerPoolName string

A fully-qualified path representing WorkerPool resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromBuildName(buildName)

matchProjectFromBuildName(buildName: string): string | number;

Parse the project from Build resource.

Parameter
NameDescription
buildName string

A fully-qualified path representing Build resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromChannelName(channelName)

matchProjectFromChannelName(channelName: string): string | number;

Parse the project from Channel resource.

Parameter
NameDescription
channelName string

A fully-qualified path representing Channel resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromConnectorName(connectorName)

matchProjectFromConnectorName(connectorName: string): string | number;

Parse the project from Connector resource.

Parameter
NameDescription
connectorName string

A fully-qualified path representing Connector resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromCryptoKeyName(cryptoKeyName)

matchProjectFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the project from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromFunctionName(functionName)

matchProjectFromFunctionName(functionName: string): string | number;

Parse the project from Function resource.

Parameter
NameDescription
functionName string

A fully-qualified path representing Function resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromRepositoryName(repositoryName)

matchProjectFromRepositoryName(repositoryName: string): string | number;

Parse the project from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromServiceName(serviceName)

matchProjectFromServiceName(serviceName: string): string | number;

Parse the project from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromTopicName(topicName)

matchProjectFromTopicName(topicName: string): string | number;

Parse the project from Topic resource.

Parameter
NameDescription
topicName string

A fully-qualified path representing Topic resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromTriggerName(triggerName)

matchProjectFromTriggerName(triggerName: string): string | number;

Parse the project from Trigger resource.

Parameter
NameDescription
triggerName string

A fully-qualified path representing Trigger resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromWorkerPoolName(workerPoolName)

matchProjectFromWorkerPoolName(workerPoolName: string): string | number;

Parse the project from WorkerPool resource.

Parameter
NameDescription
workerPoolName string

A fully-qualified path representing WorkerPool resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchRepositoryFromRepositoryName(repositoryName)

matchRepositoryFromRepositoryName(repositoryName: string): string | number;

Parse the repository from Repository resource.

Parameter
NameDescription
repositoryName string

A fully-qualified path representing Repository resource.

Returns
TypeDescription
string | number

{string} A string representing the repository.

matchServiceFromServiceName(serviceName)

matchServiceFromServiceName(serviceName: string): string | number;

Parse the service from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchTopicFromTopicName(topicName)

matchTopicFromTopicName(topicName: string): string | number;

Parse the topic from Topic resource.

Parameter
NameDescription
topicName string

A fully-qualified path representing Topic resource.

Returns
TypeDescription
string | number

{string} A string representing the topic.

matchTriggerFromTriggerName(triggerName)

matchTriggerFromTriggerName(triggerName: string): string | number;

Parse the trigger from Trigger resource.

Parameter
NameDescription
triggerName string

A fully-qualified path representing Trigger resource.

Returns
TypeDescription
string | number

{string} A string representing the trigger.

matchWorkerPoolFromWorkerPoolName(workerPoolName)

matchWorkerPoolFromWorkerPoolName(workerPoolName: string): string | number;

Parse the worker_pool from WorkerPool resource.

Parameter
NameDescription
workerPoolName string

A fully-qualified path representing WorkerPool resource.

Returns
TypeDescription
string | number

{string} A string representing the worker_pool.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

repositoryPath(project, location, repository)

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

Return a fully-qualified repository resource name string.

Parameters
NameDescription
project string
location string
repository string
Returns
TypeDescription
string

{string} Resource name string.

servicePath(project, location, service)

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

Return a fully-qualified service resource name string.

Parameters
NameDescription
project string
location string
service string
Returns
TypeDescription
string

{string} Resource name string.

setIamPolicy(request, options, callback)

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

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

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

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

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

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

The second parameter to the callback is an object representing .

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

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

testIamPermissions(request, options, callback)

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

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

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

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

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

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

The second parameter to the callback is an object representing .

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

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

topicPath(project, topic)

topicPath(project: string, topic: string): string;

Return a fully-qualified topic resource name string.

Parameters
NameDescription
project string
topic string
Returns
TypeDescription
string

{string} Resource name string.

triggerPath(project, location, trigger)

triggerPath(project: string, location: string, trigger: string): string;

Return a fully-qualified trigger resource name string.

Parameters
NameDescription
project string
location string
trigger string
Returns
TypeDescription
string

{string} Resource name string.

updateFunction(request, options)

updateFunction(request?: protos.google.cloud.functions.v2alpha.IUpdateFunctionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates existing function.

Parameters
NameDescription
request IUpdateFunctionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.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. New version of the function.
   */
  // const function = {}
  /**
   *  The list of fields to be updated.
   *  If no field mask is provided, all provided fields in the request will be
   *  updated.
   */
  // const updateMask = {}

  // Imports the Functions library
  const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;

  // Instantiates a client
  const functionsClient = new FunctionServiceClient();

  async function callUpdateFunction() {
    // Construct request
    const request = {
      function1,
    };

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

  callUpdateFunction();

updateFunction(request, options, callback)

updateFunction(request: protos.google.cloud.functions.v2alpha.IUpdateFunctionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateFunctionRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateFunction(request, callback)

updateFunction(request: protos.google.cloud.functions.v2alpha.IUpdateFunctionRequest, callback: Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateFunctionRequest
callback Callback<LROperation<protos.google.cloud.functions.v2alpha.IFunction, protos.google.cloud.functions.v2alpha.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

workerPoolPath(project, location, workerPool)

workerPoolPath(project: string, location: string, workerPool: string): string;

Return a fully-qualified workerPool resource name string.

Parameters
NameDescription
project string
location string
workerPool string
Returns
TypeDescription
string

{string} Resource name string.