From 4dc2837bd01798c8eb5e78021e88945e7db0d44d 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:43 +0000 Subject: [PATCH] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#63) 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/v1beta2/artifact_registry_client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts b/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts index 4927aaf33e7..906e17e6988 100644 --- a/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts +++ b/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts @@ -61,6 +61,7 @@ const version = require('../../../package.json').version; export class ArtifactRegistryClient { 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: {}; @@ -72,6 +73,7 @@ export class ArtifactRegistryClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -116,6 +118,9 @@ export class ArtifactRegistryClient { const staticMembers = this.constructor as typeof ArtifactRegistryClient; 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 = @@ -278,6 +283,9 @@ export class ArtifactRegistryClient { // 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; } /** @@ -307,7 +315,8 @@ export class ArtifactRegistryClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.devtools.artifactregistry.v1beta2 .ArtifactRegistry, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides