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

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

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
62 changes: 31 additions & 31 deletions src/v1/reservation_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ export class ReservationServiceClient {
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.createReservation(request, options, callback);
Expand Down Expand Up @@ -595,7 +595,7 @@ export class ReservationServiceClient {
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.getReservation(request, options, callback);
Expand Down Expand Up @@ -695,7 +695,7 @@ export class ReservationServiceClient {
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.deleteReservation(request, options, callback);
Expand Down Expand Up @@ -794,7 +794,7 @@ export class ReservationServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'reservation.name': request.reservation!.name || '',
'reservation.name': request.reservation!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateReservation(request, options, callback);
Expand Down Expand Up @@ -903,7 +903,7 @@ export class ReservationServiceClient {
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.createCapacityCommitment(
Expand Down Expand Up @@ -1005,7 +1005,7 @@ export class ReservationServiceClient {
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.getCapacityCommitment(request, options, callback);
Expand Down Expand Up @@ -1109,7 +1109,7 @@ export class ReservationServiceClient {
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.deleteCapacityCommitment(
Expand Down Expand Up @@ -1218,7 +1218,7 @@ export class ReservationServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'capacity_commitment.name': request.capacityCommitment!.name || '',
'capacity_commitment.name': request.capacityCommitment!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateCapacityCommitment(
Expand Down Expand Up @@ -1329,7 +1329,7 @@ export class ReservationServiceClient {
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.splitCapacityCommitment(
Expand Down Expand Up @@ -1443,7 +1443,7 @@ export class ReservationServiceClient {
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.mergeCapacityCommitments(
Expand Down Expand Up @@ -1586,7 +1586,7 @@ export class ReservationServiceClient {
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.createAssignment(request, options, callback);
Expand Down Expand Up @@ -1698,7 +1698,7 @@ export class ReservationServiceClient {
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.deleteAssignment(request, options, callback);
Expand Down Expand Up @@ -1804,7 +1804,7 @@ export class ReservationServiceClient {
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.moveAssignment(request, options, callback);
Expand Down Expand Up @@ -1905,7 +1905,7 @@ export class ReservationServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'assignment.name': request.assignment!.name || '',
'assignment.name': request.assignment!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateAssignment(request, options, callback);
Expand Down Expand Up @@ -2003,7 +2003,7 @@ export class ReservationServiceClient {
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.getBiReservation(request, options, callback);
Expand Down Expand Up @@ -2109,7 +2109,7 @@ export class ReservationServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'bi_reservation.name': request.biReservation!.name || '',
'bi_reservation.name': request.biReservation!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateBiReservation(request, options, callback);
Expand Down Expand Up @@ -2209,7 +2209,7 @@ export class ReservationServiceClient {
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.listReservations(request, options, callback);
Expand Down Expand Up @@ -2248,7 +2248,7 @@ export class ReservationServiceClient {
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['listReservations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2296,7 +2296,7 @@ export class ReservationServiceClient {
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['listReservations'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2401,7 +2401,7 @@ export class ReservationServiceClient {
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.listCapacityCommitments(
Expand Down Expand Up @@ -2444,7 +2444,7 @@ export class ReservationServiceClient {
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['listCapacityCommitments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2492,7 +2492,7 @@ export class ReservationServiceClient {
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['listCapacityCommitments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2622,7 +2622,7 @@ export class ReservationServiceClient {
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.listAssignments(request, options, callback);
Expand Down Expand Up @@ -2666,7 +2666,7 @@ export class ReservationServiceClient {
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['listAssignments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2719,7 +2719,7 @@ export class ReservationServiceClient {
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['listAssignments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2856,7 +2856,7 @@ export class ReservationServiceClient {
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();
this.warn(
Expand Down Expand Up @@ -2910,7 +2910,7 @@ export class ReservationServiceClient {
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['searchAssignments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -2973,7 +2973,7 @@ export class ReservationServiceClient {
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['searchAssignments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3111,7 +3111,7 @@ export class ReservationServiceClient {
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.searchAllAssignments(request, options, callback);
Expand Down Expand Up @@ -3159,7 +3159,7 @@ export class ReservationServiceClient {
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['searchAllAssignments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down Expand Up @@ -3216,7 +3216,7 @@ export class ReservationServiceClient {
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['searchAllAssignments'];
const callSettings = defaultCallSettings.merge(options);
Expand Down
Loading