dis+/node_modules/@google-cloud/pubsub/build/src/v1/subscriber_client.js
/**
     * 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 {Promise} A promise that resolves to an authenticated service stub.
     */
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 {Promise} A promise that resolves to an authenticated service stub.
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 { Promise } A promise that resolves to an authenticated service stub .
initialize() {
        if (this.subscriberStub) {
            return this.subscriberStub;
        }
        this.subscriberStub = this._gaxGrpc.createStub(this._opts.fallback
            ? this._protos.lookupService('google.pubsub.v1.Subscriber')
            : 
                this._protos.google.pubsub.v1.Subscriber, this._opts);
        const subscriberStubMethods = [
            'createSubscription',
            'getSubscription',
            'updateSubscription',
            'listSubscriptions',
            'deleteSubscription',
            'modifyAckDeadline',
            'acknowledge',
            'pull',
            'streamingPull',
            'modifyPushConfig',
            'getSnapshot',
            'listSnapshots',
            'createSnapshot',
            'updateSnapshot',
            'deleteSnapshot',
            'seek',
        ];
        for (const methodName of subscriberStubMethods) {
            const callPromise = this.subscriberStub.then(stub => (...args) => {
                if (this._terminated) {
                    return Promise.reject('The client has already been closed.');
                }
                const func = stub[methodName];
                return func.apply(stub, args);
            }, (err) => () => {
                throw err;
            });
            const descriptor = this.descriptors.page[methodName] ||
                this.descriptors.stream[methodName] ||
                undefined;
            const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
            this.innerApiCalls[methodName] = apiCall;
        }
        return this.subscriberStub;
    }
initialize ( ) { if ( this . subscriberStub ) { return this . subscriberStub ; } this . subscriberStub = this . _gaxGrpc . createStub ( this . _opts . fallback ? this . _protos . lookupService ( 'google.pubsub.v1.Subscriber' ) : this . _protos . google . pubsub . v1 . Subscriber , this . _opts ) ; const subscriberStubMethods = [ 'createSubscription' , 'getSubscription' , 'updateSubscription' , 'listSubscriptions' , 'deleteSubscription' , 'modifyAckDeadline' , 'acknowledge' , 'pull' , 'streamingPull' , 'modifyPushConfig' , 'getSnapshot' , 'listSnapshots' , 'createSnapshot' , 'updateSnapshot' , 'deleteSnapshot' , 'seek' , ] ; for ( const methodName of subscriberStubMethods ) { const callPromise = this . subscriberStub . then ( stub => ( ... args ) => { if ( this . _terminated ) { return Promise . reject ( 'The client has already been closed.' ) ; } const func = stub [ methodName ] ; return func . apply ( stub , args ) ; } , ( err ) => ( ) => { throw err ; } ) ; const descriptor = this . descriptors . page [ methodName ] || this . descriptors . stream [ methodName ] || undefined ; const apiCall = this . _gaxModule . createApiCall ( callPromise , this . _defaults [ methodName ] , descriptor ) ; this . innerApiCalls [ methodName ] = apiCall ; } return this . subscriberStub ; }
Initialize the client.
Initialize the client .
// If the client stub promise is already initialized, return immediately. // Put together the "service stub" for // google.pubsub.v1.Subscriber. // eslint-disable-next-line @typescript-eslint/no-explicit-any // Iterate over each of the methods that the service provides // and create an API call method for each.