Skip to content

Commit 3018446

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#634)
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 831474f commit 3018446

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/google-privacy-dlp/src/v2/dlp_service_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const version = require('../../../package.json').version;
5656
export class DlpServiceClient {
5757
private _terminated = false;
5858
private _opts: ClientOptions;
59+
private _providedCustomServicePath: boolean;
5960
private _gaxModule: typeof gax | typeof gax.fallback;
6061
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
6162
private _protos: {};
@@ -67,6 +68,7 @@ export class DlpServiceClient {
6768
longrunning: {},
6869
batching: {},
6970
};
71+
warn: (code: string, message: string, warnType?: string) => void;
7072
innerApiCalls: {[name: string]: Function};
7173
pathTemplates: {[name: string]: gax.PathTemplate};
7274
dlpServiceStub?: Promise<{[name: string]: Function}>;
@@ -110,6 +112,9 @@ export class DlpServiceClient {
110112
const staticMembers = this.constructor as typeof DlpServiceClient;
111113
const servicePath =
112114
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
115+
this._providedCustomServicePath = !!(
116+
opts?.servicePath || opts?.apiEndpoint
117+
);
113118
const port = opts?.port || staticMembers.port;
114119
const clientConfig = opts?.clientConfig ?? {};
115120
const fallback =
@@ -273,6 +278,9 @@ export class DlpServiceClient {
273278
// of calling the API is handled in `google-gax`, with this code
274279
// merely providing the destination and request information.
275280
this.innerApiCalls = {};
281+
282+
// Add a warn function to the client constructor so it can be easily tested.
283+
this.warn = gax.warn;
276284
}
277285

278286
/**
@@ -301,7 +309,8 @@ export class DlpServiceClient {
301309
)
302310
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
303311
(this._protos as any).google.privacy.dlp.v2.DlpService,
304-
this._opts
312+
this._opts,
313+
this._providedCustomServicePath
305314
) as Promise<{[method: string]: Function}>;
306315

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

0 commit comments

Comments
 (0)