Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit 7288e2e

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#1354)
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 374f34d commit 7288e2e

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

src/v1/publisher_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const version = require('../../../package.json').version;
5151
export class PublisherClient {
5252
private _terminated = false;
5353
private _opts: ClientOptions;
54+
private _providedCustomServicePath: boolean;
5455
private _gaxModule: typeof gax | typeof gax.fallback;
5556
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5657
private _protos: {};
@@ -62,6 +63,7 @@ export class PublisherClient {
6263
longrunning: {},
6364
batching: {},
6465
};
66+
warn: (code: string, message: string, warnType?: string) => void;
6567
innerApiCalls: {[name: string]: Function};
6668
iamClient: IamClient;
6769
pathTemplates: {[name: string]: gax.PathTemplate};
@@ -106,6 +108,9 @@ export class PublisherClient {
106108
const staticMembers = this.constructor as typeof PublisherClient;
107109
const servicePath =
108110
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
111+
this._providedCustomServicePath = !!(
112+
opts?.servicePath || opts?.apiEndpoint
113+
);
109114
const port = opts?.port || staticMembers.port;
110115
const clientConfig = opts?.clientConfig ?? {};
111116
const fallback =
@@ -225,6 +230,9 @@ export class PublisherClient {
225230
// of calling the API is handled in `google-gax`, with this code
226231
// merely providing the destination and request information.
227232
this.innerApiCalls = {};
233+
234+
// Add a warn function to the client constructor so it can be easily tested.
235+
this.warn = gax.warn;
228236
}
229237

230238
/**
@@ -253,7 +261,8 @@ export class PublisherClient {
253261
)
254262
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
255263
(this._protos as any).google.pubsub.v1.Publisher,
256-
this._opts
264+
this._opts,
265+
this._providedCustomServicePath
257266
) as Promise<{[method: string]: Function}>;
258267

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

src/v1/schema_service_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const version = require('../../../package.json').version;
5050
export class SchemaServiceClient {
5151
private _terminated = false;
5252
private _opts: ClientOptions;
53+
private _providedCustomServicePath: boolean;
5354
private _gaxModule: typeof gax | typeof gax.fallback;
5455
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5556
private _protos: {};
@@ -61,6 +62,7 @@ export class SchemaServiceClient {
6162
longrunning: {},
6263
batching: {},
6364
};
65+
warn: (code: string, message: string, warnType?: string) => void;
6466
innerApiCalls: {[name: string]: Function};
6567
iamClient: IamClient;
6668
pathTemplates: {[name: string]: gax.PathTemplate};
@@ -105,6 +107,9 @@ export class SchemaServiceClient {
105107
const staticMembers = this.constructor as typeof SchemaServiceClient;
106108
const servicePath =
107109
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
110+
this._providedCustomServicePath = !!(
111+
opts?.servicePath || opts?.apiEndpoint
112+
);
108113
const port = opts?.port || staticMembers.port;
109114
const clientConfig = opts?.clientConfig ?? {};
110115
const fallback =
@@ -197,6 +202,9 @@ export class SchemaServiceClient {
197202
// of calling the API is handled in `google-gax`, with this code
198203
// merely providing the destination and request information.
199204
this.innerApiCalls = {};
205+
206+
// Add a warn function to the client constructor so it can be easily tested.
207+
this.warn = gax.warn;
200208
}
201209

202210
/**
@@ -225,7 +233,8 @@ export class SchemaServiceClient {
225233
)
226234
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
227235
(this._protos as any).google.pubsub.v1.SchemaService,
228-
this._opts
236+
this._opts,
237+
this._providedCustomServicePath
229238
) as Promise<{[method: string]: Function}>;
230239

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

src/v1/subscriber_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const version = require('../../../package.json').version;
5252
export class SubscriberClient {
5353
private _terminated = false;
5454
private _opts: ClientOptions;
55+
private _providedCustomServicePath: boolean;
5556
private _gaxModule: typeof gax | typeof gax.fallback;
5657
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5758
private _protos: {};
@@ -63,6 +64,7 @@ export class SubscriberClient {
6364
longrunning: {},
6465
batching: {},
6566
};
67+
warn: (code: string, message: string, warnType?: string) => void;
6668
innerApiCalls: {[name: string]: Function};
6769
iamClient: IamClient;
6870
pathTemplates: {[name: string]: gax.PathTemplate};
@@ -107,6 +109,9 @@ export class SubscriberClient {
107109
const staticMembers = this.constructor as typeof SubscriberClient;
108110
const servicePath =
109111
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
112+
this._providedCustomServicePath = !!(
113+
opts?.servicePath || opts?.apiEndpoint
114+
);
110115
const port = opts?.port || staticMembers.port;
111116
const clientConfig = opts?.clientConfig ?? {};
112117
const fallback =
@@ -212,6 +217,9 @@ export class SubscriberClient {
212217
// of calling the API is handled in `google-gax`, with this code
213218
// merely providing the destination and request information.
214219
this.innerApiCalls = {};
220+
221+
// Add a warn function to the client constructor so it can be easily tested.
222+
this.warn = gax.warn;
215223
}
216224

217225
/**
@@ -240,7 +248,8 @@ export class SubscriberClient {
240248
)
241249
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
242250
(this._protos as any).google.pubsub.v1.Subscriber,
243-
this._opts
251+
this._opts,
252+
this._providedCustomServicePath
244253
) as Promise<{[method: string]: Function}>;
245254

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

0 commit comments

Comments
 (0)