From 2fa96dfe9145f479a2561b5a1215a6ffd19ddf07 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 11 Dec 2019 11:52:33 -0800 Subject: [PATCH] feat: make operationsClient and service stub public --- src/v1/cloud_build_client.ts | 17 +++++++++-------- synth.metadata | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/v1/cloud_build_client.ts b/src/v1/cloud_build_client.ts index 5fc9aa2..50b85d3 100644 --- a/src/v1/cloud_build_client.ts +++ b/src/v1/cloud_build_client.ts @@ -49,10 +49,11 @@ const version = require('../../../package.json').version; */ export class CloudBuildClient { private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; - private _cloudBuildStub: Promise<{[name: string]: Function}>; private _innerApiCalls: {[name: string]: Function}; private _terminated = false; auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + cloudBuildStub: Promise<{[name: string]: Function}>; /** * Construct an instance of CloudBuildClient. @@ -168,7 +169,7 @@ export class CloudBuildClient { ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) : gaxModule.protobuf.loadSync(nodejsProtoPath); - const operationsClient = gaxModule + this.operationsClient = gaxModule .lro({ auth: this.auth, grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, @@ -195,17 +196,17 @@ export class CloudBuildClient { this._descriptors.longrunning = { createBuild: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, createBuildResponse.decode.bind(createBuildResponse), createBuildMetadata.decode.bind(createBuildMetadata) ), retryBuild: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, retryBuildResponse.decode.bind(retryBuildResponse), retryBuildMetadata.decode.bind(retryBuildMetadata) ), runBuildTrigger: new gaxModule.LongrunningDescriptor( - operationsClient, + this.operationsClient, runBuildTriggerResponse.decode.bind(runBuildTriggerResponse), runBuildTriggerMetadata.decode.bind(runBuildTriggerMetadata) ), @@ -226,7 +227,7 @@ export class CloudBuildClient { // Put together the "service stub" for // google.devtools.cloudbuild.v1.CloudBuild. - this._cloudBuildStub = gaxGrpc.createStub( + this.cloudBuildStub = gaxGrpc.createStub( opts.fallback ? (protos as protobuf.Root).lookupService( 'google.devtools.cloudbuild.v1.CloudBuild' @@ -258,7 +259,7 @@ export class CloudBuildClient { ]; for (const methodName of cloudBuildStubMethods) { - const innerCallPromise = this._cloudBuildStub.then( + const innerCallPromise = this.cloudBuildStub.then( stub => (...args: Array<{}>) => { return stub[methodName].apply(stub, args); }, @@ -1688,7 +1689,7 @@ export class CloudBuildClient { */ close(): Promise { if (!this._terminated) { - return this._cloudBuildStub.then(stub => { + return this.cloudBuildStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/synth.metadata b/synth.metadata index db5b111..26c8e59 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-10T12:12:01.622533Z", + "updateTime": "2019-12-11T12:12:24.059572Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6cc9499e225a4f6a5e34fe07e390f67055d7991c", - "internalRef": "284643689" + "sha": "e47fdd266542386e5e7346697f90476e96dc7ee8", + "internalRef": "284822593" } }, {