@@ -42,6 +42,7 @@ const version = require('../../../package.json').version;
42
42
export class OsLoginServiceClient {
43
43
private _terminated = false ;
44
44
private _opts : ClientOptions ;
45
+ private _providedCustomServicePath : boolean ;
45
46
private _gaxModule : typeof gax | typeof gax . fallback ;
46
47
private _gaxGrpc : gax . GrpcClient | gax . fallback . GrpcClient ;
47
48
private _protos : { } ;
@@ -53,6 +54,7 @@ export class OsLoginServiceClient {
53
54
longrunning : { } ,
54
55
batching : { } ,
55
56
} ;
57
+ warn : ( code : string , message : string , warnType ?: string ) => void ;
56
58
innerApiCalls : { [ name : string ] : Function } ;
57
59
pathTemplates : { [ name : string ] : gax . PathTemplate } ;
58
60
osLoginServiceStub ?: Promise < { [ name : string ] : Function } > ;
@@ -96,6 +98,9 @@ export class OsLoginServiceClient {
96
98
const staticMembers = this . constructor as typeof OsLoginServiceClient ;
97
99
const servicePath =
98
100
opts ?. servicePath || opts ?. apiEndpoint || staticMembers . servicePath ;
101
+ this . _providedCustomServicePath = ! ! (
102
+ opts ?. servicePath || opts ?. apiEndpoint
103
+ ) ;
99
104
const port = opts ?. port || staticMembers . port ;
100
105
const clientConfig = opts ?. clientConfig ?? { } ;
101
106
const fallback =
@@ -168,6 +173,9 @@ export class OsLoginServiceClient {
168
173
// of calling the API is handled in `google-gax`, with this code
169
174
// merely providing the destination and request information.
170
175
this . innerApiCalls = { } ;
176
+
177
+ // Add a warn function to the client constructor so it can be easily tested.
178
+ this . warn = gax . warn ;
171
179
}
172
180
173
181
/**
@@ -196,7 +204,8 @@ export class OsLoginServiceClient {
196
204
)
197
205
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
198
206
( this . _protos as any ) . google . cloud . oslogin . v1beta . OsLoginService ,
199
- this . _opts
207
+ this . _opts ,
208
+ this . _providedCustomServicePath
200
209
) as Promise < { [ method : string ] : Function } > ;
201
210
202
211
// Iterate over each of the methods that the service provides
0 commit comments