Skip to content

Commit f4866df

Browse files
fix: [Many APIs] await/catch promises, and update listOperationsAsync return type (#6190)
* 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWNvbnRhaW5lcmFuYWx5c2lzLy5Pd2xCb3QueWFtbCIsImgiOiI0ZjQ0YmQyYmFhOGRkNWE3MWNhMGNlYmRiMTY0YzNjMzQzNDFlZDg3In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWlhbS1jcmVkZW50aWFscy8uT3dsQm90LnlhbWwiLCJoIjoiNGY0NGJkMmJhYThkZDVhNzFjYTBjZWJkYjE2NGMzYzM0MzQxZWQ4NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWlhbS8uT3dsQm90LnlhbWwiLCJoIjoiNGY0NGJkMmJhYThkZDVhNzFjYTBjZWJkYjE2NGMzYzM0MzQxZWQ4NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWlkZW50aXR5LWFjY2Vzc2NvbnRleHRtYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiI0ZjQ0YmQyYmFhOGRkNWE3MWNhMGNlYmRiMTY0YzNjMzQzNDFlZDg3In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYWRkcmVzc3ZhbGlkYXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjRmNDRiZDJiYWE4ZGQ1YTcxY2EwY2ViZGIxNjRjM2MzNDM0MWVkODcifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYXJlYWluc2lnaHRzLy5Pd2xCb3QueWFtbCIsImgiOiI0ZjQ0YmQyYmFhOGRkNWE3MWNhMGNlYmRiMTY0YzNjMzQzNDFlZDg3In0= Copy-Tag: eyJwIjoicGF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ab?url=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 <[email protected]>
1 parent a73cdbf commit f4866df

141 files changed

Lines changed: 3214 additions & 2484 deletions

File tree

Some content is hidden

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

packages/google-devtools-containeranalysis/src/v1/container_analysis_client.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ export class ContainerAnalysisClient {
491491
this._gaxModule.routingHeader.fromParams({
492492
resource: request.resource ?? '',
493493
});
494-
this.initialize();
494+
this.initialize().catch(err => {
495+
throw err;
496+
});
495497
this._log.info('setIamPolicy request %j', request);
496498
const wrappedCallback:
497499
| Callback<
@@ -608,7 +610,9 @@ export class ContainerAnalysisClient {
608610
this._gaxModule.routingHeader.fromParams({
609611
resource: request.resource ?? '',
610612
});
611-
this.initialize();
613+
this.initialize().catch(err => {
614+
throw err;
615+
});
612616
this._log.info('getIamPolicy request %j', request);
613617
const wrappedCallback:
614618
| Callback<
@@ -726,7 +730,9 @@ export class ContainerAnalysisClient {
726730
this._gaxModule.routingHeader.fromParams({
727731
resource: request.resource ?? '',
728732
});
729-
this.initialize();
733+
this.initialize().catch(err => {
734+
throw err;
735+
});
730736
this._log.info('testIamPermissions request %j', request);
731737
const wrappedCallback:
732738
| Callback<
@@ -849,7 +855,9 @@ export class ContainerAnalysisClient {
849855
this._gaxModule.routingHeader.fromParams({
850856
parent: request.parent ?? '',
851857
});
852-
this.initialize();
858+
this.initialize().catch(err => {
859+
throw err;
860+
});
853861
this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
854862
const wrappedCallback:
855863
| Callback<

packages/google-devtools-containeranalysis/src/v1beta1/container_analysis_v1_beta1_client.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ export class ContainerAnalysisV1Beta1Client {
476476
this._gaxModule.routingHeader.fromParams({
477477
resource: request.resource ?? '',
478478
});
479-
this.initialize();
479+
this.initialize().catch(err => {
480+
throw err;
481+
});
480482
this._log.info('setIamPolicy request %j', request);
481483
const wrappedCallback:
482484
| Callback<
@@ -593,7 +595,9 @@ export class ContainerAnalysisV1Beta1Client {
593595
this._gaxModule.routingHeader.fromParams({
594596
resource: request.resource ?? '',
595597
});
596-
this.initialize();
598+
this.initialize().catch(err => {
599+
throw err;
600+
});
597601
this._log.info('getIamPolicy request %j', request);
598602
const wrappedCallback:
599603
| Callback<
@@ -711,7 +715,9 @@ export class ContainerAnalysisV1Beta1Client {
711715
this._gaxModule.routingHeader.fromParams({
712716
resource: request.resource ?? '',
713717
});
714-
this.initialize();
718+
this.initialize().catch(err => {
719+
throw err;
720+
});
715721
this._log.info('testIamPermissions request %j', request);
716722
const wrappedCallback:
717723
| Callback<
@@ -832,7 +838,9 @@ export class ContainerAnalysisV1Beta1Client {
832838
this._gaxModule.routingHeader.fromParams({
833839
name: request.name ?? '',
834840
});
835-
this.initialize();
841+
this.initialize().catch(err => {
842+
throw err;
843+
});
836844
this._log.info('generatePackagesSummary request %j', request);
837845
const wrappedCallback:
838846
| Callback<
@@ -958,7 +966,9 @@ export class ContainerAnalysisV1Beta1Client {
958966
this._gaxModule.routingHeader.fromParams({
959967
name: request.name ?? '',
960968
});
961-
this.initialize();
969+
this.initialize().catch(err => {
970+
throw err;
971+
});
962972
this._log.info('exportSBOM request %j', request);
963973
const wrappedCallback:
964974
| Callback<

packages/google-devtools-containeranalysis/src/v1beta1/grafeas_v1_beta1_client.ts

Lines changed: 63 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,9 @@ export class GrafeasV1Beta1Client {
490490
this._gaxModule.routingHeader.fromParams({
491491
name: request.name ?? '',
492492
});
493-
this.initialize();
493+
this.initialize().catch(err => {
494+
throw err;
495+
});
494496
this._log.info('getOccurrence request %j', request);
495497
const wrappedCallback:
496498
| Callback<
@@ -599,7 +601,9 @@ export class GrafeasV1Beta1Client {
599601
this._gaxModule.routingHeader.fromParams({
600602
name: request.name ?? '',
601603
});
602-
this.initialize();
604+
this.initialize().catch(err => {
605+
throw err;
606+
});
603607
this._log.info('deleteOccurrence request %j', request);
604608
const wrappedCallback:
605609
| Callback<
@@ -708,7 +712,9 @@ export class GrafeasV1Beta1Client {
708712
this._gaxModule.routingHeader.fromParams({
709713
parent: request.parent ?? '',
710714
});
711-
this.initialize();
715+
this.initialize().catch(err => {
716+
throw err;
717+
});
712718
this._log.info('createOccurrence request %j', request);
713719
const wrappedCallback:
714720
| Callback<
@@ -819,7 +825,9 @@ export class GrafeasV1Beta1Client {
819825
this._gaxModule.routingHeader.fromParams({
820826
parent: request.parent ?? '',
821827
});
822-
this.initialize();
828+
this.initialize().catch(err => {
829+
throw err;
830+
});
823831
this._log.info('batchCreateOccurrences request %j', request);
824832
const wrappedCallback:
825833
| Callback<
@@ -932,7 +940,9 @@ export class GrafeasV1Beta1Client {
932940
this._gaxModule.routingHeader.fromParams({
933941
name: request.name ?? '',
934942
});
935-
this.initialize();
943+
this.initialize().catch(err => {
944+
throw err;
945+
});
936946
this._log.info('updateOccurrence request %j', request);
937947
const wrappedCallback:
938948
| Callback<
@@ -1040,7 +1050,9 @@ export class GrafeasV1Beta1Client {
10401050
this._gaxModule.routingHeader.fromParams({
10411051
name: request.name ?? '',
10421052
});
1043-
this.initialize();
1053+
this.initialize().catch(err => {
1054+
throw err;
1055+
});
10441056
this._log.info('getOccurrenceNote request %j', request);
10451057
const wrappedCallback:
10461058
| Callback<
@@ -1147,7 +1159,9 @@ export class GrafeasV1Beta1Client {
11471159
this._gaxModule.routingHeader.fromParams({
11481160
name: request.name ?? '',
11491161
});
1150-
this.initialize();
1162+
this.initialize().catch(err => {
1163+
throw err;
1164+
});
11511165
this._log.info('getNote request %j', request);
11521166
const wrappedCallback:
11531167
| Callback<
@@ -1254,7 +1268,9 @@ export class GrafeasV1Beta1Client {
12541268
this._gaxModule.routingHeader.fromParams({
12551269
name: request.name ?? '',
12561270
});
1257-
this.initialize();
1271+
this.initialize().catch(err => {
1272+
throw err;
1273+
});
12581274
this._log.info('deleteNote request %j', request);
12591275
const wrappedCallback:
12601276
| Callback<
@@ -1365,7 +1381,9 @@ export class GrafeasV1Beta1Client {
13651381
this._gaxModule.routingHeader.fromParams({
13661382
parent: request.parent ?? '',
13671383
});
1368-
this.initialize();
1384+
this.initialize().catch(err => {
1385+
throw err;
1386+
});
13691387
this._log.info('createNote request %j', request);
13701388
const wrappedCallback:
13711389
| Callback<
@@ -1474,7 +1492,9 @@ export class GrafeasV1Beta1Client {
14741492
this._gaxModule.routingHeader.fromParams({
14751493
parent: request.parent ?? '',
14761494
});
1477-
this.initialize();
1495+
this.initialize().catch(err => {
1496+
throw err;
1497+
});
14781498
this._log.info('batchCreateNotes request %j', request);
14791499
const wrappedCallback:
14801500
| Callback<
@@ -1585,7 +1605,9 @@ export class GrafeasV1Beta1Client {
15851605
this._gaxModule.routingHeader.fromParams({
15861606
name: request.name ?? '',
15871607
});
1588-
this.initialize();
1608+
this.initialize().catch(err => {
1609+
throw err;
1610+
});
15891611
this._log.info('updateNote request %j', request);
15901612
const wrappedCallback:
15911613
| Callback<
@@ -1708,7 +1730,9 @@ export class GrafeasV1Beta1Client {
17081730
this._gaxModule.routingHeader.fromParams({
17091731
parent: request.parent ?? '',
17101732
});
1711-
this.initialize();
1733+
this.initialize().catch(err => {
1734+
throw err;
1735+
});
17121736
this._log.info('getVulnerabilityOccurrencesSummary request %j', request);
17131737
const wrappedCallback:
17141738
| Callback<
@@ -1836,7 +1860,9 @@ export class GrafeasV1Beta1Client {
18361860
this._gaxModule.routingHeader.fromParams({
18371861
parent: request.parent ?? '',
18381862
});
1839-
this.initialize();
1863+
this.initialize().catch(err => {
1864+
throw err;
1865+
});
18401866
const wrappedCallback:
18411867
| PaginationCallback<
18421868
protos.grafeas.v1beta1.IListOccurrencesRequest,
@@ -1902,7 +1928,9 @@ export class GrafeasV1Beta1Client {
19021928
});
19031929
const defaultCallSettings = this._defaults['listOccurrences'];
19041930
const callSettings = defaultCallSettings.merge(options);
1905-
this.initialize();
1931+
this.initialize().catch(err => {
1932+
throw err;
1933+
});
19061934
this._log.info('listOccurrences stream %j', request);
19071935
return this.descriptors.page.listOccurrences.createStream(
19081936
this.innerApiCalls.listOccurrences as GaxCall,
@@ -1952,7 +1980,9 @@ export class GrafeasV1Beta1Client {
19521980
});
19531981
const defaultCallSettings = this._defaults['listOccurrences'];
19541982
const callSettings = defaultCallSettings.merge(options);
1955-
this.initialize();
1983+
this.initialize().catch(err => {
1984+
throw err;
1985+
});
19561986
this._log.info('listOccurrences iterate %j', request);
19571987
return this.descriptors.page.listOccurrences.asyncIterate(
19581988
this.innerApiCalls['listOccurrences'] as GaxCall,
@@ -2049,7 +2079,9 @@ export class GrafeasV1Beta1Client {
20492079
this._gaxModule.routingHeader.fromParams({
20502080
parent: request.parent ?? '',
20512081
});
2052-
this.initialize();
2082+
this.initialize().catch(err => {
2083+
throw err;
2084+
});
20532085
const wrappedCallback:
20542086
| PaginationCallback<
20552087
protos.grafeas.v1beta1.IListNotesRequest,
@@ -2115,7 +2147,9 @@ export class GrafeasV1Beta1Client {
21152147
});
21162148
const defaultCallSettings = this._defaults['listNotes'];
21172149
const callSettings = defaultCallSettings.merge(options);
2118-
this.initialize();
2150+
this.initialize().catch(err => {
2151+
throw err;
2152+
});
21192153
this._log.info('listNotes stream %j', request);
21202154
return this.descriptors.page.listNotes.createStream(
21212155
this.innerApiCalls.listNotes as GaxCall,
@@ -2165,7 +2199,9 @@ export class GrafeasV1Beta1Client {
21652199
});
21662200
const defaultCallSettings = this._defaults['listNotes'];
21672201
const callSettings = defaultCallSettings.merge(options);
2168-
this.initialize();
2202+
this.initialize().catch(err => {
2203+
throw err;
2204+
});
21692205
this._log.info('listNotes iterate %j', request);
21702206
return this.descriptors.page.listNotes.asyncIterate(
21712207
this.innerApiCalls['listNotes'] as GaxCall,
@@ -2266,7 +2302,9 @@ export class GrafeasV1Beta1Client {
22662302
this._gaxModule.routingHeader.fromParams({
22672303
name: request.name ?? '',
22682304
});
2269-
this.initialize();
2305+
this.initialize().catch(err => {
2306+
throw err;
2307+
});
22702308
const wrappedCallback:
22712309
| PaginationCallback<
22722310
protos.grafeas.v1beta1.IListNoteOccurrencesRequest,
@@ -2334,7 +2372,9 @@ export class GrafeasV1Beta1Client {
23342372
});
23352373
const defaultCallSettings = this._defaults['listNoteOccurrences'];
23362374
const callSettings = defaultCallSettings.merge(options);
2337-
this.initialize();
2375+
this.initialize().catch(err => {
2376+
throw err;
2377+
});
23382378
this._log.info('listNoteOccurrences stream %j', request);
23392379
return this.descriptors.page.listNoteOccurrences.createStream(
23402380
this.innerApiCalls.listNoteOccurrences as GaxCall,
@@ -2384,7 +2424,9 @@ export class GrafeasV1Beta1Client {
23842424
});
23852425
const defaultCallSettings = this._defaults['listNoteOccurrences'];
23862426
const callSettings = defaultCallSettings.merge(options);
2387-
this.initialize();
2427+
this.initialize().catch(err => {
2428+
throw err;
2429+
});
23882430
this._log.info('listNoteOccurrences iterate %j', request);
23892431
return this.descriptors.page.listNoteOccurrences.asyncIterate(
23902432
this.innerApiCalls['listNoteOccurrences'] as GaxCall,

0 commit comments

Comments
 (0)