Skip to content

Commit f1ae513

Browse files
fix: preserve default values in x-goog-request-params header (#1711)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: googleapis/googleapis@d5d35e0 Source-Link: googleapis/googleapis-gen@efcd3f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
1 parent 12eab9d commit f1ae513

6 files changed

+2312
-2231
lines changed

src/v1/database_admin_client.ts

+29-29
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ export class DatabaseAdminClient {
595595
options.otherArgs.headers = options.otherArgs.headers || {};
596596
options.otherArgs.headers['x-goog-request-params'] =
597597
this._gaxModule.routingHeader.fromParams({
598-
name: request.name || '',
598+
name: request.name ?? '',
599599
});
600600
this.initialize();
601601
return this.innerApiCalls.getDatabase(request, options, callback);
@@ -690,7 +690,7 @@ export class DatabaseAdminClient {
690690
options.otherArgs.headers = options.otherArgs.headers || {};
691691
options.otherArgs.headers['x-goog-request-params'] =
692692
this._gaxModule.routingHeader.fromParams({
693-
database: request.database || '',
693+
database: request.database ?? '',
694694
});
695695
this.initialize();
696696
return this.innerApiCalls.dropDatabase(request, options, callback);
@@ -791,7 +791,7 @@ export class DatabaseAdminClient {
791791
options.otherArgs.headers = options.otherArgs.headers || {};
792792
options.otherArgs.headers['x-goog-request-params'] =
793793
this._gaxModule.routingHeader.fromParams({
794-
database: request.database || '',
794+
database: request.database ?? '',
795795
});
796796
this.initialize();
797797
return this.innerApiCalls.getDatabaseDdl(request, options, callback);
@@ -892,7 +892,7 @@ export class DatabaseAdminClient {
892892
options.otherArgs.headers = options.otherArgs.headers || {};
893893
options.otherArgs.headers['x-goog-request-params'] =
894894
this._gaxModule.routingHeader.fromParams({
895-
resource: request.resource || '',
895+
resource: request.resource ?? '',
896896
});
897897
this.initialize();
898898
return this.innerApiCalls.setIamPolicy(request, options, callback);
@@ -986,7 +986,7 @@ export class DatabaseAdminClient {
986986
options.otherArgs.headers = options.otherArgs.headers || {};
987987
options.otherArgs.headers['x-goog-request-params'] =
988988
this._gaxModule.routingHeader.fromParams({
989-
resource: request.resource || '',
989+
resource: request.resource ?? '',
990990
});
991991
this.initialize();
992992
return this.innerApiCalls.getIamPolicy(request, options, callback);
@@ -1084,7 +1084,7 @@ export class DatabaseAdminClient {
10841084
options.otherArgs.headers = options.otherArgs.headers || {};
10851085
options.otherArgs.headers['x-goog-request-params'] =
10861086
this._gaxModule.routingHeader.fromParams({
1087-
resource: request.resource || '',
1087+
resource: request.resource ?? '',
10881088
});
10891089
this.initialize();
10901090
return this.innerApiCalls.testIamPermissions(request, options, callback);
@@ -1177,7 +1177,7 @@ export class DatabaseAdminClient {
11771177
options.otherArgs.headers = options.otherArgs.headers || {};
11781178
options.otherArgs.headers['x-goog-request-params'] =
11791179
this._gaxModule.routingHeader.fromParams({
1180-
name: request.name || '',
1180+
name: request.name ?? '',
11811181
});
11821182
this.initialize();
11831183
return this.innerApiCalls.getBackup(request, options, callback);
@@ -1277,7 +1277,7 @@ export class DatabaseAdminClient {
12771277
options.otherArgs.headers = options.otherArgs.headers || {};
12781278
options.otherArgs.headers['x-goog-request-params'] =
12791279
this._gaxModule.routingHeader.fromParams({
1280-
'backup.name': request.backup!.name || '',
1280+
'backup.name': request.backup!.name ?? '',
12811281
});
12821282
this.initialize();
12831283
return this.innerApiCalls.updateBackup(request, options, callback);
@@ -1370,7 +1370,7 @@ export class DatabaseAdminClient {
13701370
options.otherArgs.headers = options.otherArgs.headers || {};
13711371
options.otherArgs.headers['x-goog-request-params'] =
13721372
this._gaxModule.routingHeader.fromParams({
1373-
name: request.name || '',
1373+
name: request.name ?? '',
13741374
});
13751375
this.initialize();
13761376
return this.innerApiCalls.deleteBackup(request, options, callback);
@@ -1499,7 +1499,7 @@ export class DatabaseAdminClient {
14991499
options.otherArgs.headers = options.otherArgs.headers || {};
15001500
options.otherArgs.headers['x-goog-request-params'] =
15011501
this._gaxModule.routingHeader.fromParams({
1502-
parent: request.parent || '',
1502+
parent: request.parent ?? '',
15031503
});
15041504
this.initialize();
15051505
return this.innerApiCalls.createDatabase(request, options, callback);
@@ -1665,7 +1665,7 @@ export class DatabaseAdminClient {
16651665
options.otherArgs.headers = options.otherArgs.headers || {};
16661666
options.otherArgs.headers['x-goog-request-params'] =
16671667
this._gaxModule.routingHeader.fromParams({
1668-
database: request.database || '',
1668+
database: request.database ?? '',
16691669
});
16701670
this.initialize();
16711671
return this.innerApiCalls.updateDatabaseDdl(request, options, callback);
@@ -1831,7 +1831,7 @@ export class DatabaseAdminClient {
18311831
options.otherArgs.headers = options.otherArgs.headers || {};
18321832
options.otherArgs.headers['x-goog-request-params'] =
18331833
this._gaxModule.routingHeader.fromParams({
1834-
parent: request.parent || '',
1834+
parent: request.parent ?? '',
18351835
});
18361836
this.initialize();
18371837
return this.innerApiCalls.createBackup(request, options, callback);
@@ -2004,7 +2004,7 @@ export class DatabaseAdminClient {
20042004
options.otherArgs.headers = options.otherArgs.headers || {};
20052005
options.otherArgs.headers['x-goog-request-params'] =
20062006
this._gaxModule.routingHeader.fromParams({
2007-
parent: request.parent || '',
2007+
parent: request.parent ?? '',
20082008
});
20092009
this.initialize();
20102010
return this.innerApiCalls.copyBackup(request, options, callback);
@@ -2177,7 +2177,7 @@ export class DatabaseAdminClient {
21772177
options.otherArgs.headers = options.otherArgs.headers || {};
21782178
options.otherArgs.headers['x-goog-request-params'] =
21792179
this._gaxModule.routingHeader.fromParams({
2180-
parent: request.parent || '',
2180+
parent: request.parent ?? '',
21812181
});
21822182
this.initialize();
21832183
return this.innerApiCalls.restoreDatabase(request, options, callback);
@@ -2314,7 +2314,7 @@ export class DatabaseAdminClient {
23142314
options.otherArgs.headers = options.otherArgs.headers || {};
23152315
options.otherArgs.headers['x-goog-request-params'] =
23162316
this._gaxModule.routingHeader.fromParams({
2317-
parent: request.parent || '',
2317+
parent: request.parent ?? '',
23182318
});
23192319
this.initialize();
23202320
return this.innerApiCalls.listDatabases(request, options, callback);
@@ -2356,7 +2356,7 @@ export class DatabaseAdminClient {
23562356
options.otherArgs.headers = options.otherArgs.headers || {};
23572357
options.otherArgs.headers['x-goog-request-params'] =
23582358
this._gaxModule.routingHeader.fromParams({
2359-
parent: request.parent || '',
2359+
parent: request.parent ?? '',
23602360
});
23612361
const defaultCallSettings = this._defaults['listDatabases'];
23622362
const callSettings = defaultCallSettings.merge(options);
@@ -2407,7 +2407,7 @@ export class DatabaseAdminClient {
24072407
options.otherArgs.headers = options.otherArgs.headers || {};
24082408
options.otherArgs.headers['x-goog-request-params'] =
24092409
this._gaxModule.routingHeader.fromParams({
2410-
parent: request.parent || '',
2410+
parent: request.parent ?? '',
24112411
});
24122412
const defaultCallSettings = this._defaults['listDatabases'];
24132413
const callSettings = defaultCallSettings.merge(options);
@@ -2554,7 +2554,7 @@ export class DatabaseAdminClient {
25542554
options.otherArgs.headers = options.otherArgs.headers || {};
25552555
options.otherArgs.headers['x-goog-request-params'] =
25562556
this._gaxModule.routingHeader.fromParams({
2557-
parent: request.parent || '',
2557+
parent: request.parent ?? '',
25582558
});
25592559
this.initialize();
25602560
return this.innerApiCalls.listBackups(request, options, callback);
@@ -2633,7 +2633,7 @@ export class DatabaseAdminClient {
26332633
options.otherArgs.headers = options.otherArgs.headers || {};
26342634
options.otherArgs.headers['x-goog-request-params'] =
26352635
this._gaxModule.routingHeader.fromParams({
2636-
parent: request.parent || '',
2636+
parent: request.parent ?? '',
26372637
});
26382638
const defaultCallSettings = this._defaults['listBackups'];
26392639
const callSettings = defaultCallSettings.merge(options);
@@ -2721,7 +2721,7 @@ export class DatabaseAdminClient {
27212721
options.otherArgs.headers = options.otherArgs.headers || {};
27222722
options.otherArgs.headers['x-goog-request-params'] =
27232723
this._gaxModule.routingHeader.fromParams({
2724-
parent: request.parent || '',
2724+
parent: request.parent ?? '',
27252725
});
27262726
const defaultCallSettings = this._defaults['listBackups'];
27272727
const callSettings = defaultCallSettings.merge(options);
@@ -2880,7 +2880,7 @@ export class DatabaseAdminClient {
28802880
options.otherArgs.headers = options.otherArgs.headers || {};
28812881
options.otherArgs.headers['x-goog-request-params'] =
28822882
this._gaxModule.routingHeader.fromParams({
2883-
parent: request.parent || '',
2883+
parent: request.parent ?? '',
28842884
});
28852885
this.initialize();
28862886
return this.innerApiCalls.listDatabaseOperations(
@@ -2970,7 +2970,7 @@ export class DatabaseAdminClient {
29702970
options.otherArgs.headers = options.otherArgs.headers || {};
29712971
options.otherArgs.headers['x-goog-request-params'] =
29722972
this._gaxModule.routingHeader.fromParams({
2973-
parent: request.parent || '',
2973+
parent: request.parent ?? '',
29742974
});
29752975
const defaultCallSettings = this._defaults['listDatabaseOperations'];
29762976
const callSettings = defaultCallSettings.merge(options);
@@ -3065,7 +3065,7 @@ export class DatabaseAdminClient {
30653065
options.otherArgs.headers = options.otherArgs.headers || {};
30663066
options.otherArgs.headers['x-goog-request-params'] =
30673067
this._gaxModule.routingHeader.fromParams({
3068-
parent: request.parent || '',
3068+
parent: request.parent ?? '',
30693069
});
30703070
const defaultCallSettings = this._defaults['listDatabaseOperations'];
30713071
const callSettings = defaultCallSettings.merge(options);
@@ -3250,7 +3250,7 @@ export class DatabaseAdminClient {
32503250
options.otherArgs.headers = options.otherArgs.headers || {};
32513251
options.otherArgs.headers['x-goog-request-params'] =
32523252
this._gaxModule.routingHeader.fromParams({
3253-
parent: request.parent || '',
3253+
parent: request.parent ?? '',
32543254
});
32553255
this.initialize();
32563256
return this.innerApiCalls.listBackupOperations(request, options, callback);
@@ -3360,7 +3360,7 @@ export class DatabaseAdminClient {
33603360
options.otherArgs.headers = options.otherArgs.headers || {};
33613361
options.otherArgs.headers['x-goog-request-params'] =
33623362
this._gaxModule.routingHeader.fromParams({
3363-
parent: request.parent || '',
3363+
parent: request.parent ?? '',
33643364
});
33653365
const defaultCallSettings = this._defaults['listBackupOperations'];
33663366
const callSettings = defaultCallSettings.merge(options);
@@ -3479,7 +3479,7 @@ export class DatabaseAdminClient {
34793479
options.otherArgs.headers = options.otherArgs.headers || {};
34803480
options.otherArgs.headers['x-goog-request-params'] =
34813481
this._gaxModule.routingHeader.fromParams({
3482-
parent: request.parent || '',
3482+
parent: request.parent ?? '',
34833483
});
34843484
const defaultCallSettings = this._defaults['listBackupOperations'];
34853485
const callSettings = defaultCallSettings.merge(options);
@@ -3588,7 +3588,7 @@ export class DatabaseAdminClient {
35883588
options.otherArgs.headers = options.otherArgs.headers || {};
35893589
options.otherArgs.headers['x-goog-request-params'] =
35903590
this._gaxModule.routingHeader.fromParams({
3591-
parent: request.parent || '',
3591+
parent: request.parent ?? '',
35923592
});
35933593
this.initialize();
35943594
return this.innerApiCalls.listDatabaseRoles(request, options, callback);
@@ -3631,7 +3631,7 @@ export class DatabaseAdminClient {
36313631
options.otherArgs.headers = options.otherArgs.headers || {};
36323632
options.otherArgs.headers['x-goog-request-params'] =
36333633
this._gaxModule.routingHeader.fromParams({
3634-
parent: request.parent || '',
3634+
parent: request.parent ?? '',
36353635
});
36363636
const defaultCallSettings = this._defaults['listDatabaseRoles'];
36373637
const callSettings = defaultCallSettings.merge(options);
@@ -3683,7 +3683,7 @@ export class DatabaseAdminClient {
36833683
options.otherArgs.headers = options.otherArgs.headers || {};
36843684
options.otherArgs.headers['x-goog-request-params'] =
36853685
this._gaxModule.routingHeader.fromParams({
3686-
parent: request.parent || '',
3686+
parent: request.parent ?? '',
36873687
});
36883688
const defaultCallSettings = this._defaults['listDatabaseRoles'];
36893689
const callSettings = defaultCallSettings.merge(options);

src/v1/instance_admin_client.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export class InstanceAdminClient {
537537
options.otherArgs.headers = options.otherArgs.headers || {};
538538
options.otherArgs.headers['x-goog-request-params'] =
539539
this._gaxModule.routingHeader.fromParams({
540-
name: request.name || '',
540+
name: request.name ?? '',
541541
});
542542
this.initialize();
543543
return this.innerApiCalls.getInstanceConfig(request, options, callback);
@@ -633,7 +633,7 @@ export class InstanceAdminClient {
633633
options.otherArgs.headers = options.otherArgs.headers || {};
634634
options.otherArgs.headers['x-goog-request-params'] =
635635
this._gaxModule.routingHeader.fromParams({
636-
name: request.name || '',
636+
name: request.name ?? '',
637637
});
638638
this.initialize();
639639
return this.innerApiCalls.getInstance(request, options, callback);
@@ -741,7 +741,7 @@ export class InstanceAdminClient {
741741
options.otherArgs.headers = options.otherArgs.headers || {};
742742
options.otherArgs.headers['x-goog-request-params'] =
743743
this._gaxModule.routingHeader.fromParams({
744-
name: request.name || '',
744+
name: request.name ?? '',
745745
});
746746
this.initialize();
747747
return this.innerApiCalls.deleteInstance(request, options, callback);
@@ -840,7 +840,7 @@ export class InstanceAdminClient {
840840
options.otherArgs.headers = options.otherArgs.headers || {};
841841
options.otherArgs.headers['x-goog-request-params'] =
842842
this._gaxModule.routingHeader.fromParams({
843-
resource: request.resource || '',
843+
resource: request.resource ?? '',
844844
});
845845
this.initialize();
846846
return this.innerApiCalls.setIamPolicy(request, options, callback);
@@ -931,7 +931,7 @@ export class InstanceAdminClient {
931931
options.otherArgs.headers = options.otherArgs.headers || {};
932932
options.otherArgs.headers['x-goog-request-params'] =
933933
this._gaxModule.routingHeader.fromParams({
934-
resource: request.resource || '',
934+
resource: request.resource ?? '',
935935
});
936936
this.initialize();
937937
return this.innerApiCalls.getIamPolicy(request, options, callback);
@@ -1025,7 +1025,7 @@ export class InstanceAdminClient {
10251025
options.otherArgs.headers = options.otherArgs.headers || {};
10261026
options.otherArgs.headers['x-goog-request-params'] =
10271027
this._gaxModule.routingHeader.fromParams({
1028-
resource: request.resource || '',
1028+
resource: request.resource ?? '',
10291029
});
10301030
this.initialize();
10311031
return this.innerApiCalls.testIamPermissions(request, options, callback);
@@ -1170,7 +1170,7 @@ export class InstanceAdminClient {
11701170
options.otherArgs.headers = options.otherArgs.headers || {};
11711171
options.otherArgs.headers['x-goog-request-params'] =
11721172
this._gaxModule.routingHeader.fromParams({
1173-
parent: request.parent || '',
1173+
parent: request.parent ?? '',
11741174
});
11751175
this.initialize();
11761176
return this.innerApiCalls.createInstance(request, options, callback);
@@ -1353,7 +1353,7 @@ export class InstanceAdminClient {
13531353
options.otherArgs.headers = options.otherArgs.headers || {};
13541354
options.otherArgs.headers['x-goog-request-params'] =
13551355
this._gaxModule.routingHeader.fromParams({
1356-
'instance.name': request.instance!.name || '',
1356+
'instance.name': request.instance!.name ?? '',
13571357
});
13581358
this.initialize();
13591359
return this.innerApiCalls.updateInstance(request, options, callback);
@@ -1491,7 +1491,7 @@ export class InstanceAdminClient {
14911491
options.otherArgs.headers = options.otherArgs.headers || {};
14921492
options.otherArgs.headers['x-goog-request-params'] =
14931493
this._gaxModule.routingHeader.fromParams({
1494-
parent: request.parent || '',
1494+
parent: request.parent ?? '',
14951495
});
14961496
this.initialize();
14971497
return this.innerApiCalls.listInstanceConfigs(request, options, callback);
@@ -1534,7 +1534,7 @@ export class InstanceAdminClient {
15341534
options.otherArgs.headers = options.otherArgs.headers || {};
15351535
options.otherArgs.headers['x-goog-request-params'] =
15361536
this._gaxModule.routingHeader.fromParams({
1537-
parent: request.parent || '',
1537+
parent: request.parent ?? '',
15381538
});
15391539
const defaultCallSettings = this._defaults['listInstanceConfigs'];
15401540
const callSettings = defaultCallSettings.merge(options);
@@ -1586,7 +1586,7 @@ export class InstanceAdminClient {
15861586
options.otherArgs.headers = options.otherArgs.headers || {};
15871587
options.otherArgs.headers['x-goog-request-params'] =
15881588
this._gaxModule.routingHeader.fromParams({
1589-
parent: request.parent || '',
1589+
parent: request.parent ?? '',
15901590
});
15911591
const defaultCallSettings = this._defaults['listInstanceConfigs'];
15921592
const callSettings = defaultCallSettings.merge(options);
@@ -1714,7 +1714,7 @@ export class InstanceAdminClient {
17141714
options.otherArgs.headers = options.otherArgs.headers || {};
17151715
options.otherArgs.headers['x-goog-request-params'] =
17161716
this._gaxModule.routingHeader.fromParams({
1717-
parent: request.parent || '',
1717+
parent: request.parent ?? '',
17181718
});
17191719
this.initialize();
17201720
return this.innerApiCalls.listInstances(request, options, callback);
@@ -1776,7 +1776,7 @@ export class InstanceAdminClient {
17761776
options.otherArgs.headers = options.otherArgs.headers || {};
17771777
options.otherArgs.headers['x-goog-request-params'] =
17781778
this._gaxModule.routingHeader.fromParams({
1779-
parent: request.parent || '',
1779+
parent: request.parent ?? '',
17801780
});
17811781
const defaultCallSettings = this._defaults['listInstances'];
17821782
const callSettings = defaultCallSettings.merge(options);
@@ -1847,7 +1847,7 @@ export class InstanceAdminClient {
18471847
options.otherArgs.headers = options.otherArgs.headers || {};
18481848
options.otherArgs.headers['x-goog-request-params'] =
18491849
this._gaxModule.routingHeader.fromParams({
1850-
parent: request.parent || '',
1850+
parent: request.parent ?? '',
18511851
});
18521852
const defaultCallSettings = this._defaults['listInstances'];
18531853
const callSettings = defaultCallSettings.merge(options);

0 commit comments

Comments
 (0)