Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 484a023

Browse files
fix: preserve default values in x-goog-request-params header (#620)
- [ ] 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 4b62ef6 commit 484a023

10 files changed

+2128
-1762
lines changed

src/v1/autoscaling_policy_service_client.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export class AutoscalingPolicyServiceClient {
457457
options.otherArgs.headers = options.otherArgs.headers || {};
458458
options.otherArgs.headers['x-goog-request-params'] =
459459
this._gaxModule.routingHeader.fromParams({
460-
parent: request.parent || '',
460+
parent: request.parent ?? '',
461461
});
462462
this.initialize();
463463
return this.innerApiCalls.createAutoscalingPolicy(
@@ -561,7 +561,7 @@ export class AutoscalingPolicyServiceClient {
561561
options.otherArgs.headers = options.otherArgs.headers || {};
562562
options.otherArgs.headers['x-goog-request-params'] =
563563
this._gaxModule.routingHeader.fromParams({
564-
'policy.name': request.policy!.name || '',
564+
'policy.name': request.policy!.name ?? '',
565565
});
566566
this.initialize();
567567
return this.innerApiCalls.updateAutoscalingPolicy(
@@ -665,7 +665,7 @@ export class AutoscalingPolicyServiceClient {
665665
options.otherArgs.headers = options.otherArgs.headers || {};
666666
options.otherArgs.headers['x-goog-request-params'] =
667667
this._gaxModule.routingHeader.fromParams({
668-
name: request.name || '',
668+
name: request.name ?? '',
669669
});
670670
this.initialize();
671671
return this.innerApiCalls.getAutoscalingPolicy(request, options, callback);
@@ -772,7 +772,7 @@ export class AutoscalingPolicyServiceClient {
772772
options.otherArgs.headers = options.otherArgs.headers || {};
773773
options.otherArgs.headers['x-goog-request-params'] =
774774
this._gaxModule.routingHeader.fromParams({
775-
name: request.name || '',
775+
name: request.name ?? '',
776776
});
777777
this.initialize();
778778
return this.innerApiCalls.deleteAutoscalingPolicy(
@@ -886,7 +886,7 @@ export class AutoscalingPolicyServiceClient {
886886
options.otherArgs.headers = options.otherArgs.headers || {};
887887
options.otherArgs.headers['x-goog-request-params'] =
888888
this._gaxModule.routingHeader.fromParams({
889-
parent: request.parent || '',
889+
parent: request.parent ?? '',
890890
});
891891
this.initialize();
892892
return this.innerApiCalls.listAutoscalingPolicies(
@@ -939,7 +939,7 @@ export class AutoscalingPolicyServiceClient {
939939
options.otherArgs.headers = options.otherArgs.headers || {};
940940
options.otherArgs.headers['x-goog-request-params'] =
941941
this._gaxModule.routingHeader.fromParams({
942-
parent: request.parent || '',
942+
parent: request.parent ?? '',
943943
});
944944
const defaultCallSettings = this._defaults['listAutoscalingPolicies'];
945945
const callSettings = defaultCallSettings.merge(options);
@@ -997,7 +997,7 @@ export class AutoscalingPolicyServiceClient {
997997
options.otherArgs.headers = options.otherArgs.headers || {};
998998
options.otherArgs.headers['x-goog-request-params'] =
999999
this._gaxModule.routingHeader.fromParams({
1000-
parent: request.parent || '',
1000+
parent: request.parent ?? '',
10011001
});
10021002
const defaultCallSettings = this._defaults['listAutoscalingPolicies'];
10031003
const callSettings = defaultCallSettings.merge(options);

src/v1/batch_controller_client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ export class BatchControllerClient {
574574
options.otherArgs.headers = options.otherArgs.headers || {};
575575
options.otherArgs.headers['x-goog-request-params'] =
576576
this._gaxModule.routingHeader.fromParams({
577-
name: request.name || '',
577+
name: request.name ?? '',
578578
});
579579
this.initialize();
580580
return this.innerApiCalls.getBatch(request, options, callback);
@@ -660,7 +660,7 @@ export class BatchControllerClient {
660660
options.otherArgs.headers = options.otherArgs.headers || {};
661661
options.otherArgs.headers['x-goog-request-params'] =
662662
this._gaxModule.routingHeader.fromParams({
663-
name: request.name || '',
663+
name: request.name ?? '',
664664
});
665665
this.initialize();
666666
return this.innerApiCalls.deleteBatch(request, options, callback);
@@ -784,7 +784,7 @@ export class BatchControllerClient {
784784
options.otherArgs.headers = options.otherArgs.headers || {};
785785
options.otherArgs.headers['x-goog-request-params'] =
786786
this._gaxModule.routingHeader.fromParams({
787-
parent: request.parent || '',
787+
parent: request.parent ?? '',
788788
});
789789
this.initialize();
790790
return this.innerApiCalls.createBatch(request, options, callback);
@@ -914,7 +914,7 @@ export class BatchControllerClient {
914914
options.otherArgs.headers = options.otherArgs.headers || {};
915915
options.otherArgs.headers['x-goog-request-params'] =
916916
this._gaxModule.routingHeader.fromParams({
917-
parent: request.parent || '',
917+
parent: request.parent ?? '',
918918
});
919919
this.initialize();
920920
return this.innerApiCalls.listBatches(request, options, callback);
@@ -955,7 +955,7 @@ export class BatchControllerClient {
955955
options.otherArgs.headers = options.otherArgs.headers || {};
956956
options.otherArgs.headers['x-goog-request-params'] =
957957
this._gaxModule.routingHeader.fromParams({
958-
parent: request.parent || '',
958+
parent: request.parent ?? '',
959959
});
960960
const defaultCallSettings = this._defaults['listBatches'];
961961
const callSettings = defaultCallSettings.merge(options);
@@ -1005,7 +1005,7 @@ export class BatchControllerClient {
10051005
options.otherArgs.headers = options.otherArgs.headers || {};
10061006
options.otherArgs.headers['x-goog-request-params'] =
10071007
this._gaxModule.routingHeader.fromParams({
1008-
parent: request.parent || '',
1008+
parent: request.parent ?? '',
10091009
});
10101010
const defaultCallSettings = this._defaults['listBatches'];
10111011
const callSettings = defaultCallSettings.merge(options);

src/v1/cluster_controller_client.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,9 @@ export class ClusterControllerClient {
636636
options.otherArgs.headers = options.otherArgs.headers || {};
637637
options.otherArgs.headers['x-goog-request-params'] =
638638
this._gaxModule.routingHeader.fromParams({
639-
project_id: request.projectId || '',
640-
region: request.region || '',
641-
cluster_name: request.clusterName || '',
639+
project_id: request.projectId ?? '',
640+
region: request.region ?? '',
641+
cluster_name: request.clusterName ?? '',
642642
});
643643
this.initialize();
644644
return this.innerApiCalls.getCluster(request, options, callback);
@@ -763,8 +763,8 @@ export class ClusterControllerClient {
763763
options.otherArgs.headers = options.otherArgs.headers || {};
764764
options.otherArgs.headers['x-goog-request-params'] =
765765
this._gaxModule.routingHeader.fromParams({
766-
project_id: request.projectId || '',
767-
region: request.region || '',
766+
project_id: request.projectId ?? '',
767+
region: request.region ?? '',
768768
});
769769
this.initialize();
770770
return this.innerApiCalls.createCluster(request, options, callback);
@@ -988,9 +988,9 @@ export class ClusterControllerClient {
988988
options.otherArgs.headers = options.otherArgs.headers || {};
989989
options.otherArgs.headers['x-goog-request-params'] =
990990
this._gaxModule.routingHeader.fromParams({
991-
project_id: request.projectId || '',
992-
region: request.region || '',
993-
cluster_name: request.clusterName || '',
991+
project_id: request.projectId ?? '',
992+
region: request.region ?? '',
993+
cluster_name: request.clusterName ?? '',
994994
});
995995
this.initialize();
996996
return this.innerApiCalls.updateCluster(request, options, callback);
@@ -1149,9 +1149,9 @@ export class ClusterControllerClient {
11491149
options.otherArgs.headers = options.otherArgs.headers || {};
11501150
options.otherArgs.headers['x-goog-request-params'] =
11511151
this._gaxModule.routingHeader.fromParams({
1152-
project_id: request.projectId || '',
1153-
region: request.region || '',
1154-
cluster_name: request.clusterName || '',
1152+
project_id: request.projectId ?? '',
1153+
region: request.region ?? '',
1154+
cluster_name: request.clusterName ?? '',
11551155
});
11561156
this.initialize();
11571157
return this.innerApiCalls.stopCluster(request, options, callback);
@@ -1310,9 +1310,9 @@ export class ClusterControllerClient {
13101310
options.otherArgs.headers = options.otherArgs.headers || {};
13111311
options.otherArgs.headers['x-goog-request-params'] =
13121312
this._gaxModule.routingHeader.fromParams({
1313-
project_id: request.projectId || '',
1314-
region: request.region || '',
1315-
cluster_name: request.clusterName || '',
1313+
project_id: request.projectId ?? '',
1314+
region: request.region ?? '',
1315+
cluster_name: request.clusterName ?? '',
13161316
});
13171317
this.initialize();
13181318
return this.innerApiCalls.startCluster(request, options, callback);
@@ -1473,9 +1473,9 @@ export class ClusterControllerClient {
14731473
options.otherArgs.headers = options.otherArgs.headers || {};
14741474
options.otherArgs.headers['x-goog-request-params'] =
14751475
this._gaxModule.routingHeader.fromParams({
1476-
project_id: request.projectId || '',
1477-
region: request.region || '',
1478-
cluster_name: request.clusterName || '',
1476+
project_id: request.projectId ?? '',
1477+
region: request.region ?? '',
1478+
cluster_name: request.clusterName ?? '',
14791479
});
14801480
this.initialize();
14811481
return this.innerApiCalls.deleteCluster(request, options, callback);
@@ -1624,9 +1624,9 @@ export class ClusterControllerClient {
16241624
options.otherArgs.headers = options.otherArgs.headers || {};
16251625
options.otherArgs.headers['x-goog-request-params'] =
16261626
this._gaxModule.routingHeader.fromParams({
1627-
project_id: request.projectId || '',
1628-
region: request.region || '',
1629-
cluster_name: request.clusterName || '',
1627+
project_id: request.projectId ?? '',
1628+
region: request.region ?? '',
1629+
cluster_name: request.clusterName ?? '',
16301630
});
16311631
this.initialize();
16321632
return this.innerApiCalls.diagnoseCluster(request, options, callback);
@@ -1776,8 +1776,8 @@ export class ClusterControllerClient {
17761776
options.otherArgs.headers = options.otherArgs.headers || {};
17771777
options.otherArgs.headers['x-goog-request-params'] =
17781778
this._gaxModule.routingHeader.fromParams({
1779-
project_id: request.projectId || '',
1780-
region: request.region || '',
1779+
project_id: request.projectId ?? '',
1780+
region: request.region ?? '',
17811781
});
17821782
this.initialize();
17831783
return this.innerApiCalls.listClusters(request, options, callback);
@@ -1838,8 +1838,8 @@ export class ClusterControllerClient {
18381838
options.otherArgs.headers = options.otherArgs.headers || {};
18391839
options.otherArgs.headers['x-goog-request-params'] =
18401840
this._gaxModule.routingHeader.fromParams({
1841-
project_id: request.projectId || '',
1842-
region: request.region || '',
1841+
project_id: request.projectId ?? '',
1842+
region: request.region ?? '',
18431843
});
18441844
const defaultCallSettings = this._defaults['listClusters'];
18451845
const callSettings = defaultCallSettings.merge(options);
@@ -1909,8 +1909,8 @@ export class ClusterControllerClient {
19091909
options.otherArgs.headers = options.otherArgs.headers || {};
19101910
options.otherArgs.headers['x-goog-request-params'] =
19111911
this._gaxModule.routingHeader.fromParams({
1912-
project_id: request.projectId || '',
1913-
region: request.region || '',
1912+
project_id: request.projectId ?? '',
1913+
region: request.region ?? '',
19141914
});
19151915
const defaultCallSettings = this._defaults['listClusters'];
19161916
const callSettings = defaultCallSettings.merge(options);

src/v1/job_controller_client.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,8 @@ export class JobControllerClient {
589589
options.otherArgs.headers = options.otherArgs.headers || {};
590590
options.otherArgs.headers['x-goog-request-params'] =
591591
this._gaxModule.routingHeader.fromParams({
592-
project_id: request.projectId || '',
593-
region: request.region || '',
592+
project_id: request.projectId ?? '',
593+
region: request.region ?? '',
594594
});
595595
this.initialize();
596596
return this.innerApiCalls.submitJob(request, options, callback);
@@ -678,9 +678,9 @@ export class JobControllerClient {
678678
options.otherArgs.headers = options.otherArgs.headers || {};
679679
options.otherArgs.headers['x-goog-request-params'] =
680680
this._gaxModule.routingHeader.fromParams({
681-
project_id: request.projectId || '',
682-
region: request.region || '',
683-
job_id: request.jobId || '',
681+
project_id: request.projectId ?? '',
682+
region: request.region ?? '',
683+
job_id: request.jobId ?? '',
684684
});
685685
this.initialize();
686686
return this.innerApiCalls.getJob(request, options, callback);
@@ -777,9 +777,9 @@ export class JobControllerClient {
777777
options.otherArgs.headers = options.otherArgs.headers || {};
778778
options.otherArgs.headers['x-goog-request-params'] =
779779
this._gaxModule.routingHeader.fromParams({
780-
project_id: request.projectId || '',
781-
region: request.region || '',
782-
job_id: request.jobId || '',
780+
project_id: request.projectId ?? '',
781+
region: request.region ?? '',
782+
job_id: request.jobId ?? '',
783783
});
784784
this.initialize();
785785
return this.innerApiCalls.updateJob(request, options, callback);
@@ -871,9 +871,9 @@ export class JobControllerClient {
871871
options.otherArgs.headers = options.otherArgs.headers || {};
872872
options.otherArgs.headers['x-goog-request-params'] =
873873
this._gaxModule.routingHeader.fromParams({
874-
project_id: request.projectId || '',
875-
region: request.region || '',
876-
job_id: request.jobId || '',
874+
project_id: request.projectId ?? '',
875+
region: request.region ?? '',
876+
job_id: request.jobId ?? '',
877877
});
878878
this.initialize();
879879
return this.innerApiCalls.cancelJob(request, options, callback);
@@ -962,9 +962,9 @@ export class JobControllerClient {
962962
options.otherArgs.headers = options.otherArgs.headers || {};
963963
options.otherArgs.headers['x-goog-request-params'] =
964964
this._gaxModule.routingHeader.fromParams({
965-
project_id: request.projectId || '',
966-
region: request.region || '',
967-
job_id: request.jobId || '',
965+
project_id: request.projectId ?? '',
966+
region: request.region ?? '',
967+
job_id: request.jobId ?? '',
968968
});
969969
this.initialize();
970970
return this.innerApiCalls.deleteJob(request, options, callback);
@@ -1086,8 +1086,8 @@ export class JobControllerClient {
10861086
options.otherArgs.headers = options.otherArgs.headers || {};
10871087
options.otherArgs.headers['x-goog-request-params'] =
10881088
this._gaxModule.routingHeader.fromParams({
1089-
project_id: request.projectId || '',
1090-
region: request.region || '',
1089+
project_id: request.projectId ?? '',
1090+
region: request.region ?? '',
10911091
});
10921092
this.initialize();
10931093
return this.innerApiCalls.submitJobAsOperation(request, options, callback);
@@ -1239,8 +1239,8 @@ export class JobControllerClient {
12391239
options.otherArgs.headers = options.otherArgs.headers || {};
12401240
options.otherArgs.headers['x-goog-request-params'] =
12411241
this._gaxModule.routingHeader.fromParams({
1242-
project_id: request.projectId || '',
1243-
region: request.region || '',
1242+
project_id: request.projectId ?? '',
1243+
region: request.region ?? '',
12441244
});
12451245
this.initialize();
12461246
return this.innerApiCalls.listJobs(request, options, callback);
@@ -1305,8 +1305,8 @@ export class JobControllerClient {
13051305
options.otherArgs.headers = options.otherArgs.headers || {};
13061306
options.otherArgs.headers['x-goog-request-params'] =
13071307
this._gaxModule.routingHeader.fromParams({
1308-
project_id: request.projectId || '',
1309-
region: request.region || '',
1308+
project_id: request.projectId ?? '',
1309+
region: request.region ?? '',
13101310
});
13111311
const defaultCallSettings = this._defaults['listJobs'];
13121312
const callSettings = defaultCallSettings.merge(options);
@@ -1380,8 +1380,8 @@ export class JobControllerClient {
13801380
options.otherArgs.headers = options.otherArgs.headers || {};
13811381
options.otherArgs.headers['x-goog-request-params'] =
13821382
this._gaxModule.routingHeader.fromParams({
1383-
project_id: request.projectId || '',
1384-
region: request.region || '',
1383+
project_id: request.projectId ?? '',
1384+
region: request.region ?? '',
13851385
});
13861386
const defaultCallSettings = this._defaults['listJobs'];
13871387
const callSettings = defaultCallSettings.merge(options);

0 commit comments

Comments
 (0)