From 6787e23374c3ef97b4f267bf629ae03bf58f321a 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:38 +0000 Subject: [PATCH] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#299) 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/recaptcha_enterprise_service_client.ts | 11 ++++++++++- .../recaptcha_enterprise_service_v1_beta1_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/v1/recaptcha_enterprise_service_client.ts b/src/v1/recaptcha_enterprise_service_client.ts index b5e3832..23ccb56 100644 --- a/src/v1/recaptcha_enterprise_service_client.ts +++ b/src/v1/recaptcha_enterprise_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class RecaptchaEnterpriseServiceClient { 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 RecaptchaEnterpriseServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceClient { .constructor as typeof RecaptchaEnterpriseServiceClient; 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 = @@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceClient { // 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; } /** @@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.recaptchaenterprise.v1 .RecaptchaEnterpriseService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 318dc5a..b2533d8 100644 --- a/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class RecaptchaEnterpriseServiceV1Beta1Client { 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 RecaptchaEnterpriseServiceV1Beta1Client { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { .constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client; 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 = @@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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; } /** @@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.recaptchaenterprise.v1beta1 .RecaptchaEnterpriseServiceV1Beta1, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides