Skip to content

Commit 32d8c25

Browse files
yoshi-automationbcoe
authored andcommitted
fix: better close() in client (#87)
* [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * chore: we're using release-please now for releases Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent aab2575 commit 32d8c25

File tree

9 files changed

+963
-739
lines changed

9 files changed

+963
-739
lines changed

packages/google-cloud-datacatalog/.nycrc

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"**/scripts",
1313
"**/protos",
1414
"**/test",
15+
"**/*.d.ts",
1516
".jsdoc.js",
1617
"**/.jsdoc.js",
1718
"karma.conf.js",

packages/google-cloud-datacatalog/protos/protos.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC
1+
// Copyright 2020 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-datacatalog/protos/protos.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC
1+
// Copyright 2020 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-datacatalog/src/v1beta1/data_catalog_client.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ export class DataCatalogClient {
237237
for (const methodName of dataCatalogStubMethods) {
238238
const innerCallPromise = this.dataCatalogStub.then(
239239
stub => (...args: Array<{}>) => {
240+
if (this._terminated) {
241+
return Promise.reject('The client has already been closed.');
242+
}
240243
return stub[methodName].apply(stub, args);
241244
},
242245
(err: Error | null | undefined) => () => {
@@ -257,9 +260,6 @@ export class DataCatalogClient {
257260
callOptions?: CallOptions,
258261
callback?: APICallback
259262
) => {
260-
if (this._terminated) {
261-
return Promise.reject('The client has already been closed.');
262-
}
263263
return apiCall(argument, callOptions, callback);
264264
};
265265
}
@@ -2681,7 +2681,7 @@ export class DataCatalogClient {
26812681
* @param {string} location
26822682
* @returns {string} Resource name string.
26832683
*/
2684-
entrygroupPath(project: string, location: string) {
2684+
entryGroupPath(project: string, location: string) {
26852685
return this._pathTemplates.entrygroupPathTemplate.render({
26862686
project,
26872687
location,
@@ -2768,7 +2768,7 @@ export class DataCatalogClient {
27682768
* @param {string} location
27692769
* @returns {string} Resource name string.
27702770
*/
2771-
tagtemplatePath(project: string, location: string) {
2771+
tagTemplatePath(project: string, location: string) {
27722772
return this._pathTemplates.tagtemplatePathTemplate.render({
27732773
project,
27742774
location,
@@ -2869,7 +2869,7 @@ export class DataCatalogClient {
28692869
* @param {string} field
28702870
* @returns {string} Resource name string.
28712871
*/
2872-
tagtemplatefieldPath(project: string, location: string, field: string) {
2872+
tagTemplateFieldPath(project: string, location: string, field: string) {
28732873
return this._pathTemplates.tagtemplatefieldPathTemplate.render({
28742874
project,
28752875
location,

packages/google-cloud-datacatalog/src/v1beta1/policy_tag_manager_client.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ export class PolicyTagManagerClient {
217217
for (const methodName of policyTagManagerStubMethods) {
218218
const innerCallPromise = this.policyTagManagerStub.then(
219219
stub => (...args: Array<{}>) => {
220+
if (this._terminated) {
221+
return Promise.reject('The client has already been closed.');
222+
}
220223
return stub[methodName].apply(stub, args);
221224
},
222225
(err: Error | null | undefined) => () => {
@@ -237,9 +240,6 @@ export class PolicyTagManagerClient {
237240
callOptions?: CallOptions,
238241
callback?: APICallback
239242
) => {
240-
if (this._terminated) {
241-
return Promise.reject('The client has already been closed.');
242-
}
243243
return apiCall(argument, callOptions, callback);
244244
};
245245
}
@@ -1550,7 +1550,7 @@ export class PolicyTagManagerClient {
15501550
* @param {string} taxonomy
15511551
* @returns {string} Resource name string.
15521552
*/
1553-
policytagPath(project: string, location: string, taxonomy: string) {
1553+
policyTagPath(project: string, location: string, taxonomy: string) {
15541554
return this._pathTemplates.policytagPathTemplate.render({
15551555
project,
15561556
location,

packages/google-cloud-datacatalog/src/v1beta1/policy_tag_manager_serialization_client.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ export class PolicyTagManagerSerializationClient {
187187
for (const methodName of policyTagManagerSerializationStubMethods) {
188188
const innerCallPromise = this.policyTagManagerSerializationStub.then(
189189
stub => (...args: Array<{}>) => {
190+
if (this._terminated) {
191+
return Promise.reject('The client has already been closed.');
192+
}
190193
return stub[methodName].apply(stub, args);
191194
},
192195
(err: Error | null | undefined) => () => {
@@ -207,9 +210,6 @@ export class PolicyTagManagerSerializationClient {
207210
callOptions?: CallOptions,
208211
callback?: APICallback
209212
) => {
210-
if (this._terminated) {
211-
return Promise.reject('The client has already been closed.');
212-
}
213213
return apiCall(argument, callOptions, callback);
214214
};
215215
}

0 commit comments

Comments
 (0)