From 8649cc6ae0a4e6ae807ba9e5af438ca0ffc9592a 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:11 +0000 Subject: [PATCH] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#190) 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/big_query_read_client.ts | 11 ++++++++++- src/v1beta1/big_query_storage_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/v1/big_query_read_client.ts b/src/v1/big_query_read_client.ts index 6083fd59..92ff7ef1 100644 --- a/src/v1/big_query_read_client.ts +++ b/src/v1/big_query_read_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; export class BigQueryReadClient { 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: {}; @@ -52,6 +53,7 @@ export class BigQueryReadClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; bigQueryReadStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class BigQueryReadClient { const staticMembers = this.constructor as typeof BigQueryReadClient; 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 = @@ -177,6 +182,9 @@ export class BigQueryReadClient { // 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; } /** @@ -205,7 +213,8 @@ export class BigQueryReadClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.storage.v1.BigQueryRead, - 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/big_query_storage_client.ts b/src/v1beta1/big_query_storage_client.ts index 3168b164..0f6da277 100644 --- a/src/v1beta1/big_query_storage_client.ts +++ b/src/v1beta1/big_query_storage_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; export class BigQueryStorageClient { 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: {}; @@ -52,6 +53,7 @@ export class BigQueryStorageClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; bigQueryStorageStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class BigQueryStorageClient { const staticMembers = this.constructor as typeof BigQueryStorageClient; 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 = @@ -177,6 +182,9 @@ export class BigQueryStorageClient { // 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; } /** @@ -206,7 +214,8 @@ export class BigQueryStorageClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.storage.v1beta1 .BigQueryStorage, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides