diff --git a/src/v1/publisher_client.ts b/src/v1/publisher_client.ts index 6dcab350b..3b127acfb 100644 --- a/src/v1/publisher_client.ts +++ b/src/v1/publisher_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { IamClient, IamProtos, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './publisher_client_config.json'; - const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class PublisherClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: 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 PublisherClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof PublisherClient; const servicePath = @@ -121,8 +129,13 @@ export class PublisherClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -143,7 +156,7 @@ export class PublisherClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } - this.iamClient = new IamClient(this._gaxGrpc, opts); + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -214,7 +227,7 @@ export class PublisherClient { 'messages', ['topic'], 'message_ids', - gax.createByteLengthFunction( + this._gaxModule.GrpcClient.createByteLengthFunction( // eslint-disable-next-line @typescript-eslint/no-explicit-any protoFilesRoot.lookupType('google.pubsub.v1.PubsubMessage') as any ) @@ -235,7 +248,7 @@ export class PublisherClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -476,7 +489,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -564,7 +577,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'topic.name': request.topic!.name || '', }); this.initialize(); @@ -649,7 +662,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); this.initialize(); @@ -731,7 +744,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); this.initialize(); @@ -817,7 +830,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); this.initialize(); @@ -902,7 +915,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -996,7 +1009,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); this.initialize(); @@ -1037,7 +1050,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = this._defaults['listTopics']; @@ -1085,7 +1098,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = this._defaults['listTopics']; @@ -1192,7 +1205,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); this.initialize(); @@ -1237,7 +1250,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); const defaultCallSettings = this._defaults['listTopicSubscriptions']; @@ -1285,7 +1298,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); const defaultCallSettings = this._defaults['listTopicSubscriptions']; @@ -1390,7 +1403,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); this.initialize(); @@ -1431,7 +1444,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); const defaultCallSettings = this._defaults['listTopicSnapshots']; @@ -1479,7 +1492,7 @@ export class PublisherClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ topic: request.topic || '', }); const defaultCallSettings = this._defaults['listTopicSnapshots']; diff --git a/src/v1/schema_service_client.ts b/src/v1/schema_service_client.ts index c8170bd63..b832a5889 100644 --- a/src/v1/schema_service_client.ts +++ b/src/v1/schema_service_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { IamClient, IamProtos, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './schema_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class SchemaServiceClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: 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 SchemaServiceClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SchemaServiceClient; const servicePath = @@ -120,8 +128,13 @@ export class SchemaServiceClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -142,7 +155,7 @@ export class SchemaServiceClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } - this.iamClient = new IamClient(this._gaxGrpc, opts); + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -208,7 +221,7 @@ export class SchemaServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -424,7 +437,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -510,7 +523,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -592,7 +605,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -676,7 +689,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -768,7 +781,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -866,7 +879,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -911,7 +924,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSchemas']; @@ -963,7 +976,7 @@ export class SchemaServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSchemas']; diff --git a/src/v1/subscriber_client.ts b/src/v1/subscriber_client.ts index aa7b24780..14e3fd07d 100644 --- a/src/v1/subscriber_client.ts +++ b/src/v1/subscriber_client.ts @@ -17,21 +17,18 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, - GoogleError, IamClient, IamProtos, } from 'google-gax'; - -import {Transform} from 'stream'; -import {PassThrough} from 'stream'; +import {Transform, PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -40,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './subscriber_client_config.json'; - const version = require('../../../package.json').version; /** @@ -103,8 +99,18 @@ export class SubscriberClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: 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 SubscriberClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SubscriberClient; const servicePath = @@ -124,8 +130,13 @@ export class SubscriberClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -146,7 +157,7 @@ export class SubscriberClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } - this.iamClient = new IamClient(this._gaxGrpc, opts); + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -207,7 +218,7 @@ export class SubscriberClient { // Provide descriptors for these. this.descriptors.stream = { streamingPull: new this._gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING, + this._gaxModule.StreamType.BIDI_STREAMING, opts.fallback === 'rest' ), }; @@ -226,7 +237,7 @@ export class SubscriberClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -289,7 +300,9 @@ export class SubscriberClient { setImmediate(() => { stream.emit( 'error', - new GoogleError('The client has already been closed.') + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) ); }); return stream; @@ -582,7 +595,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -664,7 +677,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -749,7 +762,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'subscription.name': request.subscription!.name || '', }); this.initialize(); @@ -835,7 +848,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -932,7 +945,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -1024,7 +1037,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -1120,7 +1133,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -1214,7 +1227,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -1300,7 +1313,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ snapshot: request.snapshot || '', }); this.initialize(); @@ -1414,7 +1427,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1503,7 +1516,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'snapshot.name': request.snapshot!.name || '', }); this.initialize(); @@ -1593,7 +1606,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ snapshot: request.snapshot || '', }); this.initialize(); @@ -1696,7 +1709,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ subscription: request.subscription || '', }); this.initialize(); @@ -1814,7 +1827,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); this.initialize(); @@ -1855,7 +1868,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = this._defaults['listSubscriptions']; @@ -1903,7 +1916,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = this._defaults['listSubscriptions']; @@ -2006,7 +2019,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); this.initialize(); @@ -2047,7 +2060,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = this._defaults['listSnapshots']; @@ -2095,7 +2108,7 @@ export class SubscriberClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = this._defaults['listSnapshots'];