Skip to content

Commit

Permalink
fix: preserve default values in x-goog-request-params header (#620)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 474338479

Source-Link: googleapis/googleapis@d5d35e0

Source-Link: googleapis/googleapis-gen@efcd3f9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
  • Loading branch information
gcf-owl-bot[bot] authored Sep 14, 2022
1 parent 16cd19e commit 1e43d85
Show file tree
Hide file tree
Showing 10 changed files with 2,128 additions and 1,762 deletions.
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 packages/google-cloud-dataproc/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 packages/google-cloud-dataproc/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 packages/google-cloud-dataproc/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

0 comments on commit 1e43d85

Please sign in to comment.