Skip to content

Commit 228e62e

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#296)
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 b85aeea commit 228e62e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/google-cloud-datalabeling/src/v1beta1/data_labeling_service_client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const version = require('../../../package.json').version;
4949
export class DataLabelingServiceClient {
5050
private _terminated = false;
5151
private _opts: ClientOptions;
52+
private _providedCustomServicePath: boolean;
5253
private _gaxModule: typeof gax | typeof gax.fallback;
5354
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
5455
private _protos: {};
@@ -60,6 +61,7 @@ export class DataLabelingServiceClient {
6061
longrunning: {},
6162
batching: {},
6263
};
64+
warn: (code: string, message: string, warnType?: string) => void;
6365
innerApiCalls: {[name: string]: Function};
6466
pathTemplates: {[name: string]: gax.PathTemplate};
6567
operationsClient: gax.OperationsClient;
@@ -104,6 +106,9 @@ export class DataLabelingServiceClient {
104106
const staticMembers = this.constructor as typeof DataLabelingServiceClient;
105107
const servicePath =
106108
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
109+
this._providedCustomServicePath = !!(
110+
opts?.servicePath || opts?.apiEndpoint
111+
);
107112
const port = opts?.port || staticMembers.port;
108113
const clientConfig = opts?.clientConfig ?? {};
109114
const fallback =
@@ -329,6 +334,9 @@ export class DataLabelingServiceClient {
329334
// of calling the API is handled in `google-gax`, with this code
330335
// merely providing the destination and request information.
331336
this.innerApiCalls = {};
337+
338+
// Add a warn function to the client constructor so it can be easily tested.
339+
this.warn = gax.warn;
332340
}
333341

334342
/**
@@ -358,7 +366,8 @@ export class DataLabelingServiceClient {
358366
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
359367
(this._protos as any).google.cloud.datalabeling.v1beta1
360368
.DataLabelingService,
361-
this._opts
369+
this._opts,
370+
this._providedCustomServicePath
362371
) as Promise<{[method: string]: Function}>;
363372

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

0 commit comments

Comments
 (0)