Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Commit ea654b5

Browse files
fix: preserve default values in x-goog-request-params header (#928)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: googleapis/googleapis@d5d35e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
1 parent 86fc9e2 commit ea654b5

6 files changed

+1142
-1096
lines changed

src/v1/adaptation_client.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export class AdaptationClient {
446446
options.otherArgs.headers = options.otherArgs.headers || {};
447447
options.otherArgs.headers['x-goog-request-params'] =
448448
this._gaxModule.routingHeader.fromParams({
449-
parent: request.parent || '',
449+
parent: request.parent ?? '',
450450
});
451451
this.initialize();
452452
return this.innerApiCalls.createPhraseSet(request, options, callback);
@@ -537,7 +537,7 @@ export class AdaptationClient {
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.getPhraseSet(request, options, callback);
@@ -635,7 +635,7 @@ export class AdaptationClient {
635635
options.otherArgs.headers = options.otherArgs.headers || {};
636636
options.otherArgs.headers['x-goog-request-params'] =
637637
this._gaxModule.routingHeader.fromParams({
638-
'phrase_set.name': request.phraseSet!.name || '',
638+
'phrase_set.name': request.phraseSet!.name ?? '',
639639
});
640640
this.initialize();
641641
return this.innerApiCalls.updatePhraseSet(request, options, callback);
@@ -722,7 +722,7 @@ export class AdaptationClient {
722722
options.otherArgs.headers = options.otherArgs.headers || {};
723723
options.otherArgs.headers['x-goog-request-params'] =
724724
this._gaxModule.routingHeader.fromParams({
725-
name: request.name || '',
725+
name: request.name ?? '',
726726
});
727727
this.initialize();
728728
return this.innerApiCalls.deletePhraseSet(request, options, callback);
@@ -829,7 +829,7 @@ export class AdaptationClient {
829829
options.otherArgs.headers = options.otherArgs.headers || {};
830830
options.otherArgs.headers['x-goog-request-params'] =
831831
this._gaxModule.routingHeader.fromParams({
832-
parent: request.parent || '',
832+
parent: request.parent ?? '',
833833
});
834834
this.initialize();
835835
return this.innerApiCalls.createCustomClass(request, options, callback);
@@ -916,7 +916,7 @@ export class AdaptationClient {
916916
options.otherArgs.headers = options.otherArgs.headers || {};
917917
options.otherArgs.headers['x-goog-request-params'] =
918918
this._gaxModule.routingHeader.fromParams({
919-
name: request.name || '',
919+
name: request.name ?? '',
920920
});
921921
this.initialize();
922922
return this.innerApiCalls.getCustomClass(request, options, callback);
@@ -1020,7 +1020,7 @@ export class AdaptationClient {
10201020
options.otherArgs.headers = options.otherArgs.headers || {};
10211021
options.otherArgs.headers['x-goog-request-params'] =
10221022
this._gaxModule.routingHeader.fromParams({
1023-
'custom_class.name': request.customClass!.name || '',
1023+
'custom_class.name': request.customClass!.name ?? '',
10241024
});
10251025
this.initialize();
10261026
return this.innerApiCalls.updateCustomClass(request, options, callback);
@@ -1119,7 +1119,7 @@ export class AdaptationClient {
11191119
options.otherArgs.headers = options.otherArgs.headers || {};
11201120
options.otherArgs.headers['x-goog-request-params'] =
11211121
this._gaxModule.routingHeader.fromParams({
1122-
name: request.name || '',
1122+
name: request.name ?? '',
11231123
});
11241124
this.initialize();
11251125
return this.innerApiCalls.deleteCustomClass(request, options, callback);
@@ -1227,7 +1227,7 @@ export class AdaptationClient {
12271227
options.otherArgs.headers = options.otherArgs.headers || {};
12281228
options.otherArgs.headers['x-goog-request-params'] =
12291229
this._gaxModule.routingHeader.fromParams({
1230-
parent: request.parent || '',
1230+
parent: request.parent ?? '',
12311231
});
12321232
this.initialize();
12331233
return this.innerApiCalls.listPhraseSet(request, options, callback);
@@ -1280,7 +1280,7 @@ export class AdaptationClient {
12801280
options.otherArgs.headers = options.otherArgs.headers || {};
12811281
options.otherArgs.headers['x-goog-request-params'] =
12821282
this._gaxModule.routingHeader.fromParams({
1283-
parent: request.parent || '',
1283+
parent: request.parent ?? '',
12841284
});
12851285
const defaultCallSettings = this._defaults['listPhraseSet'];
12861286
const callSettings = defaultCallSettings.merge(options);
@@ -1342,7 +1342,7 @@ export class AdaptationClient {
13421342
options.otherArgs.headers = options.otherArgs.headers || {};
13431343
options.otherArgs.headers['x-goog-request-params'] =
13441344
this._gaxModule.routingHeader.fromParams({
1345-
parent: request.parent || '',
1345+
parent: request.parent ?? '',
13461346
});
13471347
const defaultCallSettings = this._defaults['listPhraseSet'];
13481348
const callSettings = defaultCallSettings.merge(options);
@@ -1461,7 +1461,7 @@ export class AdaptationClient {
14611461
options.otherArgs.headers = options.otherArgs.headers || {};
14621462
options.otherArgs.headers['x-goog-request-params'] =
14631463
this._gaxModule.routingHeader.fromParams({
1464-
parent: request.parent || '',
1464+
parent: request.parent ?? '',
14651465
});
14661466
this.initialize();
14671467
return this.innerApiCalls.listCustomClasses(request, options, callback);
@@ -1514,7 +1514,7 @@ export class AdaptationClient {
15141514
options.otherArgs.headers = options.otherArgs.headers || {};
15151515
options.otherArgs.headers['x-goog-request-params'] =
15161516
this._gaxModule.routingHeader.fromParams({
1517-
parent: request.parent || '',
1517+
parent: request.parent ?? '',
15181518
});
15191519
const defaultCallSettings = this._defaults['listCustomClasses'];
15201520
const callSettings = defaultCallSettings.merge(options);
@@ -1576,7 +1576,7 @@ export class AdaptationClient {
15761576
options.otherArgs.headers = options.otherArgs.headers || {};
15771577
options.otherArgs.headers['x-goog-request-params'] =
15781578
this._gaxModule.routingHeader.fromParams({
1579-
parent: request.parent || '',
1579+
parent: request.parent ?? '',
15801580
});
15811581
const defaultCallSettings = this._defaults['listCustomClasses'];
15821582
const callSettings = defaultCallSettings.merge(options);

src/v1p1beta1/adaptation_client.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export class AdaptationClient {
452452
options.otherArgs.headers = options.otherArgs.headers || {};
453453
options.otherArgs.headers['x-goog-request-params'] =
454454
this._gaxModule.routingHeader.fromParams({
455-
parent: request.parent || '',
455+
parent: request.parent ?? '',
456456
});
457457
this.initialize();
458458
return this.innerApiCalls.createPhraseSet(request, options, callback);
@@ -551,7 +551,7 @@ export class AdaptationClient {
551551
options.otherArgs.headers = options.otherArgs.headers || {};
552552
options.otherArgs.headers['x-goog-request-params'] =
553553
this._gaxModule.routingHeader.fromParams({
554-
name: request.name || '',
554+
name: request.name ?? '',
555555
});
556556
this.initialize();
557557
return this.innerApiCalls.getPhraseSet(request, options, callback);
@@ -655,7 +655,7 @@ export class AdaptationClient {
655655
options.otherArgs.headers = options.otherArgs.headers || {};
656656
options.otherArgs.headers['x-goog-request-params'] =
657657
this._gaxModule.routingHeader.fromParams({
658-
'phrase_set.name': request.phraseSet!.name || '',
658+
'phrase_set.name': request.phraseSet!.name ?? '',
659659
});
660660
this.initialize();
661661
return this.innerApiCalls.updatePhraseSet(request, options, callback);
@@ -748,7 +748,7 @@ export class AdaptationClient {
748748
options.otherArgs.headers = options.otherArgs.headers || {};
749749
options.otherArgs.headers['x-goog-request-params'] =
750750
this._gaxModule.routingHeader.fromParams({
751-
name: request.name || '',
751+
name: request.name ?? '',
752752
});
753753
this.initialize();
754754
return this.innerApiCalls.deletePhraseSet(request, options, callback);
@@ -861,7 +861,7 @@ export class AdaptationClient {
861861
options.otherArgs.headers = options.otherArgs.headers || {};
862862
options.otherArgs.headers['x-goog-request-params'] =
863863
this._gaxModule.routingHeader.fromParams({
864-
parent: request.parent || '',
864+
parent: request.parent ?? '',
865865
});
866866
this.initialize();
867867
return this.innerApiCalls.createCustomClass(request, options, callback);
@@ -954,7 +954,7 @@ export class AdaptationClient {
954954
options.otherArgs.headers = options.otherArgs.headers || {};
955955
options.otherArgs.headers['x-goog-request-params'] =
956956
this._gaxModule.routingHeader.fromParams({
957-
name: request.name || '',
957+
name: request.name ?? '',
958958
});
959959
this.initialize();
960960
return this.innerApiCalls.getCustomClass(request, options, callback);
@@ -1064,7 +1064,7 @@ export class AdaptationClient {
10641064
options.otherArgs.headers = options.otherArgs.headers || {};
10651065
options.otherArgs.headers['x-goog-request-params'] =
10661066
this._gaxModule.routingHeader.fromParams({
1067-
'custom_class.name': request.customClass!.name || '',
1067+
'custom_class.name': request.customClass!.name ?? '',
10681068
});
10691069
this.initialize();
10701070
return this.innerApiCalls.updateCustomClass(request, options, callback);
@@ -1169,7 +1169,7 @@ export class AdaptationClient {
11691169
options.otherArgs.headers = options.otherArgs.headers || {};
11701170
options.otherArgs.headers['x-goog-request-params'] =
11711171
this._gaxModule.routingHeader.fromParams({
1172-
name: request.name || '',
1172+
name: request.name ?? '',
11731173
});
11741174
this.initialize();
11751175
return this.innerApiCalls.deleteCustomClass(request, options, callback);
@@ -1283,7 +1283,7 @@ export class AdaptationClient {
12831283
options.otherArgs.headers = options.otherArgs.headers || {};
12841284
options.otherArgs.headers['x-goog-request-params'] =
12851285
this._gaxModule.routingHeader.fromParams({
1286-
parent: request.parent || '',
1286+
parent: request.parent ?? '',
12871287
});
12881288
this.initialize();
12891289
return this.innerApiCalls.listPhraseSet(request, options, callback);
@@ -1336,7 +1336,7 @@ export class AdaptationClient {
13361336
options.otherArgs.headers = options.otherArgs.headers || {};
13371337
options.otherArgs.headers['x-goog-request-params'] =
13381338
this._gaxModule.routingHeader.fromParams({
1339-
parent: request.parent || '',
1339+
parent: request.parent ?? '',
13401340
});
13411341
const defaultCallSettings = this._defaults['listPhraseSet'];
13421342
const callSettings = defaultCallSettings.merge(options);
@@ -1398,7 +1398,7 @@ export class AdaptationClient {
13981398
options.otherArgs.headers = options.otherArgs.headers || {};
13991399
options.otherArgs.headers['x-goog-request-params'] =
14001400
this._gaxModule.routingHeader.fromParams({
1401-
parent: request.parent || '',
1401+
parent: request.parent ?? '',
14021402
});
14031403
const defaultCallSettings = this._defaults['listPhraseSet'];
14041404
const callSettings = defaultCallSettings.merge(options);
@@ -1517,7 +1517,7 @@ export class AdaptationClient {
15171517
options.otherArgs.headers = options.otherArgs.headers || {};
15181518
options.otherArgs.headers['x-goog-request-params'] =
15191519
this._gaxModule.routingHeader.fromParams({
1520-
parent: request.parent || '',
1520+
parent: request.parent ?? '',
15211521
});
15221522
this.initialize();
15231523
return this.innerApiCalls.listCustomClasses(request, options, callback);
@@ -1570,7 +1570,7 @@ export class AdaptationClient {
15701570
options.otherArgs.headers = options.otherArgs.headers || {};
15711571
options.otherArgs.headers['x-goog-request-params'] =
15721572
this._gaxModule.routingHeader.fromParams({
1573-
parent: request.parent || '',
1573+
parent: request.parent ?? '',
15741574
});
15751575
const defaultCallSettings = this._defaults['listCustomClasses'];
15761576
const callSettings = defaultCallSettings.merge(options);
@@ -1632,7 +1632,7 @@ export class AdaptationClient {
16321632
options.otherArgs.headers = options.otherArgs.headers || {};
16331633
options.otherArgs.headers['x-goog-request-params'] =
16341634
this._gaxModule.routingHeader.fromParams({
1635-
parent: request.parent || '',
1635+
parent: request.parent ?? '',
16361636
});
16371637
const defaultCallSettings = this._defaults['listCustomClasses'];
16381638
const callSettings = defaultCallSettings.merge(options);

0 commit comments

Comments
 (0)