Skip to content

Commit b705624

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#500)
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 88d34c3 commit b705624

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

packages/google-cloud-redis/src/v1/cloud_redis_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const version = require('../../../package.json').version;
6363
export class CloudRedisClient {
6464
private _terminated = false;
6565
private _opts: ClientOptions;
66+
private _providedCustomServicePath: boolean;
6667
private _gaxModule: typeof gax | typeof gax.fallback;
6768
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6869
private _protos: {};
@@ -74,6 +75,7 @@ export class CloudRedisClient {
7475
longrunning: {},
7576
batching: {},
7677
};
78+
warn: (code: string, message: string, warnType?: string) => void;
7779
innerApiCalls: {[name: string]: Function};
7880
pathTemplates: {[name: string]: gax.PathTemplate};
7981
operationsClient: gax.OperationsClient;
@@ -118,6 +120,9 @@ export class CloudRedisClient {
118120
const staticMembers = this.constructor as typeof CloudRedisClient;
119121
const servicePath =
120122
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
123+
this._providedCustomServicePath = !!(
124+
opts?.servicePath || opts?.apiEndpoint
125+
);
121126
const port = opts?.port || staticMembers.port;
122127
const clientConfig = opts?.clientConfig ?? {};
123128
const fallback =
@@ -293,6 +298,9 @@ export class CloudRedisClient {
293298
// of calling the API is handled in `google-gax`, with this code
294299
// merely providing the destination and request information.
295300
this.innerApiCalls = {};
301+
302+
// Add a warn function to the client constructor so it can be easily tested.
303+
this.warn = gax.warn;
296304
}
297305

298306
/**
@@ -321,7 +329,8 @@ export class CloudRedisClient {
321329
)
322330
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
323331
(this._protos as any).google.cloud.redis.v1.CloudRedis,
324-
this._opts
332+
this._opts,
333+
this._providedCustomServicePath
325334
) as Promise<{[method: string]: Function}>;
326335

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

packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const version = require('../../../package.json').version;
6363
export class CloudRedisClient {
6464
private _terminated = false;
6565
private _opts: ClientOptions;
66+
private _providedCustomServicePath: boolean;
6667
private _gaxModule: typeof gax | typeof gax.fallback;
6768
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6869
private _protos: {};
@@ -74,6 +75,7 @@ export class CloudRedisClient {
7475
longrunning: {},
7576
batching: {},
7677
};
78+
warn: (code: string, message: string, warnType?: string) => void;
7779
innerApiCalls: {[name: string]: Function};
7880
pathTemplates: {[name: string]: gax.PathTemplate};
7981
operationsClient: gax.OperationsClient;
@@ -118,6 +120,9 @@ export class CloudRedisClient {
118120
const staticMembers = this.constructor as typeof CloudRedisClient;
119121
const servicePath =
120122
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
123+
this._providedCustomServicePath = !!(
124+
opts?.servicePath || opts?.apiEndpoint
125+
);
121126
const port = opts?.port || staticMembers.port;
122127
const clientConfig = opts?.clientConfig ?? {};
123128
const fallback =
@@ -293,6 +298,9 @@ export class CloudRedisClient {
293298
// of calling the API is handled in `google-gax`, with this code
294299
// merely providing the destination and request information.
295300
this.innerApiCalls = {};
301+
302+
// Add a warn function to the client constructor so it can be easily tested.
303+
this.warn = gax.warn;
296304
}
297305

298306
/**
@@ -321,7 +329,8 @@ export class CloudRedisClient {
321329
)
322330
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
323331
(this._protos as any).google.cloud.redis.v1beta1.CloudRedis,
324-
this._opts
332+
this._opts,
333+
this._providedCustomServicePath
325334
) as Promise<{[method: string]: Function}>;
326335

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

0 commit comments

Comments
 (0)