Skip to content

Commit 2ddff69

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#24)
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 a107cdb commit 2ddff69

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/google-cloud-privatecatalog/src/v1beta1/private_catalog_client.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const version = require('../../../package.json').version;
6868
export class PrivateCatalogClient {
6969
private _terminated = false;
7070
private _opts: ClientOptions;
71+
private _providedCustomServicePath: boolean;
7172
private _gaxModule: typeof gax | typeof gax.fallback;
7273
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
7374
private _protos: {};
@@ -79,6 +80,7 @@ export class PrivateCatalogClient {
7980
longrunning: {},
8081
batching: {},
8182
};
83+
warn: (code: string, message: string, warnType?: string) => void;
8284
innerApiCalls: {[name: string]: Function};
8385
pathTemplates: {[name: string]: gax.PathTemplate};
8486
privateCatalogStub?: Promise<{[name: string]: Function}>;
@@ -122,6 +124,9 @@ export class PrivateCatalogClient {
122124
const staticMembers = this.constructor as typeof PrivateCatalogClient;
123125
const servicePath =
124126
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
127+
this._providedCustomServicePath = !!(
128+
opts?.servicePath || opts?.apiEndpoint
129+
);
125130
const port = opts?.port || staticMembers.port;
126131
const clientConfig = opts?.clientConfig ?? {};
127132
const fallback =
@@ -217,6 +222,9 @@ export class PrivateCatalogClient {
217222
// of calling the API is handled in `google-gax`, with this code
218223
// merely providing the destination and request information.
219224
this.innerApiCalls = {};
225+
226+
// Add a warn function to the client constructor so it can be easily tested.
227+
this.warn = gax.warn;
220228
}
221229

222230
/**
@@ -246,7 +254,8 @@ export class PrivateCatalogClient {
246254
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
247255
(this._protos as any).google.cloud.privatecatalog.v1beta1
248256
.PrivateCatalog,
249-
this._opts
257+
this._opts,
258+
this._providedCustomServicePath
250259
) as Promise<{[method: string]: Function}>;
251260

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

0 commit comments

Comments
 (0)