Skip to content

Commit 4020832

Browse files
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: googleapis/googleapis@80f4042 Source-Link: googleapis/googleapis-gen@d3509d2
1 parent a96f93c commit 4020832

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const version = require('../../../package.json').version;
6161
export class ArtifactRegistryClient {
6262
private _terminated = false;
6363
private _opts: ClientOptions;
64+
private _providedCustomServicePath: boolean;
6465
private _gaxModule: typeof gax | typeof gax.fallback;
6566
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6667
private _protos: {};
@@ -72,6 +73,7 @@ export class ArtifactRegistryClient {
7273
longrunning: {},
7374
batching: {},
7475
};
76+
warn: (code: string, message: string, warnType?: string) => void;
7577
innerApiCalls: {[name: string]: Function};
7678
pathTemplates: {[name: string]: gax.PathTemplate};
7779
operationsClient: gax.OperationsClient;
@@ -116,6 +118,9 @@ export class ArtifactRegistryClient {
116118
const staticMembers = this.constructor as typeof ArtifactRegistryClient;
117119
const servicePath =
118120
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
121+
this._providedCustomServicePath = !!(
122+
opts?.servicePath || opts?.apiEndpoint
123+
);
119124
const port = opts?.port || staticMembers.port;
120125
const clientConfig = opts?.clientConfig ?? {};
121126
const fallback =
@@ -278,6 +283,9 @@ export class ArtifactRegistryClient {
278283
// of calling the API is handled in `google-gax`, with this code
279284
// merely providing the destination and request information.
280285
this.innerApiCalls = {};
286+
287+
// Add a warn function to the client constructor so it can be easily tested.
288+
this.warn = gax.warn;
281289
}
282290

283291
/**
@@ -307,7 +315,8 @@ export class ArtifactRegistryClient {
307315
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
308316
(this._protos as any).google.devtools.artifactregistry.v1beta2
309317
.ArtifactRegistry,
310-
this._opts
318+
this._opts,
319+
this._providedCustomServicePath
311320
) as Promise<{[method: string]: Function}>;
312321

313322
// Iterate over each of the methods that the service provides

0 commit comments

Comments
 (0)