From 0777d03d3e7d15f85d30da8e28ab73e4bcfa4d08 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Sat, 17 Jul 2021 05:17:14 -0700 Subject: [PATCH] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. 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-Author: Google APIs Source-Date: Fri Jul 16 02:09:07 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 --- dev/src/v1/firestore_admin_client.ts | 11 ++++++++++- dev/src/v1/firestore_client.ts | 11 ++++++++++- dev/src/v1beta1/firestore_client.ts | 11 ++++++++++- synth.metadata | 6 +++--- types/v1/firestore_admin_client.d.ts | 2 ++ types/v1/firestore_client.d.ts | 2 ++ types/v1beta1/firestore_client.d.ts | 2 ++ 7 files changed, 39 insertions(+), 6 deletions(-) diff --git a/dev/src/v1/firestore_admin_client.ts b/dev/src/v1/firestore_admin_client.ts index aedca6d4a..6dee553f7 100644 --- a/dev/src/v1/firestore_admin_client.ts +++ b/dev/src/v1/firestore_admin_client.ts @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; export class FirestoreAdminClient { 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: {}; @@ -61,6 +62,7 @@ export class FirestoreAdminClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class FirestoreAdminClient { const staticMembers = this.constructor as typeof FirestoreAdminClient; 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 = @@ -258,6 +263,9 @@ export class FirestoreAdminClient { // 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; } /** @@ -286,7 +294,8 @@ export class FirestoreAdminClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.firestore.admin.v1.FirestoreAdmin, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/dev/src/v1/firestore_client.ts b/dev/src/v1/firestore_client.ts index 958e74688..f216b4c27 100644 --- a/dev/src/v1/firestore_client.ts +++ b/dev/src/v1/firestore_client.ts @@ -55,6 +55,7 @@ const version = require('../../../package.json').version; export class FirestoreClient { 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: {}; @@ -66,6 +67,7 @@ export class FirestoreClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; firestoreStub?: Promise<{[name: string]: Function}>; @@ -108,6 +110,9 @@ export class FirestoreClient { const staticMembers = this.constructor as typeof FirestoreClient; 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 = @@ -205,6 +210,9 @@ export class FirestoreClient { // 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; } /** @@ -233,7 +241,8 @@ export class FirestoreClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.firestore.v1.Firestore, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/dev/src/v1beta1/firestore_client.ts b/dev/src/v1beta1/firestore_client.ts index 10fbc0a3f..a64604cdd 100644 --- a/dev/src/v1beta1/firestore_client.ts +++ b/dev/src/v1beta1/firestore_client.ts @@ -58,6 +58,7 @@ const version = require('../../../package.json').version; export class FirestoreClient { 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: {}; @@ -69,6 +70,7 @@ export class FirestoreClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; firestoreStub?: Promise<{[name: string]: Function}>; @@ -111,6 +113,9 @@ export class FirestoreClient { const staticMembers = this.constructor as typeof FirestoreClient; 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 = @@ -208,6 +213,9 @@ export class FirestoreClient { // 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; } /** @@ -236,7 +244,8 @@ export class FirestoreClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.firestore.v1beta1.Firestore, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/synth.metadata b/synth.metadata index 23699b48e..87d943e0e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-firestore.git", - "sha": "7cebee27f6ffe0a58b03ec8010dc50abee51944b" + "sha": "8d9c50381eedf6ee8043eed681d03b44262b9820" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "076f7e9f0b258bdb54338895d7251b202e8f0de3", - "internalRef": "380641501" + "sha": "80f404215a9346259db760d80d0671f28c433453", + "internalRef": "385101839" } }, { diff --git a/types/v1/firestore_admin_client.d.ts b/types/v1/firestore_admin_client.d.ts index 945ebe8a0..523c92ad7 100644 --- a/types/v1/firestore_admin_client.d.ts +++ b/types/v1/firestore_admin_client.d.ts @@ -35,12 +35,14 @@ import * as protos from '../protos/firestore_admin_v1_proto_api'; export declare class FirestoreAdminClient { private _terminated; private _opts; + private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; auth: gax.GoogleAuth; descriptors: Descriptors; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; diff --git a/types/v1/firestore_client.d.ts b/types/v1/firestore_client.d.ts index fca4787e1..139527dd9 100644 --- a/types/v1/firestore_client.d.ts +++ b/types/v1/firestore_client.d.ts @@ -40,12 +40,14 @@ import * as protos from '../protos/firestore_v1_proto_api'; export declare class FirestoreClient { private _terminated; private _opts; + private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; auth: gax.GoogleAuth; descriptors: Descriptors; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; diff --git a/types/v1beta1/firestore_client.d.ts b/types/v1beta1/firestore_client.d.ts index 2f182209a..24ea51b39 100644 --- a/types/v1beta1/firestore_client.d.ts +++ b/types/v1beta1/firestore_client.d.ts @@ -41,12 +41,14 @@ import * as protos from '../protos/firestore_v1beta1_proto_api'; export declare class FirestoreClient { private _terminated; private _opts; + private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; auth: gax.GoogleAuth; descriptors: Descriptors; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; };