From 2291e36f47c4f49d7afc6350a04c2ea3a1a0c460 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:10:19 +0000 Subject: [PATCH] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#59) 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 --- .../src/v1/quota_controller_client.ts | 11 ++++++++++- .../src/v1/service_controller_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts b/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts index f53d9386485..830b30782be 100644 --- a/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts +++ b/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts @@ -42,6 +42,7 @@ const version = require('../../../package.json').version; export class QuotaControllerClient { 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: {}; @@ -53,6 +54,7 @@ export class QuotaControllerClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; quotaControllerStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class QuotaControllerClient { const staticMembers = this.constructor as typeof QuotaControllerClient; 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 = @@ -154,6 +159,9 @@ export class QuotaControllerClient { // 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; } /** @@ -182,7 +190,8 @@ export class QuotaControllerClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.api.servicecontrol.v1.QuotaController, - 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-api-servicecontrol/src/v1/service_controller_client.ts b/packages/google-api-servicecontrol/src/v1/service_controller_client.ts index 948b739f08f..06222a7a2ba 100644 --- a/packages/google-api-servicecontrol/src/v1/service_controller_client.ts +++ b/packages/google-api-servicecontrol/src/v1/service_controller_client.ts @@ -42,6 +42,7 @@ const version = require('../../../package.json').version; export class ServiceControllerClient { 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: {}; @@ -53,6 +54,7 @@ export class ServiceControllerClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; serviceControllerStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class ServiceControllerClient { const staticMembers = this.constructor as typeof ServiceControllerClient; 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 = @@ -154,6 +159,9 @@ export class ServiceControllerClient { // 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; } /** @@ -182,7 +190,8 @@ export class ServiceControllerClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.api.servicecontrol.v1.ServiceController, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides