diff --git a/src/v3/translation_service_client.ts b/src/v3/translation_service_client.ts index 6bcda4cd..a630052c 100644 --- a/src/v3/translation_service_client.ts +++ b/src/v3/translation_service_client.ts @@ -133,6 +133,12 @@ export class TranslationServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -1666,6 +1672,7 @@ export class TranslationServiceClient { return this.translationServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/src/v3beta1/translation_service_client.ts b/src/v3beta1/translation_service_client.ts index 065fd104..1831f005 100644 --- a/src/v3beta1/translation_service_client.ts +++ b/src/v3beta1/translation_service_client.ts @@ -133,6 +133,12 @@ export class TranslationServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -2085,6 +2091,7 @@ export class TranslationServiceClient { return this.translationServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve();