@@ -48,6 +48,7 @@ const version = require('../../../package.json').version;
48
48
export class RecaptchaEnterpriseServiceV1Beta1Client {
49
49
private _terminated = false ;
50
50
private _opts : ClientOptions ;
51
+ private _providedCustomServicePath : boolean ;
51
52
private _gaxModule : typeof gax | typeof gax . fallback ;
52
53
private _gaxGrpc : gax . GrpcClient | gax . fallback . GrpcClient ;
53
54
private _protos : { } ;
@@ -59,6 +60,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
59
60
longrunning : { } ,
60
61
batching : { } ,
61
62
} ;
63
+ warn : ( code : string , message : string , warnType ?: string ) => void ;
62
64
innerApiCalls : { [ name : string ] : Function } ;
63
65
pathTemplates : { [ name : string ] : gax . PathTemplate } ;
64
66
recaptchaEnterpriseServiceV1Beta1Stub ?: Promise < { [ name : string ] : Function } > ;
@@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
103
105
. constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client ;
104
106
const servicePath =
105
107
opts ?. servicePath || opts ?. apiEndpoint || staticMembers . servicePath ;
108
+ this . _providedCustomServicePath = ! ! (
109
+ opts ?. servicePath || opts ?. apiEndpoint
110
+ ) ;
106
111
const port = opts ?. port || staticMembers . port ;
107
112
const clientConfig = opts ?. clientConfig ?? { } ;
108
113
const fallback =
@@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
188
193
// of calling the API is handled in `google-gax`, with this code
189
194
// merely providing the destination and request information.
190
195
this . innerApiCalls = { } ;
196
+
197
+ // Add a warn function to the client constructor so it can be easily tested.
198
+ this . warn = gax . warn ;
191
199
}
192
200
193
201
/**
@@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
217
225
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
226
( this . _protos as any ) . google . cloud . recaptchaenterprise . v1beta1
219
227
. RecaptchaEnterpriseServiceV1Beta1 ,
220
- this . _opts
228
+ this . _opts ,
229
+ this . _providedCustomServicePath
221
230
) as Promise < { [ method : string ] : Function } > ;
222
231
223
232
// Iterate over each of the methods that the service provides
0 commit comments