Skip to content

Commit 76c0ab5

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

File tree

6 files changed

+1609
-1504
lines changed

6 files changed

+1609
-1504
lines changed

src/v1/publisher_client.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export class PublisherClient {
490490
options.otherArgs.headers = options.otherArgs.headers || {};
491491
options.otherArgs.headers['x-goog-request-params'] =
492492
this._gaxModule.routingHeader.fromParams({
493-
name: request.name || '',
493+
name: request.name ?? '',
494494
});
495495
this.initialize();
496496
return this.innerApiCalls.createTopic(request, options, callback);
@@ -578,7 +578,7 @@ export class PublisherClient {
578578
options.otherArgs.headers = options.otherArgs.headers || {};
579579
options.otherArgs.headers['x-goog-request-params'] =
580580
this._gaxModule.routingHeader.fromParams({
581-
'topic.name': request.topic!.name || '',
581+
'topic.name': request.topic!.name ?? '',
582582
});
583583
this.initialize();
584584
return this.innerApiCalls.updateTopic(request, options, callback);
@@ -663,7 +663,7 @@ export class PublisherClient {
663663
options.otherArgs.headers = options.otherArgs.headers || {};
664664
options.otherArgs.headers['x-goog-request-params'] =
665665
this._gaxModule.routingHeader.fromParams({
666-
topic: request.topic || '',
666+
topic: request.topic ?? '',
667667
});
668668
this.initialize();
669669
return this.innerApiCalls.publish(request, options, callback);
@@ -745,7 +745,7 @@ export class PublisherClient {
745745
options.otherArgs.headers = options.otherArgs.headers || {};
746746
options.otherArgs.headers['x-goog-request-params'] =
747747
this._gaxModule.routingHeader.fromParams({
748-
topic: request.topic || '',
748+
topic: request.topic ?? '',
749749
});
750750
this.initialize();
751751
return this.innerApiCalls.getTopic(request, options, callback);
@@ -831,7 +831,7 @@ export class PublisherClient {
831831
options.otherArgs.headers = options.otherArgs.headers || {};
832832
options.otherArgs.headers['x-goog-request-params'] =
833833
this._gaxModule.routingHeader.fromParams({
834-
topic: request.topic || '',
834+
topic: request.topic ?? '',
835835
});
836836
this.initialize();
837837
return this.innerApiCalls.deleteTopic(request, options, callback);
@@ -916,7 +916,7 @@ export class PublisherClient {
916916
options.otherArgs.headers = options.otherArgs.headers || {};
917917
options.otherArgs.headers['x-goog-request-params'] =
918918
this._gaxModule.routingHeader.fromParams({
919-
subscription: request.subscription || '',
919+
subscription: request.subscription ?? '',
920920
});
921921
this.initialize();
922922
return this.innerApiCalls.detachSubscription(request, options, callback);
@@ -1010,7 +1010,7 @@ export class PublisherClient {
10101010
options.otherArgs.headers = options.otherArgs.headers || {};
10111011
options.otherArgs.headers['x-goog-request-params'] =
10121012
this._gaxModule.routingHeader.fromParams({
1013-
project: request.project || '',
1013+
project: request.project ?? '',
10141014
});
10151015
this.initialize();
10161016
return this.innerApiCalls.listTopics(request, options, callback);
@@ -1051,7 +1051,7 @@ export class PublisherClient {
10511051
options.otherArgs.headers = options.otherArgs.headers || {};
10521052
options.otherArgs.headers['x-goog-request-params'] =
10531053
this._gaxModule.routingHeader.fromParams({
1054-
project: request.project || '',
1054+
project: request.project ?? '',
10551055
});
10561056
const defaultCallSettings = this._defaults['listTopics'];
10571057
const callSettings = defaultCallSettings.merge(options);
@@ -1099,7 +1099,7 @@ export class PublisherClient {
10991099
options.otherArgs.headers = options.otherArgs.headers || {};
11001100
options.otherArgs.headers['x-goog-request-params'] =
11011101
this._gaxModule.routingHeader.fromParams({
1102-
project: request.project || '',
1102+
project: request.project ?? '',
11031103
});
11041104
const defaultCallSettings = this._defaults['listTopics'];
11051105
const callSettings = defaultCallSettings.merge(options);
@@ -1206,7 +1206,7 @@ export class PublisherClient {
12061206
options.otherArgs.headers = options.otherArgs.headers || {};
12071207
options.otherArgs.headers['x-goog-request-params'] =
12081208
this._gaxModule.routingHeader.fromParams({
1209-
topic: request.topic || '',
1209+
topic: request.topic ?? '',
12101210
});
12111211
this.initialize();
12121212
return this.innerApiCalls.listTopicSubscriptions(
@@ -1251,7 +1251,7 @@ export class PublisherClient {
12511251
options.otherArgs.headers = options.otherArgs.headers || {};
12521252
options.otherArgs.headers['x-goog-request-params'] =
12531253
this._gaxModule.routingHeader.fromParams({
1254-
topic: request.topic || '',
1254+
topic: request.topic ?? '',
12551255
});
12561256
const defaultCallSettings = this._defaults['listTopicSubscriptions'];
12571257
const callSettings = defaultCallSettings.merge(options);
@@ -1299,7 +1299,7 @@ export class PublisherClient {
12991299
options.otherArgs.headers = options.otherArgs.headers || {};
13001300
options.otherArgs.headers['x-goog-request-params'] =
13011301
this._gaxModule.routingHeader.fromParams({
1302-
topic: request.topic || '',
1302+
topic: request.topic ?? '',
13031303
});
13041304
const defaultCallSettings = this._defaults['listTopicSubscriptions'];
13051305
const callSettings = defaultCallSettings.merge(options);
@@ -1404,7 +1404,7 @@ export class PublisherClient {
14041404
options.otherArgs.headers = options.otherArgs.headers || {};
14051405
options.otherArgs.headers['x-goog-request-params'] =
14061406
this._gaxModule.routingHeader.fromParams({
1407-
topic: request.topic || '',
1407+
topic: request.topic ?? '',
14081408
});
14091409
this.initialize();
14101410
return this.innerApiCalls.listTopicSnapshots(request, options, callback);
@@ -1445,7 +1445,7 @@ export class PublisherClient {
14451445
options.otherArgs.headers = options.otherArgs.headers || {};
14461446
options.otherArgs.headers['x-goog-request-params'] =
14471447
this._gaxModule.routingHeader.fromParams({
1448-
topic: request.topic || '',
1448+
topic: request.topic ?? '',
14491449
});
14501450
const defaultCallSettings = this._defaults['listTopicSnapshots'];
14511451
const callSettings = defaultCallSettings.merge(options);
@@ -1493,7 +1493,7 @@ export class PublisherClient {
14931493
options.otherArgs.headers = options.otherArgs.headers || {};
14941494
options.otherArgs.headers['x-goog-request-params'] =
14951495
this._gaxModule.routingHeader.fromParams({
1496-
topic: request.topic || '',
1496+
topic: request.topic ?? '',
14971497
});
14981498
const defaultCallSettings = this._defaults['listTopicSnapshots'];
14991499
const callSettings = defaultCallSettings.merge(options);

src/v1/schema_service_client.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class SchemaServiceClient {
438438
options.otherArgs.headers = options.otherArgs.headers || {};
439439
options.otherArgs.headers['x-goog-request-params'] =
440440
this._gaxModule.routingHeader.fromParams({
441-
parent: request.parent || '',
441+
parent: request.parent ?? '',
442442
});
443443
this.initialize();
444444
return this.innerApiCalls.createSchema(request, options, callback);
@@ -524,7 +524,7 @@ export class SchemaServiceClient {
524524
options.otherArgs.headers = options.otherArgs.headers || {};
525525
options.otherArgs.headers['x-goog-request-params'] =
526526
this._gaxModule.routingHeader.fromParams({
527-
name: request.name || '',
527+
name: request.name ?? '',
528528
});
529529
this.initialize();
530530
return this.innerApiCalls.getSchema(request, options, callback);
@@ -606,7 +606,7 @@ export class SchemaServiceClient {
606606
options.otherArgs.headers = options.otherArgs.headers || {};
607607
options.otherArgs.headers['x-goog-request-params'] =
608608
this._gaxModule.routingHeader.fromParams({
609-
name: request.name || '',
609+
name: request.name ?? '',
610610
});
611611
this.initialize();
612612
return this.innerApiCalls.deleteSchema(request, options, callback);
@@ -690,7 +690,7 @@ export class SchemaServiceClient {
690690
options.otherArgs.headers = options.otherArgs.headers || {};
691691
options.otherArgs.headers['x-goog-request-params'] =
692692
this._gaxModule.routingHeader.fromParams({
693-
parent: request.parent || '',
693+
parent: request.parent ?? '',
694694
});
695695
this.initialize();
696696
return this.innerApiCalls.validateSchema(request, options, callback);
@@ -782,7 +782,7 @@ export class SchemaServiceClient {
782782
options.otherArgs.headers = options.otherArgs.headers || {};
783783
options.otherArgs.headers['x-goog-request-params'] =
784784
this._gaxModule.routingHeader.fromParams({
785-
parent: request.parent || '',
785+
parent: request.parent ?? '',
786786
});
787787
this.initialize();
788788
return this.innerApiCalls.validateMessage(request, options, callback);
@@ -880,7 +880,7 @@ export class SchemaServiceClient {
880880
options.otherArgs.headers = options.otherArgs.headers || {};
881881
options.otherArgs.headers['x-goog-request-params'] =
882882
this._gaxModule.routingHeader.fromParams({
883-
parent: request.parent || '',
883+
parent: request.parent ?? '',
884884
});
885885
this.initialize();
886886
return this.innerApiCalls.listSchemas(request, options, callback);
@@ -925,7 +925,7 @@ export class SchemaServiceClient {
925925
options.otherArgs.headers = options.otherArgs.headers || {};
926926
options.otherArgs.headers['x-goog-request-params'] =
927927
this._gaxModule.routingHeader.fromParams({
928-
parent: request.parent || '',
928+
parent: request.parent ?? '',
929929
});
930930
const defaultCallSettings = this._defaults['listSchemas'];
931931
const callSettings = defaultCallSettings.merge(options);
@@ -977,7 +977,7 @@ export class SchemaServiceClient {
977977
options.otherArgs.headers = options.otherArgs.headers || {};
978978
options.otherArgs.headers['x-goog-request-params'] =
979979
this._gaxModule.routingHeader.fromParams({
980-
parent: request.parent || '',
980+
parent: request.parent ?? '',
981981
});
982982
const defaultCallSettings = this._defaults['listSchemas'];
983983
const callSettings = defaultCallSettings.merge(options);

src/v1/subscriber_client.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ export class SubscriberClient {
596596
options.otherArgs.headers = options.otherArgs.headers || {};
597597
options.otherArgs.headers['x-goog-request-params'] =
598598
this._gaxModule.routingHeader.fromParams({
599-
name: request.name || '',
599+
name: request.name ?? '',
600600
});
601601
this.initialize();
602602
return this.innerApiCalls.createSubscription(request, options, callback);
@@ -678,7 +678,7 @@ export class SubscriberClient {
678678
options.otherArgs.headers = options.otherArgs.headers || {};
679679
options.otherArgs.headers['x-goog-request-params'] =
680680
this._gaxModule.routingHeader.fromParams({
681-
subscription: request.subscription || '',
681+
subscription: request.subscription ?? '',
682682
});
683683
this.initialize();
684684
return this.innerApiCalls.getSubscription(request, options, callback);
@@ -763,7 +763,7 @@ export class SubscriberClient {
763763
options.otherArgs.headers = options.otherArgs.headers || {};
764764
options.otherArgs.headers['x-goog-request-params'] =
765765
this._gaxModule.routingHeader.fromParams({
766-
'subscription.name': request.subscription!.name || '',
766+
'subscription.name': request.subscription!.name ?? '',
767767
});
768768
this.initialize();
769769
return this.innerApiCalls.updateSubscription(request, options, callback);
@@ -849,7 +849,7 @@ export class SubscriberClient {
849849
options.otherArgs.headers = options.otherArgs.headers || {};
850850
options.otherArgs.headers['x-goog-request-params'] =
851851
this._gaxModule.routingHeader.fromParams({
852-
subscription: request.subscription || '',
852+
subscription: request.subscription ?? '',
853853
});
854854
this.initialize();
855855
return this.innerApiCalls.deleteSubscription(request, options, callback);
@@ -946,7 +946,7 @@ export class SubscriberClient {
946946
options.otherArgs.headers = options.otherArgs.headers || {};
947947
options.otherArgs.headers['x-goog-request-params'] =
948948
this._gaxModule.routingHeader.fromParams({
949-
subscription: request.subscription || '',
949+
subscription: request.subscription ?? '',
950950
});
951951
this.initialize();
952952
return this.innerApiCalls.modifyAckDeadline(request, options, callback);
@@ -1038,7 +1038,7 @@ export class SubscriberClient {
10381038
options.otherArgs.headers = options.otherArgs.headers || {};
10391039
options.otherArgs.headers['x-goog-request-params'] =
10401040
this._gaxModule.routingHeader.fromParams({
1041-
subscription: request.subscription || '',
1041+
subscription: request.subscription ?? '',
10421042
});
10431043
this.initialize();
10441044
return this.innerApiCalls.acknowledge(request, options, callback);
@@ -1134,7 +1134,7 @@ export class SubscriberClient {
11341134
options.otherArgs.headers = options.otherArgs.headers || {};
11351135
options.otherArgs.headers['x-goog-request-params'] =
11361136
this._gaxModule.routingHeader.fromParams({
1137-
subscription: request.subscription || '',
1137+
subscription: request.subscription ?? '',
11381138
});
11391139
this.initialize();
11401140
return this.innerApiCalls.pull(request, options, callback);
@@ -1228,7 +1228,7 @@ export class SubscriberClient {
12281228
options.otherArgs.headers = options.otherArgs.headers || {};
12291229
options.otherArgs.headers['x-goog-request-params'] =
12301230
this._gaxModule.routingHeader.fromParams({
1231-
subscription: request.subscription || '',
1231+
subscription: request.subscription ?? '',
12321232
});
12331233
this.initialize();
12341234
return this.innerApiCalls.modifyPushConfig(request, options, callback);
@@ -1314,7 +1314,7 @@ export class SubscriberClient {
13141314
options.otherArgs.headers = options.otherArgs.headers || {};
13151315
options.otherArgs.headers['x-goog-request-params'] =
13161316
this._gaxModule.routingHeader.fromParams({
1317-
snapshot: request.snapshot || '',
1317+
snapshot: request.snapshot ?? '',
13181318
});
13191319
this.initialize();
13201320
return this.innerApiCalls.getSnapshot(request, options, callback);
@@ -1428,7 +1428,7 @@ export class SubscriberClient {
14281428
options.otherArgs.headers = options.otherArgs.headers || {};
14291429
options.otherArgs.headers['x-goog-request-params'] =
14301430
this._gaxModule.routingHeader.fromParams({
1431-
name: request.name || '',
1431+
name: request.name ?? '',
14321432
});
14331433
this.initialize();
14341434
return this.innerApiCalls.createSnapshot(request, options, callback);
@@ -1517,7 +1517,7 @@ export class SubscriberClient {
15171517
options.otherArgs.headers = options.otherArgs.headers || {};
15181518
options.otherArgs.headers['x-goog-request-params'] =
15191519
this._gaxModule.routingHeader.fromParams({
1520-
'snapshot.name': request.snapshot!.name || '',
1520+
'snapshot.name': request.snapshot!.name ?? '',
15211521
});
15221522
this.initialize();
15231523
return this.innerApiCalls.updateSnapshot(request, options, callback);
@@ -1607,7 +1607,7 @@ export class SubscriberClient {
16071607
options.otherArgs.headers = options.otherArgs.headers || {};
16081608
options.otherArgs.headers['x-goog-request-params'] =
16091609
this._gaxModule.routingHeader.fromParams({
1610-
snapshot: request.snapshot || '',
1610+
snapshot: request.snapshot ?? '',
16111611
});
16121612
this.initialize();
16131613
return this.innerApiCalls.deleteSnapshot(request, options, callback);
@@ -1710,7 +1710,7 @@ export class SubscriberClient {
17101710
options.otherArgs.headers = options.otherArgs.headers || {};
17111711
options.otherArgs.headers['x-goog-request-params'] =
17121712
this._gaxModule.routingHeader.fromParams({
1713-
subscription: request.subscription || '',
1713+
subscription: request.subscription ?? '',
17141714
});
17151715
this.initialize();
17161716
return this.innerApiCalls.seek(request, options, callback);
@@ -1828,7 +1828,7 @@ export class SubscriberClient {
18281828
options.otherArgs.headers = options.otherArgs.headers || {};
18291829
options.otherArgs.headers['x-goog-request-params'] =
18301830
this._gaxModule.routingHeader.fromParams({
1831-
project: request.project || '',
1831+
project: request.project ?? '',
18321832
});
18331833
this.initialize();
18341834
return this.innerApiCalls.listSubscriptions(request, options, callback);
@@ -1869,7 +1869,7 @@ export class SubscriberClient {
18691869
options.otherArgs.headers = options.otherArgs.headers || {};
18701870
options.otherArgs.headers['x-goog-request-params'] =
18711871
this._gaxModule.routingHeader.fromParams({
1872-
project: request.project || '',
1872+
project: request.project ?? '',
18731873
});
18741874
const defaultCallSettings = this._defaults['listSubscriptions'];
18751875
const callSettings = defaultCallSettings.merge(options);
@@ -1917,7 +1917,7 @@ export class SubscriberClient {
19171917
options.otherArgs.headers = options.otherArgs.headers || {};
19181918
options.otherArgs.headers['x-goog-request-params'] =
19191919
this._gaxModule.routingHeader.fromParams({
1920-
project: request.project || '',
1920+
project: request.project ?? '',
19211921
});
19221922
const defaultCallSettings = this._defaults['listSubscriptions'];
19231923
const callSettings = defaultCallSettings.merge(options);
@@ -2020,7 +2020,7 @@ export class SubscriberClient {
20202020
options.otherArgs.headers = options.otherArgs.headers || {};
20212021
options.otherArgs.headers['x-goog-request-params'] =
20222022
this._gaxModule.routingHeader.fromParams({
2023-
project: request.project || '',
2023+
project: request.project ?? '',
20242024
});
20252025
this.initialize();
20262026
return this.innerApiCalls.listSnapshots(request, options, callback);
@@ -2061,7 +2061,7 @@ export class SubscriberClient {
20612061
options.otherArgs.headers = options.otherArgs.headers || {};
20622062
options.otherArgs.headers['x-goog-request-params'] =
20632063
this._gaxModule.routingHeader.fromParams({
2064-
project: request.project || '',
2064+
project: request.project ?? '',
20652065
});
20662066
const defaultCallSettings = this._defaults['listSnapshots'];
20672067
const callSettings = defaultCallSettings.merge(options);
@@ -2109,7 +2109,7 @@ export class SubscriberClient {
21092109
options.otherArgs.headers = options.otherArgs.headers || {};
21102110
options.otherArgs.headers['x-goog-request-params'] =
21112111
this._gaxModule.routingHeader.fromParams({
2112-
project: request.project || '',
2112+
project: request.project ?? '',
21132113
});
21142114
const defaultCallSettings = this._defaults['listSnapshots'];
21152115
const callSettings = defaultCallSettings.merge(options);

0 commit comments

Comments
 (0)