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

fix: preserve default values in x-goog-request-params header #620

Merged
merged 2 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/v1/autoscaling_policy_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.createAutoscalingPolicy(
Expand Down Expand Up @@ -561,7 +561,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'policy.name': request.policy!.name || '',
'policy.name': request.policy!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateAutoscalingPolicy(
Expand Down Expand Up @@ -665,7 +665,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getAutoscalingPolicy(request, options, callback);
Expand Down Expand Up @@ -772,7 +772,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deleteAutoscalingPolicy(
Expand Down Expand Up @@ -886,7 +886,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listAutoscalingPolicies(
Expand Down Expand Up @@ -939,7 +939,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listAutoscalingPolicies'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -997,7 +997,7 @@ export class AutoscalingPolicyServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listAutoscalingPolicies'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
12 changes: 6 additions & 6 deletions src/v1/batch_controller_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export class BatchControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getBatch(request, options, callback);
Expand Down Expand Up @@ -660,7 +660,7 @@ export class BatchControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
name: request.name || '',
name: request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deleteBatch(request, options, callback);
Expand Down Expand Up @@ -784,7 +784,7 @@ export class BatchControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.createBatch(request, options, callback);
Expand Down Expand Up @@ -914,7 +914,7 @@ export class BatchControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listBatches(request, options, callback);
Expand Down Expand Up @@ -955,7 +955,7 @@ export class BatchControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listBatches'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1005,7 +1005,7 @@ export class BatchControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',
parent: request.parent ?? '',
});
const defaultCallSettings = this._defaults['listBatches'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
52 changes: 26 additions & 26 deletions src/v1/cluster_controller_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
cluster_name: request.clusterName || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
cluster_name: request.clusterName ?? '',
});
this.initialize();
return this.innerApiCalls.getCluster(request, options, callback);
Expand Down Expand Up @@ -763,8 +763,8 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
this.initialize();
return this.innerApiCalls.createCluster(request, options, callback);
Expand Down Expand Up @@ -988,9 +988,9 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
cluster_name: request.clusterName || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
cluster_name: request.clusterName ?? '',
});
this.initialize();
return this.innerApiCalls.updateCluster(request, options, callback);
Expand Down Expand Up @@ -1149,9 +1149,9 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
cluster_name: request.clusterName || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
cluster_name: request.clusterName ?? '',
});
this.initialize();
return this.innerApiCalls.stopCluster(request, options, callback);
Expand Down Expand Up @@ -1310,9 +1310,9 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
cluster_name: request.clusterName || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
cluster_name: request.clusterName ?? '',
});
this.initialize();
return this.innerApiCalls.startCluster(request, options, callback);
Expand Down Expand Up @@ -1473,9 +1473,9 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
cluster_name: request.clusterName || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
cluster_name: request.clusterName ?? '',
});
this.initialize();
return this.innerApiCalls.deleteCluster(request, options, callback);
Expand Down Expand Up @@ -1624,9 +1624,9 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
cluster_name: request.clusterName || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
cluster_name: request.clusterName ?? '',
});
this.initialize();
return this.innerApiCalls.diagnoseCluster(request, options, callback);
Expand Down Expand Up @@ -1776,8 +1776,8 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
this.initialize();
return this.innerApiCalls.listClusters(request, options, callback);
Expand Down Expand Up @@ -1838,8 +1838,8 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
const defaultCallSettings = this._defaults['listClusters'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1909,8 +1909,8 @@ export class ClusterControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
const defaultCallSettings = this._defaults['listClusters'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
44 changes: 22 additions & 22 deletions src/v1/job_controller_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
this.initialize();
return this.innerApiCalls.submitJob(request, options, callback);
Expand Down Expand Up @@ -678,9 +678,9 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
job_id: request.jobId || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
job_id: request.jobId ?? '',
});
this.initialize();
return this.innerApiCalls.getJob(request, options, callback);
Expand Down Expand Up @@ -777,9 +777,9 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
job_id: request.jobId || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
job_id: request.jobId ?? '',
});
this.initialize();
return this.innerApiCalls.updateJob(request, options, callback);
Expand Down Expand Up @@ -871,9 +871,9 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
job_id: request.jobId || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
job_id: request.jobId ?? '',
});
this.initialize();
return this.innerApiCalls.cancelJob(request, options, callback);
Expand Down Expand Up @@ -962,9 +962,9 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
job_id: request.jobId || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
job_id: request.jobId ?? '',
});
this.initialize();
return this.innerApiCalls.deleteJob(request, options, callback);
Expand Down Expand Up @@ -1086,8 +1086,8 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
this.initialize();
return this.innerApiCalls.submitJobAsOperation(request, options, callback);
Expand Down Expand Up @@ -1239,8 +1239,8 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
this.initialize();
return this.innerApiCalls.listJobs(request, options, callback);
Expand Down Expand Up @@ -1305,8 +1305,8 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
const defaultCallSettings = this._defaults['listJobs'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -1380,8 +1380,8 @@ export class JobControllerClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
project_id: request.projectId || '',
region: request.region || '',
project_id: request.projectId ?? '',
region: request.region ?? '',
});
const defaultCallSettings = this._defaults['listJobs'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
Loading