Skip to content

Commit 2b80e1e

Browse files
fix: preserve default values in x-goog-request-params header (#979)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: googleapis/googleapis@d5d35e0 Source-Link: googleapis/googleapis-gen@efcd3f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
1 parent 386b9c7 commit 2b80e1e

File tree

4 files changed

+690
-663
lines changed

4 files changed

+690
-663
lines changed

src/v1/datastore_admin_client.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ export class DatastoreAdminClient {
549549
options.otherArgs.headers = options.otherArgs.headers || {};
550550
options.otherArgs.headers['x-goog-request-params'] =
551551
this._gaxModule.routingHeader.fromParams({
552-
project_id: request.projectId || '',
553-
index_id: request.indexId || '',
552+
project_id: request.projectId ?? '',
553+
index_id: request.indexId ?? '',
554554
});
555555
this.initialize();
556556
return this.innerApiCalls.getIndex(request, options, callback);
@@ -684,7 +684,7 @@ export class DatastoreAdminClient {
684684
options.otherArgs.headers = options.otherArgs.headers || {};
685685
options.otherArgs.headers['x-goog-request-params'] =
686686
this._gaxModule.routingHeader.fromParams({
687-
project_id: request.projectId || '',
687+
project_id: request.projectId ?? '',
688688
});
689689
this.initialize();
690690
return this.innerApiCalls.exportEntities(request, options, callback);
@@ -847,7 +847,7 @@ export class DatastoreAdminClient {
847847
options.otherArgs.headers = options.otherArgs.headers || {};
848848
options.otherArgs.headers['x-goog-request-params'] =
849849
this._gaxModule.routingHeader.fromParams({
850-
project_id: request.projectId || '',
850+
project_id: request.projectId ?? '',
851851
});
852852
this.initialize();
853853
return this.innerApiCalls.importEntities(request, options, callback);
@@ -1001,7 +1001,7 @@ export class DatastoreAdminClient {
10011001
options.otherArgs.headers = options.otherArgs.headers || {};
10021002
options.otherArgs.headers['x-goog-request-params'] =
10031003
this._gaxModule.routingHeader.fromParams({
1004-
project_id: request.projectId || '',
1004+
project_id: request.projectId ?? '',
10051005
});
10061006
this.initialize();
10071007
return this.innerApiCalls.createIndex(request, options, callback);
@@ -1150,8 +1150,8 @@ export class DatastoreAdminClient {
11501150
options.otherArgs.headers = options.otherArgs.headers || {};
11511151
options.otherArgs.headers['x-goog-request-params'] =
11521152
this._gaxModule.routingHeader.fromParams({
1153-
project_id: request.projectId || '',
1154-
index_id: request.indexId || '',
1153+
project_id: request.projectId ?? '',
1154+
index_id: request.indexId ?? '',
11551155
});
11561156
this.initialize();
11571157
return this.innerApiCalls.deleteIndex(request, options, callback);
@@ -1282,7 +1282,7 @@ export class DatastoreAdminClient {
12821282
options.otherArgs.headers = options.otherArgs.headers || {};
12831283
options.otherArgs.headers['x-goog-request-params'] =
12841284
this._gaxModule.routingHeader.fromParams({
1285-
project_id: request.projectId || '',
1285+
project_id: request.projectId ?? '',
12861286
});
12871287
this.initialize();
12881288
return this.innerApiCalls.listIndexes(request, options, callback);
@@ -1322,7 +1322,7 @@ export class DatastoreAdminClient {
13221322
options.otherArgs.headers = options.otherArgs.headers || {};
13231323
options.otherArgs.headers['x-goog-request-params'] =
13241324
this._gaxModule.routingHeader.fromParams({
1325-
project_id: request.projectId || '',
1325+
project_id: request.projectId ?? '',
13261326
});
13271327
const defaultCallSettings = this._defaults['listIndexes'];
13281328
const callSettings = defaultCallSettings.merge(options);
@@ -1371,7 +1371,7 @@ export class DatastoreAdminClient {
13711371
options.otherArgs.headers = options.otherArgs.headers || {};
13721372
options.otherArgs.headers['x-goog-request-params'] =
13731373
this._gaxModule.routingHeader.fromParams({
1374-
project_id: request.projectId || '',
1374+
project_id: request.projectId ?? '',
13751375
});
13761376
const defaultCallSettings = this._defaults['listIndexes'];
13771377
const callSettings = defaultCallSettings.merge(options);

src/v1/datastore_client.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export class DatastoreClient {
441441
options.otherArgs.headers = options.otherArgs.headers || {};
442442
options.otherArgs.headers['x-goog-request-params'] =
443443
this._gaxModule.routingHeader.fromParams({
444-
project_id: request.projectId || '',
444+
project_id: request.projectId ?? '',
445445
});
446446
this.initialize();
447447
return this.innerApiCalls.lookup(request, options, callback);
@@ -540,7 +540,7 @@ export class DatastoreClient {
540540
options.otherArgs.headers = options.otherArgs.headers || {};
541541
options.otherArgs.headers['x-goog-request-params'] =
542542
this._gaxModule.routingHeader.fromParams({
543-
project_id: request.projectId || '',
543+
project_id: request.projectId ?? '',
544544
});
545545
this.initialize();
546546
return this.innerApiCalls.runQuery(request, options, callback);
@@ -632,7 +632,7 @@ export class DatastoreClient {
632632
options.otherArgs.headers = options.otherArgs.headers || {};
633633
options.otherArgs.headers['x-goog-request-params'] =
634634
this._gaxModule.routingHeader.fromParams({
635-
project_id: request.projectId || '',
635+
project_id: request.projectId ?? '',
636636
});
637637
this.initialize();
638638
return this.innerApiCalls.beginTransaction(request, options, callback);
@@ -741,7 +741,7 @@ export class DatastoreClient {
741741
options.otherArgs.headers = options.otherArgs.headers || {};
742742
options.otherArgs.headers['x-goog-request-params'] =
743743
this._gaxModule.routingHeader.fromParams({
744-
project_id: request.projectId || '',
744+
project_id: request.projectId ?? '',
745745
});
746746
this.initialize();
747747
return this.innerApiCalls.commit(request, options, callback);
@@ -832,7 +832,7 @@ export class DatastoreClient {
832832
options.otherArgs.headers = options.otherArgs.headers || {};
833833
options.otherArgs.headers['x-goog-request-params'] =
834834
this._gaxModule.routingHeader.fromParams({
835-
project_id: request.projectId || '',
835+
project_id: request.projectId ?? '',
836836
});
837837
this.initialize();
838838
return this.innerApiCalls.rollback(request, options, callback);
@@ -924,7 +924,7 @@ export class DatastoreClient {
924924
options.otherArgs.headers = options.otherArgs.headers || {};
925925
options.otherArgs.headers['x-goog-request-params'] =
926926
this._gaxModule.routingHeader.fromParams({
927-
project_id: request.projectId || '',
927+
project_id: request.projectId ?? '',
928928
});
929929
this.initialize();
930930
return this.innerApiCalls.allocateIds(request, options, callback);
@@ -1016,7 +1016,7 @@ export class DatastoreClient {
10161016
options.otherArgs.headers = options.otherArgs.headers || {};
10171017
options.otherArgs.headers['x-goog-request-params'] =
10181018
this._gaxModule.routingHeader.fromParams({
1019-
project_id: request.projectId || '',
1019+
project_id: request.projectId ?? '',
10201020
});
10211021
this.initialize();
10221022
return this.innerApiCalls.reserveIds(request, options, callback);

0 commit comments

Comments
 (0)