diff --git a/src/v3/agents_client.ts b/src/v3/agents_client.ts index 7fcff1e2..053f07c2 100644 --- a/src/v3/agents_client.ts +++ b/src/v3/agents_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class AgentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class AgentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class AgentsClient { const staticMembers = this.constructor as typeof AgentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -280,6 +285,9 @@ export class AgentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -308,7 +316,8 @@ export class AgentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Agents, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/entity_types_client.ts b/src/v3/entity_types_client.ts index f5ed2070..cfc0d2ee 100644 --- a/src/v3/entity_types_client.ts +++ b/src/v3/entity_types_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class EntityTypesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class EntityTypesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; entityTypesStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class EntityTypesClient { const staticMembers = this.constructor as typeof EntityTypesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class EntityTypesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class EntityTypesClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.EntityTypes, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/environments_client.ts b/src/v3/environments_client.ts index 74688f1f..c1b42f89 100644 --- a/src/v3/environments_client.ts +++ b/src/v3/environments_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class EnvironmentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class EnvironmentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class EnvironmentsClient { const staticMembers = this.constructor as typeof EnvironmentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -301,6 +306,9 @@ export class EnvironmentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -329,7 +337,8 @@ export class EnvironmentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Environments, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/experiments_client.ts b/src/v3/experiments_client.ts index d71ee167..294c9809 100644 --- a/src/v3/experiments_client.ts +++ b/src/v3/experiments_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class ExperimentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class ExperimentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; experimentsStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class ExperimentsClient { const staticMembers = this.constructor as typeof ExperimentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class ExperimentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class ExperimentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Experiments, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/flows_client.ts b/src/v3/flows_client.ts index ff451abe..d5b95824 100644 --- a/src/v3/flows_client.ts +++ b/src/v3/flows_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class FlowsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class FlowsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class FlowsClient { const staticMembers = this.constructor as typeof FlowsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -291,6 +296,9 @@ export class FlowsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -319,7 +327,8 @@ export class FlowsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Flows, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/intents_client.ts b/src/v3/intents_client.ts index d16d5d7b..97995100 100644 --- a/src/v3/intents_client.ts +++ b/src/v3/intents_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class IntentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class IntentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; intentsStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class IntentsClient { const staticMembers = this.constructor as typeof IntentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class IntentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class IntentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Intents, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/pages_client.ts b/src/v3/pages_client.ts index b73534b8..7e7f9a3a 100644 --- a/src/v3/pages_client.ts +++ b/src/v3/pages_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class PagesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class PagesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; pagesStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class PagesClient { const staticMembers = this.constructor as typeof PagesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class PagesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class PagesClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Pages, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/security_settings_service_client.ts b/src/v3/security_settings_service_client.ts index ee3cc4c9..199dfd63 100644 --- a/src/v3/security_settings_service_client.ts +++ b/src/v3/security_settings_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class SecuritySettingsServiceClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class SecuritySettingsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; securitySettingsServiceStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class SecuritySettingsServiceClient { .constructor as typeof SecuritySettingsServiceClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -241,6 +246,9 @@ export class SecuritySettingsServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -270,7 +278,8 @@ export class SecuritySettingsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3 .SecuritySettingsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/session_entity_types_client.ts b/src/v3/session_entity_types_client.ts index 0a64fe6c..022e8264 100644 --- a/src/v3/session_entity_types_client.ts +++ b/src/v3/session_entity_types_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class SessionEntityTypesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class SessionEntityTypesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; sessionEntityTypesStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class SessionEntityTypesClient { const staticMembers = this.constructor as typeof SessionEntityTypesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -243,6 +248,9 @@ export class SessionEntityTypesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -272,7 +280,8 @@ export class SessionEntityTypesClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3 .SessionEntityTypes, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/sessions_client.ts b/src/v3/sessions_client.ts index 151f13a5..7e6d4daf 100644 --- a/src/v3/sessions_client.ts +++ b/src/v3/sessions_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; export class SessionsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -52,6 +53,7 @@ export class SessionsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; sessionsStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class SessionsClient { const staticMembers = this.constructor as typeof SessionsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -231,6 +236,9 @@ export class SessionsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -259,7 +267,8 @@ export class SessionsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Sessions, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/test_cases_client.ts b/src/v3/test_cases_client.ts index 239a4768..4649f2a3 100644 --- a/src/v3/test_cases_client.ts +++ b/src/v3/test_cases_client.ts @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; export class TestCasesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -61,6 +62,7 @@ export class TestCasesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class TestCasesClient { const staticMembers = this.constructor as typeof TestCasesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -308,6 +313,9 @@ export class TestCasesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -336,7 +344,8 @@ export class TestCasesClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.TestCases, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/transition_route_groups_client.ts b/src/v3/transition_route_groups_client.ts index c2acd49c..eb94f77e 100644 --- a/src/v3/transition_route_groups_client.ts +++ b/src/v3/transition_route_groups_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class TransitionRouteGroupsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class TransitionRouteGroupsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; transitionRouteGroupsStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class TransitionRouteGroupsClient { .constructor as typeof TransitionRouteGroupsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -241,6 +246,9 @@ export class TransitionRouteGroupsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -270,7 +278,8 @@ export class TransitionRouteGroupsClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3 .TransitionRouteGroups, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/versions_client.ts b/src/v3/versions_client.ts index a312c2bb..2ae84471 100644 --- a/src/v3/versions_client.ts +++ b/src/v3/versions_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class VersionsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class VersionsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class VersionsClient { const staticMembers = this.constructor as typeof VersionsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -280,6 +285,9 @@ export class VersionsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -308,7 +316,8 @@ export class VersionsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Versions, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3/webhooks_client.ts b/src/v3/webhooks_client.ts index caa9d1b1..602044c6 100644 --- a/src/v3/webhooks_client.ts +++ b/src/v3/webhooks_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class WebhooksClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class WebhooksClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; webhooksStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class WebhooksClient { const staticMembers = this.constructor as typeof WebhooksClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -247,6 +252,9 @@ export class WebhooksClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -275,7 +283,8 @@ export class WebhooksClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3.Webhooks, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/agents_client.ts b/src/v3beta1/agents_client.ts index a5feff20..7016d36e 100644 --- a/src/v3beta1/agents_client.ts +++ b/src/v3beta1/agents_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class AgentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class AgentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class AgentsClient { const staticMembers = this.constructor as typeof AgentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -280,6 +285,9 @@ export class AgentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -308,7 +316,8 @@ export class AgentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Agents, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/entity_types_client.ts b/src/v3beta1/entity_types_client.ts index 22606e80..61159239 100644 --- a/src/v3beta1/entity_types_client.ts +++ b/src/v3beta1/entity_types_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class EntityTypesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class EntityTypesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; entityTypesStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class EntityTypesClient { const staticMembers = this.constructor as typeof EntityTypesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class EntityTypesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class EntityTypesClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.EntityTypes, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/environments_client.ts b/src/v3beta1/environments_client.ts index 31b58013..433f86d1 100644 --- a/src/v3beta1/environments_client.ts +++ b/src/v3beta1/environments_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class EnvironmentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class EnvironmentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class EnvironmentsClient { const staticMembers = this.constructor as typeof EnvironmentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -301,6 +306,9 @@ export class EnvironmentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -329,7 +337,8 @@ export class EnvironmentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Environments, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/experiments_client.ts b/src/v3beta1/experiments_client.ts index 56cc23bc..528c8cf1 100644 --- a/src/v3beta1/experiments_client.ts +++ b/src/v3beta1/experiments_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class ExperimentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class ExperimentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; experimentsStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class ExperimentsClient { const staticMembers = this.constructor as typeof ExperimentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class ExperimentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class ExperimentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Experiments, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/flows_client.ts b/src/v3beta1/flows_client.ts index 1459c562..16679938 100644 --- a/src/v3beta1/flows_client.ts +++ b/src/v3beta1/flows_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class FlowsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class FlowsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class FlowsClient { const staticMembers = this.constructor as typeof FlowsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -291,6 +296,9 @@ export class FlowsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -319,7 +327,8 @@ export class FlowsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Flows, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/intents_client.ts b/src/v3beta1/intents_client.ts index 344e3638..6a0629ff 100644 --- a/src/v3beta1/intents_client.ts +++ b/src/v3beta1/intents_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class IntentsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class IntentsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; intentsStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class IntentsClient { const staticMembers = this.constructor as typeof IntentsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class IntentsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class IntentsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Intents, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/pages_client.ts b/src/v3beta1/pages_client.ts index ea12e666..dfc3fe8b 100644 --- a/src/v3beta1/pages_client.ts +++ b/src/v3beta1/pages_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class PagesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class PagesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; pagesStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class PagesClient { const staticMembers = this.constructor as typeof PagesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -240,6 +245,9 @@ export class PagesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -268,7 +276,8 @@ export class PagesClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Pages, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/security_settings_service_client.ts b/src/v3beta1/security_settings_service_client.ts index b5676fac..525cf120 100644 --- a/src/v3beta1/security_settings_service_client.ts +++ b/src/v3beta1/security_settings_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class SecuritySettingsServiceClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class SecuritySettingsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; securitySettingsServiceStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class SecuritySettingsServiceClient { .constructor as typeof SecuritySettingsServiceClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -241,6 +246,9 @@ export class SecuritySettingsServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -270,7 +278,8 @@ export class SecuritySettingsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1 .SecuritySettingsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/session_entity_types_client.ts b/src/v3beta1/session_entity_types_client.ts index 95d3339a..a38bd597 100644 --- a/src/v3beta1/session_entity_types_client.ts +++ b/src/v3beta1/session_entity_types_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class SessionEntityTypesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class SessionEntityTypesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; sessionEntityTypesStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class SessionEntityTypesClient { const staticMembers = this.constructor as typeof SessionEntityTypesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -243,6 +248,9 @@ export class SessionEntityTypesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -272,7 +280,8 @@ export class SessionEntityTypesClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1 .SessionEntityTypes, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/sessions_client.ts b/src/v3beta1/sessions_client.ts index 2ab360be..2206c80e 100644 --- a/src/v3beta1/sessions_client.ts +++ b/src/v3beta1/sessions_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; export class SessionsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -52,6 +53,7 @@ export class SessionsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; sessionsStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class SessionsClient { const staticMembers = this.constructor as typeof SessionsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -231,6 +236,9 @@ export class SessionsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -259,7 +267,8 @@ export class SessionsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Sessions, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/test_cases_client.ts b/src/v3beta1/test_cases_client.ts index fdd729fd..9b467f88 100644 --- a/src/v3beta1/test_cases_client.ts +++ b/src/v3beta1/test_cases_client.ts @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; export class TestCasesClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -61,6 +62,7 @@ export class TestCasesClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class TestCasesClient { const staticMembers = this.constructor as typeof TestCasesClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -308,6 +313,9 @@ export class TestCasesClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -336,7 +344,8 @@ export class TestCasesClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.TestCases, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/transition_route_groups_client.ts b/src/v3beta1/transition_route_groups_client.ts index 54022214..ba3edbf5 100644 --- a/src/v3beta1/transition_route_groups_client.ts +++ b/src/v3beta1/transition_route_groups_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class TransitionRouteGroupsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class TransitionRouteGroupsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; transitionRouteGroupsStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class TransitionRouteGroupsClient { .constructor as typeof TransitionRouteGroupsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -241,6 +246,9 @@ export class TransitionRouteGroupsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -270,7 +278,8 @@ export class TransitionRouteGroupsClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1 .TransitionRouteGroups, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/versions_client.ts b/src/v3beta1/versions_client.ts index a1592196..05002f5c 100644 --- a/src/v3beta1/versions_client.ts +++ b/src/v3beta1/versions_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class VersionsClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class VersionsClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -104,6 +106,9 @@ export class VersionsClient { const staticMembers = this.constructor as typeof VersionsClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -280,6 +285,9 @@ export class VersionsClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -308,7 +316,8 @@ export class VersionsClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Versions, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v3beta1/webhooks_client.ts b/src/v3beta1/webhooks_client.ts index e9840e00..d363f188 100644 --- a/src/v3beta1/webhooks_client.ts +++ b/src/v3beta1/webhooks_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class WebhooksClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -59,6 +60,7 @@ export class WebhooksClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; webhooksStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class WebhooksClient { const staticMembers = this.constructor as typeof WebhooksClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -247,6 +252,9 @@ export class WebhooksClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -275,7 +283,8 @@ export class WebhooksClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.dialogflow.cx.v3beta1.Webhooks, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides