Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 6787e23

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#299)
Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: googleapis/googleapis@80f4042 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1
1 parent fb7954d commit 6787e23

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/v1/recaptcha_enterprise_service_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const version = require('../../../package.json').version;
4848
export class RecaptchaEnterpriseServiceClient {
4949
private _terminated = false;
5050
private _opts: ClientOptions;
51+
private _providedCustomServicePath: boolean;
5152
private _gaxModule: typeof gax | typeof gax.fallback;
5253
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5354
private _protos: {};
@@ -59,6 +60,7 @@ export class RecaptchaEnterpriseServiceClient {
5960
longrunning: {},
6061
batching: {},
6162
};
63+
warn: (code: string, message: string, warnType?: string) => void;
6264
innerApiCalls: {[name: string]: Function};
6365
pathTemplates: {[name: string]: gax.PathTemplate};
6466
recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>;
@@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceClient {
103105
.constructor as typeof RecaptchaEnterpriseServiceClient;
104106
const servicePath =
105107
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
108+
this._providedCustomServicePath = !!(
109+
opts?.servicePath || opts?.apiEndpoint
110+
);
106111
const port = opts?.port || staticMembers.port;
107112
const clientConfig = opts?.clientConfig ?? {};
108113
const fallback =
@@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceClient {
188193
// of calling the API is handled in `google-gax`, with this code
189194
// merely providing the destination and request information.
190195
this.innerApiCalls = {};
196+
197+
// Add a warn function to the client constructor so it can be easily tested.
198+
this.warn = gax.warn;
191199
}
192200

193201
/**
@@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceClient {
217225
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
218226
(this._protos as any).google.cloud.recaptchaenterprise.v1
219227
.RecaptchaEnterpriseService,
220-
this._opts
228+
this._opts,
229+
this._providedCustomServicePath
221230
) as Promise<{[method: string]: Function}>;
222231

223232
// Iterate over each of the methods that the service provides

src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const version = require('../../../package.json').version;
4848
export class RecaptchaEnterpriseServiceV1Beta1Client {
4949
private _terminated = false;
5050
private _opts: ClientOptions;
51+
private _providedCustomServicePath: boolean;
5152
private _gaxModule: typeof gax | typeof gax.fallback;
5253
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5354
private _protos: {};
@@ -59,6 +60,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
5960
longrunning: {},
6061
batching: {},
6162
};
63+
warn: (code: string, message: string, warnType?: string) => void;
6264
innerApiCalls: {[name: string]: Function};
6365
pathTemplates: {[name: string]: gax.PathTemplate};
6466
recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>;
@@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
103105
.constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client;
104106
const servicePath =
105107
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
108+
this._providedCustomServicePath = !!(
109+
opts?.servicePath || opts?.apiEndpoint
110+
);
106111
const port = opts?.port || staticMembers.port;
107112
const clientConfig = opts?.clientConfig ?? {};
108113
const fallback =
@@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
188193
// of calling the API is handled in `google-gax`, with this code
189194
// merely providing the destination and request information.
190195
this.innerApiCalls = {};
196+
197+
// Add a warn function to the client constructor so it can be easily tested.
198+
this.warn = gax.warn;
191199
}
192200

193201
/**
@@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
217225
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
218226
(this._protos as any).google.cloud.recaptchaenterprise.v1beta1
219227
.RecaptchaEnterpriseServiceV1Beta1,
220-
this._opts
228+
this._opts,
229+
this._providedCustomServicePath
221230
) as Promise<{[method: string]: Function}>;
222231

223232
// Iterate over each of the methods that the service provides

0 commit comments

Comments
 (0)