Skip to content

Commit 7818c58

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#266)
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: googleapis/googleapis-gen@d3509d2
1 parent 838166c commit 7818c58

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

packages/google-cloud-webrisk/src/v1/web_risk_service_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const version = require('../../../package.json').version;
4040
export class WebRiskServiceClient {
4141
private _terminated = false;
4242
private _opts: ClientOptions;
43+
private _providedCustomServicePath: boolean;
4344
private _gaxModule: typeof gax | typeof gax.fallback;
4445
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
4546
private _protos: {};
@@ -51,6 +52,7 @@ export class WebRiskServiceClient {
5152
longrunning: {},
5253
batching: {},
5354
};
55+
warn: (code: string, message: string, warnType?: string) => void;
5456
innerApiCalls: {[name: string]: Function};
5557
pathTemplates: {[name: string]: gax.PathTemplate};
5658
webRiskServiceStub?: Promise<{[name: string]: Function}>;
@@ -94,6 +96,9 @@ export class WebRiskServiceClient {
9496
const staticMembers = this.constructor as typeof WebRiskServiceClient;
9597
const servicePath =
9698
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
99+
this._providedCustomServicePath = !!(
100+
opts?.servicePath || opts?.apiEndpoint
101+
);
97102
const port = opts?.port || staticMembers.port;
98103
const clientConfig = opts?.clientConfig ?? {};
99104
const fallback =
@@ -162,6 +167,9 @@ export class WebRiskServiceClient {
162167
// of calling the API is handled in `google-gax`, with this code
163168
// merely providing the destination and request information.
164169
this.innerApiCalls = {};
170+
171+
// Add a warn function to the client constructor so it can be easily tested.
172+
this.warn = gax.warn;
165173
}
166174

167175
/**
@@ -190,7 +198,8 @@ export class WebRiskServiceClient {
190198
)
191199
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
192200
(this._protos as any).google.cloud.webrisk.v1.WebRiskService,
193-
this._opts
201+
this._opts,
202+
this._providedCustomServicePath
194203
) as Promise<{[method: string]: Function}>;
195204

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

packages/google-cloud-webrisk/src/v1beta1/web_risk_service_v1_beta1_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const version = require('../../../package.json').version;
4040
export class WebRiskServiceV1Beta1Client {
4141
private _terminated = false;
4242
private _opts: ClientOptions;
43+
private _providedCustomServicePath: boolean;
4344
private _gaxModule: typeof gax | typeof gax.fallback;
4445
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
4546
private _protos: {};
@@ -51,6 +52,7 @@ export class WebRiskServiceV1Beta1Client {
5152
longrunning: {},
5253
batching: {},
5354
};
55+
warn: (code: string, message: string, warnType?: string) => void;
5456
innerApiCalls: {[name: string]: Function};
5557
webRiskServiceV1Beta1Stub?: Promise<{[name: string]: Function}>;
5658

@@ -94,6 +96,9 @@ export class WebRiskServiceV1Beta1Client {
9496
.constructor as typeof WebRiskServiceV1Beta1Client;
9597
const servicePath =
9698
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
99+
this._providedCustomServicePath = !!(
100+
opts?.servicePath || opts?.apiEndpoint
101+
);
97102
const port = opts?.port || staticMembers.port;
98103
const clientConfig = opts?.clientConfig ?? {};
99104
const fallback =
@@ -153,6 +158,9 @@ export class WebRiskServiceV1Beta1Client {
153158
// of calling the API is handled in `google-gax`, with this code
154159
// merely providing the destination and request information.
155160
this.innerApiCalls = {};
161+
162+
// Add a warn function to the client constructor so it can be easily tested.
163+
this.warn = gax.warn;
156164
}
157165

158166
/**
@@ -182,7 +190,8 @@ export class WebRiskServiceV1Beta1Client {
182190
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
183191
(this._protos as any).google.cloud.webrisk.v1beta1
184192
.WebRiskServiceV1Beta1,
185-
this._opts
193+
this._opts,
194+
this._providedCustomServicePath
186195
) as Promise<{[method: string]: Function}>;
187196

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

0 commit comments

Comments
 (0)