Skip to content

Commit a73cdbf

Browse files
fix: [Many APIs] await/catch promises, and update listOperationsAsync return type (#6188)
* feat: await/catch promises, and update listOperationsAsync return type PiperOrigin-RevId: 738212310 Source-Link: googleapis/googleapis@803b234 Source-Link: googleapis/googleapis-gen@4f44bd2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlc291cmNlbWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiNGY0NGJkMmJhYThkZDVhNzFjYTBjZWJkYjE2NGMzYzM0MzQxZWQ4NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiNGY0NGJkMmJhYThkZDVhNzFjYTBjZWJkYjE2NGMzYzM0MzQxZWQ4NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJ1bi8uT3dsQm90LnlhbWwiLCJoIjoiNGY0NGJkMmJhYThkZDVhNzFjYTBjZWJkYjE2NGMzYzM0MzQxZWQ4NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci8uT3dsQm90LnlhbWwiLCJoIjoiNGY0NGJkMmJhYThkZDVhNzFjYTBjZWJkYjE2NGMzYzM0MzQxZWQ4NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3JldG1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjRmNDRiZDJiYWE4ZGQ1YTcxY2EwY2ViZGIxNjRjM2MzNDM0MWVkODcifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyZXNvdXJjZW1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjRmNDRiZDJiYWE4ZGQ1YTcxY2EwY2ViZGIxNjRjM2MzNDM0MWVkODcifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2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updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update gax --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Sofia Leon <sofialeon@google.com>
1 parent dcfc7b4 commit a73cdbf

File tree

309 files changed

+11135
-8493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+11135
-8493
lines changed

packages/google-cloud-resourcemanager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"test": "c8 mocha build/test"
5050
},
5151
"dependencies": {
52-
"google-gax": "^5.0.0-rc.0"
52+
"google-gax": "^5.0.1-rc.0"
5353
},
5454
"devDependencies": {
5555
"@types/mocha": "^10.0.10",

packages/google-cloud-resourcemanager/samples/generated/v3/snippet_metadata.google.cloud.resourcemanager.v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"clientLibrary": {
33
"name": "nodejs-resourcemanager",
4-
"version": "5.3.1",
4+
"version": "6.0.0",
55
"language": "TYPESCRIPT",
66
"apis": [
77
{

packages/google-cloud-resourcemanager/samples/generated/v3/snippet_metadata_google.cloud.resourcemanager.v3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"clientLibrary": {
33
"name": "nodejs-resourcemanager",
4-
"version": "5.3.1",
4+
"version": "6.0.0",
55
"language": "TYPESCRIPT",
66
"apis": [
77
{

packages/google-cloud-resourcemanager/src/v3/folders_client.ts

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ export class FoldersClient {
594594
this._gaxModule.routingHeader.fromParams({
595595
name: request.name ?? '',
596596
});
597-
this.initialize();
597+
this.initialize().catch(err => {
598+
throw err;
599+
});
598600
this._log.info('getFolder request %j', request);
599601
const wrappedCallback:
600602
| Callback<
@@ -710,7 +712,9 @@ export class FoldersClient {
710712
this._gaxModule.routingHeader.fromParams({
711713
resource: request.resource ?? '',
712714
});
713-
this.initialize();
715+
this.initialize().catch(err => {
716+
throw err;
717+
});
714718
this._log.info('getIamPolicy request %j', request);
715719
const wrappedCallback:
716720
| Callback<
@@ -832,7 +836,9 @@ export class FoldersClient {
832836
this._gaxModule.routingHeader.fromParams({
833837
resource: request.resource ?? '',
834838
});
835-
this.initialize();
839+
this.initialize().catch(err => {
840+
throw err;
841+
});
836842
this._log.info('setIamPolicy request %j', request);
837843
const wrappedCallback:
838844
| Callback<
@@ -948,7 +954,9 @@ export class FoldersClient {
948954
this._gaxModule.routingHeader.fromParams({
949955
resource: request.resource ?? '',
950956
});
951-
this.initialize();
957+
this.initialize().catch(err => {
958+
throw err;
959+
});
952960
this._log.info('testIamPermissions request %j', request);
953961
const wrappedCallback:
954962
| Callback<
@@ -1098,7 +1106,9 @@ export class FoldersClient {
10981106
options = options || {};
10991107
options.otherArgs = options.otherArgs || {};
11001108
options.otherArgs.headers = options.otherArgs.headers || {};
1101-
this.initialize();
1109+
this.initialize().catch(err => {
1110+
throw err;
1111+
});
11021112
const wrappedCallback:
11031113
| Callback<
11041114
LROperation<
@@ -1285,7 +1295,9 @@ export class FoldersClient {
12851295
this._gaxModule.routingHeader.fromParams({
12861296
'folder.name': request.folder!.name ?? '',
12871297
});
1288-
this.initialize();
1298+
this.initialize().catch(err => {
1299+
throw err;
1300+
});
12891301
const wrappedCallback:
12901302
| Callback<
12911303
LROperation<
@@ -1473,7 +1485,9 @@ export class FoldersClient {
14731485
this._gaxModule.routingHeader.fromParams({
14741486
name: request.name ?? '',
14751487
});
1476-
this.initialize();
1488+
this.initialize().catch(err => {
1489+
throw err;
1490+
});
14771491
const wrappedCallback:
14781492
| Callback<
14791493
LROperation<
@@ -1651,7 +1665,9 @@ export class FoldersClient {
16511665
this._gaxModule.routingHeader.fromParams({
16521666
name: request.name ?? '',
16531667
});
1654-
this.initialize();
1668+
this.initialize().catch(err => {
1669+
throw err;
1670+
});
16551671
const wrappedCallback:
16561672
| Callback<
16571673
LROperation<
@@ -1829,7 +1845,9 @@ export class FoldersClient {
18291845
this._gaxModule.routingHeader.fromParams({
18301846
name: request.name ?? '',
18311847
});
1832-
this.initialize();
1848+
this.initialize().catch(err => {
1849+
throw err;
1850+
});
18331851
const wrappedCallback:
18341852
| Callback<
18351853
LROperation<
@@ -2008,7 +2026,9 @@ export class FoldersClient {
20082026
options = options || {};
20092027
options.otherArgs = options.otherArgs || {};
20102028
options.otherArgs.headers = options.otherArgs.headers || {};
2011-
this.initialize();
2029+
this.initialize().catch(err => {
2030+
throw err;
2031+
});
20122032
const wrappedCallback:
20132033
| PaginationCallback<
20142034
protos.google.cloud.resourcemanager.v3.IListFoldersRequest,
@@ -2084,7 +2104,9 @@ export class FoldersClient {
20842104
options.otherArgs.headers = options.otherArgs.headers || {};
20852105
const defaultCallSettings = this._defaults['listFolders'];
20862106
const callSettings = defaultCallSettings.merge(options);
2087-
this.initialize();
2107+
this.initialize().catch(err => {
2108+
throw err;
2109+
});
20882110
this._log.info('listFolders stream %j', request);
20892111
return this.descriptors.page.listFolders.createStream(
20902112
this.innerApiCalls.listFolders as GaxCall,
@@ -2142,7 +2164,9 @@ export class FoldersClient {
21422164
options.otherArgs.headers = options.otherArgs.headers || {};
21432165
const defaultCallSettings = this._defaults['listFolders'];
21442166
const callSettings = defaultCallSettings.merge(options);
2145-
this.initialize();
2167+
this.initialize().catch(err => {
2168+
throw err;
2169+
});
21462170
this._log.info('listFolders iterate %j', request);
21472171
return this.descriptors.page.listFolders.asyncIterate(
21482172
this.innerApiCalls['listFolders'] as GaxCall,
@@ -2278,7 +2302,9 @@ export class FoldersClient {
22782302
options = options || {};
22792303
options.otherArgs = options.otherArgs || {};
22802304
options.otherArgs.headers = options.otherArgs.headers || {};
2281-
this.initialize();
2305+
this.initialize().catch(err => {
2306+
throw err;
2307+
});
22822308
const wrappedCallback:
22832309
| PaginationCallback<
22842310
protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest,
@@ -2372,7 +2398,9 @@ export class FoldersClient {
23722398
options.otherArgs.headers = options.otherArgs.headers || {};
23732399
const defaultCallSettings = this._defaults['searchFolders'];
23742400
const callSettings = defaultCallSettings.merge(options);
2375-
this.initialize();
2401+
this.initialize().catch(err => {
2402+
throw err;
2403+
});
23762404
this._log.info('searchFolders stream %j', request);
23772405
return this.descriptors.page.searchFolders.createStream(
23782406
this.innerApiCalls.searchFolders as GaxCall,
@@ -2448,7 +2476,9 @@ export class FoldersClient {
24482476
options.otherArgs.headers = options.otherArgs.headers || {};
24492477
const defaultCallSettings = this._defaults['searchFolders'];
24502478
const callSettings = defaultCallSettings.merge(options);
2451-
this.initialize();
2479+
this.initialize().catch(err => {
2480+
throw err;
2481+
});
24522482
this._log.info('searchFolders iterate %j', request);
24532483
return this.descriptors.page.searchFolders.asyncIterate(
24542484
this.innerApiCalls['searchFolders'] as GaxCall,
@@ -2550,7 +2580,7 @@ export class FoldersClient {
25502580
listOperationsAsync(
25512581
request: protos.google.longrunning.ListOperationsRequest,
25522582
options?: gax.CallOptions
2553-
): AsyncIterable<protos.google.longrunning.ListOperationsResponse> {
2583+
): AsyncIterable<protos.google.longrunning.IOperation> {
25542584
options = options || {};
25552585
options.otherArgs = options.otherArgs || {};
25562586
options.otherArgs.headers = options.otherArgs.headers || {};

packages/google-cloud-resourcemanager/src/v3/organizations_client.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,9 @@ export class OrganizationsClient {
499499
this._gaxModule.routingHeader.fromParams({
500500
name: request.name ?? '',
501501
});
502-
this.initialize();
502+
this.initialize().catch(err => {
503+
throw err;
504+
});
503505
this._log.info('getOrganization request %j', request);
504506
const wrappedCallback:
505507
| Callback<
@@ -619,7 +621,9 @@ export class OrganizationsClient {
619621
this._gaxModule.routingHeader.fromParams({
620622
resource: request.resource ?? '',
621623
});
622-
this.initialize();
624+
this.initialize().catch(err => {
625+
throw err;
626+
});
623627
this._log.info('getIamPolicy request %j', request);
624628
const wrappedCallback:
625629
| Callback<
@@ -742,7 +746,9 @@ export class OrganizationsClient {
742746
this._gaxModule.routingHeader.fromParams({
743747
resource: request.resource ?? '',
744748
});
745-
this.initialize();
749+
this.initialize().catch(err => {
750+
throw err;
751+
});
746752
this._log.info('setIamPolicy request %j', request);
747753
const wrappedCallback:
748754
| Callback<
@@ -858,7 +864,9 @@ export class OrganizationsClient {
858864
this._gaxModule.routingHeader.fromParams({
859865
resource: request.resource ?? '',
860866
});
861-
this.initialize();
867+
this.initialize().catch(err => {
868+
throw err;
869+
});
862870
this._log.info('testIamPermissions request %j', request);
863871
const wrappedCallback:
864872
| Callback<
@@ -1003,7 +1011,9 @@ export class OrganizationsClient {
10031011
options = options || {};
10041012
options.otherArgs = options.otherArgs || {};
10051013
options.otherArgs.headers = options.otherArgs.headers || {};
1006-
this.initialize();
1014+
this.initialize().catch(err => {
1015+
throw err;
1016+
});
10071017
const wrappedCallback:
10081018
| PaginationCallback<
10091019
protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest,
@@ -1085,7 +1095,9 @@ export class OrganizationsClient {
10851095
options.otherArgs.headers = options.otherArgs.headers || {};
10861096
const defaultCallSettings = this._defaults['searchOrganizations'];
10871097
const callSettings = defaultCallSettings.merge(options);
1088-
this.initialize();
1098+
this.initialize().catch(err => {
1099+
throw err;
1100+
});
10891101
this._log.info('searchOrganizations stream %j', request);
10901102
return this.descriptors.page.searchOrganizations.createStream(
10911103
this.innerApiCalls.searchOrganizations as GaxCall,
@@ -1149,7 +1161,9 @@ export class OrganizationsClient {
11491161
options.otherArgs.headers = options.otherArgs.headers || {};
11501162
const defaultCallSettings = this._defaults['searchOrganizations'];
11511163
const callSettings = defaultCallSettings.merge(options);
1152-
this.initialize();
1164+
this.initialize().catch(err => {
1165+
throw err;
1166+
});
11531167
this._log.info('searchOrganizations iterate %j', request);
11541168
return this.descriptors.page.searchOrganizations.asyncIterate(
11551169
this.innerApiCalls['searchOrganizations'] as GaxCall,

0 commit comments

Comments
 (0)