Skip to content

Commit b039d41

Browse files
fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#251)
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 ea24b6e commit b039d41

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const version = require('../../../package.json').version;
5656
export class CloudBuildClient {
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 CloudBuildClient {
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
operationsClient: gax.OperationsClient;
@@ -111,6 +113,9 @@ export class CloudBuildClient {
111113
const staticMembers = this.constructor as typeof CloudBuildClient;
112114
const servicePath =
113115
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
116+
this._providedCustomServicePath = !!(
117+
opts?.servicePath || opts?.apiEndpoint
118+
);
114119
const port = opts?.port || staticMembers.port;
115120
const clientConfig = opts?.clientConfig ?? {};
116121
const fallback =
@@ -271,6 +276,9 @@ export class CloudBuildClient {
271276
// of calling the API is handled in `google-gax`, with this code
272277
// merely providing the destination and request information.
273278
this.innerApiCalls = {};
279+
280+
// Add a warn function to the client constructor so it can be easily tested.
281+
this.warn = gax.warn;
274282
}
275283

276284
/**
@@ -299,7 +307,8 @@ export class CloudBuildClient {
299307
)
300308
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
301309
(this._protos as any).google.devtools.cloudbuild.v1.CloudBuild,
302-
this._opts
310+
this._opts,
311+
this._providedCustomServicePath
303312
) as Promise<{[method: string]: Function}>;
304313

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

0 commit comments

Comments
 (0)