@@ -53,6 +53,7 @@ const version = require('../../../package.json').version;
53
53
export class TranscoderServiceClient {
54
54
private _terminated = false ;
55
55
private _opts : ClientOptions ;
56
+ private _providedCustomServicePath : boolean ;
56
57
private _gaxModule : typeof gax | typeof gax . fallback ;
57
58
private _gaxGrpc : gax . GrpcClient | gax . fallback . GrpcClient ;
58
59
private _protos : { } ;
@@ -64,6 +65,7 @@ export class TranscoderServiceClient {
64
65
longrunning : { } ,
65
66
batching : { } ,
66
67
} ;
68
+ warn : ( code : string , message : string , warnType ?: string ) => void ;
67
69
innerApiCalls : { [ name : string ] : Function } ;
68
70
pathTemplates : { [ name : string ] : gax . PathTemplate } ;
69
71
transcoderServiceStub ?: Promise < { [ name : string ] : Function } > ;
@@ -107,6 +109,9 @@ export class TranscoderServiceClient {
107
109
const staticMembers = this . constructor as typeof TranscoderServiceClient ;
108
110
const servicePath =
109
111
opts ?. servicePath || opts ?. apiEndpoint || staticMembers . servicePath ;
112
+ this . _providedCustomServicePath = ! ! (
113
+ opts ?. servicePath || opts ?. apiEndpoint
114
+ ) ;
110
115
const port = opts ?. port || staticMembers . port ;
111
116
const clientConfig = opts ?. clientConfig ?? { } ;
112
117
const fallback =
@@ -197,6 +202,9 @@ export class TranscoderServiceClient {
197
202
// of calling the API is handled in `google-gax`, with this code
198
203
// merely providing the destination and request information.
199
204
this . innerApiCalls = { } ;
205
+
206
+ // Add a warn function to the client constructor so it can be easily tested.
207
+ this . warn = gax . warn ;
200
208
}
201
209
202
210
/**
@@ -226,7 +234,8 @@ export class TranscoderServiceClient {
226
234
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
227
235
( this . _protos as any ) . google . cloud . video . transcoder . v1beta1
228
236
. TranscoderService ,
229
- this . _opts
237
+ this . _opts ,
238
+ this . _providedCustomServicePath
230
239
) as Promise < { [ method : string ] : Function } > ;
231
240
232
241
// Iterate over each of the methods that the service provides
0 commit comments