diff --git a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index a2d3bc8..226eea2 100644 --- a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -54,6 +54,7 @@ const version = require('../../../package.json').version; export class BinauthzManagementServiceV1Beta1Client { 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: {}; @@ -65,6 +66,7 @@ export class BinauthzManagementServiceV1Beta1Client { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; binauthzManagementServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; @@ -109,6 +111,9 @@ export class BinauthzManagementServiceV1Beta1Client { .constructor as typeof BinauthzManagementServiceV1Beta1Client; 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 = @@ -194,6 +199,9 @@ export class BinauthzManagementServiceV1Beta1Client { // 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; } /** @@ -223,7 +231,8 @@ export class BinauthzManagementServiceV1Beta1Client { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.binaryauthorization.v1beta1 .BinauthzManagementServiceV1Beta1, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides