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

fix: Updating WORKSPACE files to use the newest version of the Typescript generator. #534

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/v1/text_to_speech_client.ts
Expand Up @@ -39,6 +39,7 @@ const version = require('../../../package.json').version;
export class TextToSpeechClient {
private _terminated = false;
private _opts: ClientOptions;
private _providedCustomServicePath: boolean;
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
Expand All @@ -50,6 +51,7 @@ export class TextToSpeechClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
textToSpeechStub?: Promise<{[name: string]: Function}>;

Expand Down Expand Up @@ -92,6 +94,9 @@ export class TextToSpeechClient {
const staticMembers = this.constructor as typeof TextToSpeechClient;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback =
Expand Down Expand Up @@ -151,6 +156,9 @@ export class TextToSpeechClient {
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
}

/**
Expand Down Expand Up @@ -179,7 +187,8 @@ export class TextToSpeechClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.cloud.texttospeech.v1.TextToSpeech,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down
11 changes: 10 additions & 1 deletion src/v1beta1/text_to_speech_client.ts
Expand Up @@ -39,6 +39,7 @@ const version = require('../../../package.json').version;
export class TextToSpeechClient {
private _terminated = false;
private _opts: ClientOptions;
private _providedCustomServicePath: boolean;
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
Expand All @@ -50,6 +51,7 @@ export class TextToSpeechClient {
longrunning: {},
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
textToSpeechStub?: Promise<{[name: string]: Function}>;

Expand Down Expand Up @@ -92,6 +94,9 @@ export class TextToSpeechClient {
const staticMembers = this.constructor as typeof TextToSpeechClient;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
this._providedCustomServicePath = !!(
opts?.servicePath || opts?.apiEndpoint
);
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
const fallback =
Expand Down Expand Up @@ -151,6 +156,9 @@ export class TextToSpeechClient {
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
}

/**
Expand Down Expand Up @@ -179,7 +187,8 @@ export class TextToSpeechClient {
)
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
(this._protos as any).google.cloud.texttospeech.v1beta1.TextToSpeech,
this._opts
this._opts,
this._providedCustomServicePath
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
Expand Down