build/src/index.js
/**
     * Build a request schema that can be used to create or patch the function
     * @private
     * @param parent Path to the cloud function resource container
     * @param sourceUploadUrl Url where the blob was pushed
     */
Build a request schema that can be used to create or patch the function
@private
@param parent Path to the cloud function resource container
@param sourceUploadUrl Url where the blob was pushed
Build a request schema that can be used to create or patch the function @private @param parent Path to the cloud function resource container @param sourceUploadUrl Url where the blob was pushed
_buildRequest(parent, sourceUploadUrl) {
        const requestBody = {
            name: `${parent}/functions/${this._options.name}`,
            description: this._options.description,
            sourceUploadUrl,
            entryPoint: this._options.entryPoint,
            network: this._options.network,
            runtime: this._options.runtime || 'nodejs14',
            timeout: this._options.timeout,
            availableMemoryMb: this._options.memory,
            maxInstances: this._options.maxInstances,
            vpcConnector: this._options.vpcConnector,
            environmentVariables: this._options.environmentVariables,
        };
        if (this._options.triggerTopic) {
            requestBody.eventTrigger = {
                eventType: this._options.triggerEvent ||
                    'providers/cloud.pubsub/eventTypes/topic.publish',
                resource: this._options.triggerTopic,
            };
        }
        else if (this._options.triggerBucket) {
            requestBody.eventTrigger = {
                eventType: this._options.triggerEvent ||
                    'providers/cloud.storage/eventTypes/object.change',
                resource: this._options.triggerBucket,
            };
        }
        else {
            requestBody.httpsTrigger = {};
        }
        return requestBody;
    }
_buildRequest ( parent , sourceUploadUrl ) { const requestBody = { name : ` ${ parent } ${ this . _options . name } ` , description : this . _options . description , sourceUploadUrl , entryPoint : this . _options . entryPoint , network : this . _options . network , runtime : this . _options . runtime || 'nodejs14' , timeout : this . _options . timeout , availableMemoryMb : this . _options . memory , maxInstances : this . _options . maxInstances , vpcConnector : this . _options . vpcConnector , environmentVariables : this . _options . environmentVariables , } ; if ( this . _options . triggerTopic ) { requestBody . eventTrigger = { eventType : this . _options . triggerEvent || 'providers/cloud.pubsub/eventTypes/topic.publish' , resource : this . _options . triggerTopic , } ; } else if ( this . _options . triggerBucket ) { requestBody . eventTrigger = { eventType : this . _options . triggerEvent || 'providers/cloud.storage/eventTypes/object.change' , resource : this . _options . triggerBucket , } ; } else { requestBody . httpsTrigger = { } ; } return requestBody ; }
Build a request schema that can be used to create or patch the function
 @private
 @param parent Path to the cloud function resource container
 @param sourceUploadUrl Url where the blob was pushed
Build a request schema that can be used to create or patch the function @private @param parent Path to the cloud function resource container @param sourceUploadUrl Url where the blob was pushed