UNPKG

googleapis-nodejs-functions

Version:

Google Cloud Functions Client Library for Node.js (unofficial)

74 lines (73 loc) 2.47 kB
import { ServiceObject } from '@google-cloud/common'; import { GCF, CloudFunctionMetadata } from '.'; /** * Create a Function object to interact with a Cloud Functions. * * @param {GCF} gcf {@link GCF} instance. * @param {string} name The name of the function. * @param {object} [options] Configuration object. * @param {string} [options.userProject] User project. */ export declare class CloudFunction extends ServiceObject { /** * The function's name. * @name CloudFunction#name * @type {string} */ name: string; metadata: CloudFunctionMetadata; /** * A reference to the {@link GCF} associated with this {@link CloudFunction} * instance. * @name CloudFunction#gcf * @type {GCF} */ gcf: GCF; /** * A user project to apply to each request from this function. * @name CloudFunction#userProject * @type {string} */ userProject: string; constructor(gcf: any, name: any, metadata?: any, options?: any); /** * Delete the function. * * @param {object} [options] Configuration options. * @param {string} [options.userProject] The ID of the project which will be * billed for the request. * @param {FunctionCallback} [callback] Callback function. * @returns {Promise<Operation>} */ delete(options?: any, callback?: any): void; /** * Check if the function exists. * * @param {object} [options] Configuration options. * @param {string} [options.userProject] The ID of the project which will be * billed for the request. * @param {FunctionCallback} [callback] Callback function. * @returns {Promise<boolean>} * */ exists(options?: any, callback?: any): void; /** * Get a Function if it exists. * * @param {object} [options] Configuration options. * @param {string} [options.userProject] The ID of the project which will be * billed for the request. * @param {CloudFunctionCallback} [callback] Callback function. * @returns {Promise<CloudFunction>} * */ get(options: any, callback?: any): void; /** * Get the functions's metadata. * * @param {object} [options] Configuration options. * @param {FunctionCallback} [callback] Callback function. * @returns {Promise<CloudFunctionMetadata>} */ getMetadata(options: any, callback?: any): void | Promise<CloudFunctionMetadata>; }