From 88c3f8b62ccfc7ee3e216c2460eac01e64ac23d7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:08:11 +0000 Subject: [PATCH] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#777) 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: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- packages/google-cloud-node/src/v1/speech_client.ts | 11 ++++++++++- .../src/v1p1beta1/adaptation_client.ts | 11 ++++++++++- .../google-cloud-node/src/v1p1beta1/speech_client.ts | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-node/src/v1/speech_client.ts b/packages/google-cloud-node/src/v1/speech_client.ts index 0026d8093961..ab73b4fac5a7 100644 --- a/packages/google-cloud-node/src/v1/speech_client.ts +++ b/packages/google-cloud-node/src/v1/speech_client.ts @@ -45,6 +45,7 @@ const version = require('../../../package.json').version; export class SpeechClient { 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: {}; @@ -56,6 +57,7 @@ export class SpeechClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; operationsClient: gax.OperationsClient; speechStub?: Promise<{[name: string]: Function}>; @@ -99,6 +101,9 @@ export class SpeechClient { const staticMembers = this.constructor as typeof SpeechClient; 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 = @@ -193,6 +198,9 @@ export class SpeechClient { // 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; } /** @@ -221,7 +229,8 @@ export class SpeechClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.speech.v1.Speech, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts b/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts index 1d1b450a46e3..aee1331fb854 100644 --- a/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts +++ b/packages/google-cloud-node/src/v1p1beta1/adaptation_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class AdaptationClient { 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: {}; @@ -59,6 +60,7 @@ export class AdaptationClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; adaptationStub?: Promise<{[name: string]: Function}>; @@ -102,6 +104,9 @@ export class AdaptationClient { const staticMembers = this.constructor as typeof AdaptationClient; 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 = @@ -195,6 +200,9 @@ export class AdaptationClient { // 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; } /** @@ -223,7 +231,8 @@ export class AdaptationClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.speech.v1p1beta1.Adaptation, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-node/src/v1p1beta1/speech_client.ts b/packages/google-cloud-node/src/v1p1beta1/speech_client.ts index 378e7970726a..d943e845d2a3 100644 --- a/packages/google-cloud-node/src/v1p1beta1/speech_client.ts +++ b/packages/google-cloud-node/src/v1p1beta1/speech_client.ts @@ -45,6 +45,7 @@ const version = require('../../../package.json').version; export class SpeechClient { 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: {}; @@ -56,6 +57,7 @@ export class SpeechClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -100,6 +102,9 @@ export class SpeechClient { const staticMembers = this.constructor as typeof SpeechClient; 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 = @@ -206,6 +211,9 @@ export class SpeechClient { // 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; } /** @@ -234,7 +242,8 @@ export class SpeechClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.speech.v1p1beta1.Speech, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides