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

Commit dee8dc2

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#534)
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 93e96ad commit dee8dc2

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/v1/text_to_speech_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const version = require('../../../package.json').version;
3939
export class TextToSpeechClient {
4040
private _terminated = false;
4141
private _opts: ClientOptions;
42+
private _providedCustomServicePath: boolean;
4243
private _gaxModule: typeof gax | typeof gax.fallback;
4344
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
4445
private _protos: {};
@@ -50,6 +51,7 @@ export class TextToSpeechClient {
5051
longrunning: {},
5152
batching: {},
5253
};
54+
warn: (code: string, message: string, warnType?: string) => void;
5355
innerApiCalls: {[name: string]: Function};
5456
textToSpeechStub?: Promise<{[name: string]: Function}>;
5557

@@ -92,6 +94,9 @@ export class TextToSpeechClient {
9294
const staticMembers = this.constructor as typeof TextToSpeechClient;
9395
const servicePath =
9496
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
97+
this._providedCustomServicePath = !!(
98+
opts?.servicePath || opts?.apiEndpoint
99+
);
95100
const port = opts?.port || staticMembers.port;
96101
const clientConfig = opts?.clientConfig ?? {};
97102
const fallback =
@@ -151,6 +156,9 @@ export class TextToSpeechClient {
151156
// of calling the API is handled in `google-gax`, with this code
152157
// merely providing the destination and request information.
153158
this.innerApiCalls = {};
159+
160+
// Add a warn function to the client constructor so it can be easily tested.
161+
this.warn = gax.warn;
154162
}
155163

156164
/**
@@ -179,7 +187,8 @@ export class TextToSpeechClient {
179187
)
180188
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
181189
(this._protos as any).google.cloud.texttospeech.v1.TextToSpeech,
182-
this._opts
190+
this._opts,
191+
this._providedCustomServicePath
183192
) as Promise<{[method: string]: Function}>;
184193

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

src/v1beta1/text_to_speech_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const version = require('../../../package.json').version;
3939
export class TextToSpeechClient {
4040
private _terminated = false;
4141
private _opts: ClientOptions;
42+
private _providedCustomServicePath: boolean;
4243
private _gaxModule: typeof gax | typeof gax.fallback;
4344
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
4445
private _protos: {};
@@ -50,6 +51,7 @@ export class TextToSpeechClient {
5051
longrunning: {},
5152
batching: {},
5253
};
54+
warn: (code: string, message: string, warnType?: string) => void;
5355
innerApiCalls: {[name: string]: Function};
5456
textToSpeechStub?: Promise<{[name: string]: Function}>;
5557

@@ -92,6 +94,9 @@ export class TextToSpeechClient {
9294
const staticMembers = this.constructor as typeof TextToSpeechClient;
9395
const servicePath =
9496
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
97+
this._providedCustomServicePath = !!(
98+
opts?.servicePath || opts?.apiEndpoint
99+
);
95100
const port = opts?.port || staticMembers.port;
96101
const clientConfig = opts?.clientConfig ?? {};
97102
const fallback =
@@ -151,6 +156,9 @@ export class TextToSpeechClient {
151156
// of calling the API is handled in `google-gax`, with this code
152157
// merely providing the destination and request information.
153158
this.innerApiCalls = {};
159+
160+
// Add a warn function to the client constructor so it can be easily tested.
161+
this.warn = gax.warn;
154162
}
155163

156164
/**
@@ -179,7 +187,8 @@ export class TextToSpeechClient {
179187
)
180188
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
181189
(this._protos as any).google.cloud.texttospeech.v1beta1.TextToSpeech,
182-
this._opts
190+
this._opts,
191+
this._providedCustomServicePath
183192
) as Promise<{[method: string]: Function}>;
184193

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

0 commit comments

Comments
 (0)