@@ -62,6 +62,7 @@ const version = require('../../../package.json').version;
6262export class ReservationServiceClient {
6363 private _terminated = false ;
6464 private _opts : ClientOptions ;
65+ private _providedCustomServicePath : boolean ;
6566 private _gaxModule : typeof gax | typeof gax . fallback ;
6667 private _gaxGrpc : gax . GrpcClient | gax . fallback . GrpcClient ;
6768 private _protos : { } ;
@@ -73,6 +74,7 @@ export class ReservationServiceClient {
7374 longrunning : { } ,
7475 batching : { } ,
7576 } ;
77+ warn : ( code : string , message : string , warnType ?: string ) => void ;
7678 innerApiCalls : { [ name : string ] : Function } ;
7779 pathTemplates : { [ name : string ] : gax . PathTemplate } ;
7880 reservationServiceStub ?: Promise < { [ name : string ] : Function } > ;
@@ -116,6 +118,9 @@ export class ReservationServiceClient {
116118 const staticMembers = this . constructor as typeof ReservationServiceClient ;
117119 const servicePath =
118120 opts ?. servicePath || opts ?. apiEndpoint || staticMembers . servicePath ;
121+ this . _providedCustomServicePath = ! ! (
122+ opts ?. servicePath || opts ?. apiEndpoint
123+ ) ;
119124 const port = opts ?. port || staticMembers . port ;
120125 const clientConfig = opts ?. clientConfig ?? { } ;
121126 const fallback =
@@ -225,6 +230,9 @@ export class ReservationServiceClient {
225230 // of calling the API is handled in `google-gax`, with this code
226231 // merely providing the destination and request information.
227232 this . innerApiCalls = { } ;
233+
234+ // Add a warn function to the client constructor so it can be easily tested.
235+ this . warn = gax . warn ;
228236 }
229237
230238 /**
@@ -254,7 +262,8 @@ export class ReservationServiceClient {
254262 : // eslint-disable-next-line @typescript-eslint/no-explicit-any
255263 ( this . _protos as any ) . google . cloud . bigquery . reservation . v1
256264 . ReservationService ,
257- this . _opts
265+ this . _opts ,
266+ this . _providedCustomServicePath
258267 ) as Promise < { [ method : string ] : Function } > ;
259268
260269 // Iterate over each of the methods that the service provides
0 commit comments