Skip to content

Commit 482e745

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
fix: include 'x-goog-request-params' header in requests (#562)
1 parent 38502ad commit 482e745

File tree

3 files changed

+194
-5
lines changed

3 files changed

+194
-5
lines changed

src/v1/publisher_client.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ class PublisherClient {
345345
options = {};
346346
}
347347
options = options || {};
348+
options.otherArgs = options.otherArgs || {};
349+
options.otherArgs.headers = options.otherArgs.headers || {};
350+
options.otherArgs.headers[
351+
'x-goog-request-params'
352+
] = gax.routingHeader.fromParams({
353+
name: request.name,
354+
});
348355

349356
return this._innerApiCalls.createTopic(request, options, callback);
350357
}
@@ -407,6 +414,13 @@ class PublisherClient {
407414
options = {};
408415
}
409416
options = options || {};
417+
options.otherArgs = options.otherArgs || {};
418+
options.otherArgs.headers = options.otherArgs.headers || {};
419+
options.otherArgs.headers[
420+
'x-goog-request-params'
421+
] = gax.routingHeader.fromParams({
422+
'topic.name': request.topic.name,
423+
});
410424

411425
return this._innerApiCalls.updateTopic(request, options, callback);
412426
}
@@ -468,6 +482,13 @@ class PublisherClient {
468482
options = {};
469483
}
470484
options = options || {};
485+
options.otherArgs = options.otherArgs || {};
486+
options.otherArgs.headers = options.otherArgs.headers || {};
487+
options.otherArgs.headers[
488+
'x-goog-request-params'
489+
] = gax.routingHeader.fromParams({
490+
topic: request.topic,
491+
});
471492

472493
return this._innerApiCalls.publish(request, options, callback);
473494
}
@@ -515,6 +536,13 @@ class PublisherClient {
515536
options = {};
516537
}
517538
options = options || {};
539+
options.otherArgs = options.otherArgs || {};
540+
options.otherArgs.headers = options.otherArgs.headers || {};
541+
options.otherArgs.headers[
542+
'x-goog-request-params'
543+
] = gax.routingHeader.fromParams({
544+
topic: request.topic,
545+
});
518546

519547
return this._innerApiCalls.getTopic(request, options, callback);
520548
}
@@ -610,6 +638,13 @@ class PublisherClient {
610638
options = {};
611639
}
612640
options = options || {};
641+
options.otherArgs = options.otherArgs || {};
642+
options.otherArgs.headers = options.otherArgs.headers || {};
643+
options.otherArgs.headers[
644+
'x-goog-request-params'
645+
] = gax.routingHeader.fromParams({
646+
project: request.project,
647+
});
613648

614649
return this._innerApiCalls.listTopics(request, options, callback);
615650
}
@@ -761,6 +796,13 @@ class PublisherClient {
761796
options = {};
762797
}
763798
options = options || {};
799+
options.otherArgs = options.otherArgs || {};
800+
options.otherArgs.headers = options.otherArgs.headers || {};
801+
options.otherArgs.headers[
802+
'x-goog-request-params'
803+
] = gax.routingHeader.fromParams({
804+
topic: request.topic,
805+
});
764806

765807
return this._innerApiCalls.listTopicSubscriptions(
766808
request,
@@ -864,6 +906,13 @@ class PublisherClient {
864906
options = {};
865907
}
866908
options = options || {};
909+
options.otherArgs = options.otherArgs || {};
910+
options.otherArgs.headers = options.otherArgs.headers || {};
911+
options.otherArgs.headers[
912+
'x-goog-request-params'
913+
] = gax.routingHeader.fromParams({
914+
topic: request.topic,
915+
});
867916

868917
return this._innerApiCalls.deleteTopic(request, options, callback);
869918
}
@@ -925,6 +974,13 @@ class PublisherClient {
925974
options = {};
926975
}
927976
options = options || {};
977+
options.otherArgs = options.otherArgs || {};
978+
options.otherArgs.headers = options.otherArgs.headers || {};
979+
options.otherArgs.headers[
980+
'x-goog-request-params'
981+
] = gax.routingHeader.fromParams({
982+
resource: request.resource,
983+
});
928984

929985
return this._innerApiCalls.setIamPolicy(request, options, callback);
930986
}
@@ -975,6 +1031,13 @@ class PublisherClient {
9751031
options = {};
9761032
}
9771033
options = options || {};
1034+
options.otherArgs = options.otherArgs || {};
1035+
options.otherArgs.headers = options.otherArgs.headers || {};
1036+
options.otherArgs.headers[
1037+
'x-goog-request-params'
1038+
] = gax.routingHeader.fromParams({
1039+
resource: request.resource,
1040+
});
9781041

9791042
return this._innerApiCalls.getIamPolicy(request, options, callback);
9801043
}
@@ -1035,6 +1098,13 @@ class PublisherClient {
10351098
options = {};
10361099
}
10371100
options = options || {};
1101+
options.otherArgs = options.otherArgs || {};
1102+
options.otherArgs.headers = options.otherArgs.headers || {};
1103+
options.otherArgs.headers[
1104+
'x-goog-request-params'
1105+
] = gax.routingHeader.fromParams({
1106+
resource: request.resource,
1107+
});
10381108

10391109
return this._innerApiCalls.testIamPermissions(request, options, callback);
10401110
}

src/v1/subscriber_client.js

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ class SubscriberClient {
424424
options = {};
425425
}
426426
options = options || {};
427+
options.otherArgs = options.otherArgs || {};
428+
options.otherArgs.headers = options.otherArgs.headers || {};
429+
options.otherArgs.headers[
430+
'x-goog-request-params'
431+
] = gax.routingHeader.fromParams({
432+
name: request.name,
433+
});
427434

428435
return this._innerApiCalls.createSubscription(request, options, callback);
429436
}
@@ -471,6 +478,13 @@ class SubscriberClient {
471478
options = {};
472479
}
473480
options = options || {};
481+
options.otherArgs = options.otherArgs || {};
482+
options.otherArgs.headers = options.otherArgs.headers || {};
483+
options.otherArgs.headers[
484+
'x-goog-request-params'
485+
] = gax.routingHeader.fromParams({
486+
subscription: request.subscription,
487+
});
474488

475489
return this._innerApiCalls.getSubscription(request, options, callback);
476490
}
@@ -537,6 +551,13 @@ class SubscriberClient {
537551
options = {};
538552
}
539553
options = options || {};
554+
options.otherArgs = options.otherArgs || {};
555+
options.otherArgs.headers = options.otherArgs.headers || {};
556+
options.otherArgs.headers[
557+
'x-goog-request-params'
558+
] = gax.routingHeader.fromParams({
559+
'subscription.name': request.subscription.name,
560+
});
540561

541562
return this._innerApiCalls.updateSubscription(request, options, callback);
542563
}
@@ -632,6 +653,13 @@ class SubscriberClient {
632653
options = {};
633654
}
634655
options = options || {};
656+
options.otherArgs = options.otherArgs || {};
657+
options.otherArgs.headers = options.otherArgs.headers || {};
658+
options.otherArgs.headers[
659+
'x-goog-request-params'
660+
] = gax.routingHeader.fromParams({
661+
project: request.project,
662+
});
635663

636664
return this._innerApiCalls.listSubscriptions(request, options, callback);
637665
}
@@ -731,6 +759,13 @@ class SubscriberClient {
731759
options = {};
732760
}
733761
options = options || {};
762+
options.otherArgs = options.otherArgs || {};
763+
options.otherArgs.headers = options.otherArgs.headers || {};
764+
options.otherArgs.headers[
765+
'x-goog-request-params'
766+
] = gax.routingHeader.fromParams({
767+
subscription: request.subscription,
768+
});
734769

735770
return this._innerApiCalls.deleteSubscription(request, options, callback);
736771
}
@@ -792,6 +827,13 @@ class SubscriberClient {
792827
options = {};
793828
}
794829
options = options || {};
830+
options.otherArgs = options.otherArgs || {};
831+
options.otherArgs.headers = options.otherArgs.headers || {};
832+
options.otherArgs.headers[
833+
'x-goog-request-params'
834+
] = gax.routingHeader.fromParams({
835+
subscription: request.subscription,
836+
});
795837

796838
return this._innerApiCalls.modifyAckDeadline(request, options, callback);
797839
}
@@ -845,6 +887,13 @@ class SubscriberClient {
845887
options = {};
846888
}
847889
options = options || {};
890+
options.otherArgs = options.otherArgs || {};
891+
options.otherArgs.headers = options.otherArgs.headers || {};
892+
options.otherArgs.headers[
893+
'x-goog-request-params'
894+
] = gax.routingHeader.fromParams({
895+
subscription: request.subscription,
896+
});
848897

849898
return this._innerApiCalls.acknowledge(request, options, callback);
850899
}
@@ -907,6 +956,13 @@ class SubscriberClient {
907956
options = {};
908957
}
909958
options = options || {};
959+
options.otherArgs = options.otherArgs || {};
960+
options.otherArgs.headers = options.otherArgs.headers || {};
961+
options.otherArgs.headers[
962+
'x-goog-request-params'
963+
] = gax.routingHeader.fromParams({
964+
subscription: request.subscription,
965+
});
910966

911967
return this._innerApiCalls.pull(request, options, callback);
912968
}
@@ -1008,6 +1064,13 @@ class SubscriberClient {
10081064
options = {};
10091065
}
10101066
options = options || {};
1067+
options.otherArgs = options.otherArgs || {};
1068+
options.otherArgs.headers = options.otherArgs.headers || {};
1069+
options.otherArgs.headers[
1070+
'x-goog-request-params'
1071+
] = gax.routingHeader.fromParams({
1072+
subscription: request.subscription,
1073+
});
10111074

10121075
return this._innerApiCalls.modifyPushConfig(request, options, callback);
10131076
}
@@ -1111,6 +1174,13 @@ class SubscriberClient {
11111174
options = {};
11121175
}
11131176
options = options || {};
1177+
options.otherArgs = options.otherArgs || {};
1178+
options.otherArgs.headers = options.otherArgs.headers || {};
1179+
options.otherArgs.headers[
1180+
'x-goog-request-params'
1181+
] = gax.routingHeader.fromParams({
1182+
project: request.project,
1183+
});
11141184

11151185
return this._innerApiCalls.listSnapshots(request, options, callback);
11161186
}
@@ -1258,6 +1328,13 @@ class SubscriberClient {
12581328
options = {};
12591329
}
12601330
options = options || {};
1331+
options.otherArgs = options.otherArgs || {};
1332+
options.otherArgs.headers = options.otherArgs.headers || {};
1333+
options.otherArgs.headers[
1334+
'x-goog-request-params'
1335+
] = gax.routingHeader.fromParams({
1336+
name: request.name,
1337+
});
12611338

12621339
return this._innerApiCalls.createSnapshot(request, options, callback);
12631340
}
@@ -1335,6 +1412,13 @@ class SubscriberClient {
13351412
options = {};
13361413
}
13371414
options = options || {};
1415+
options.otherArgs = options.otherArgs || {};
1416+
options.otherArgs.headers = options.otherArgs.headers || {};
1417+
options.otherArgs.headers[
1418+
'x-goog-request-params'
1419+
] = gax.routingHeader.fromParams({
1420+
'snapshot.name': request.snapshot.name,
1421+
});
13381422

13391423
return this._innerApiCalls.updateSnapshot(request, options, callback);
13401424
}
@@ -1386,6 +1470,13 @@ class SubscriberClient {
13861470
options = {};
13871471
}
13881472
options = options || {};
1473+
options.otherArgs = options.otherArgs || {};
1474+
options.otherArgs.headers = options.otherArgs.headers || {};
1475+
options.otherArgs.headers[
1476+
'x-goog-request-params'
1477+
] = gax.routingHeader.fromParams({
1478+
snapshot: request.snapshot,
1479+
});
13891480

13901481
return this._innerApiCalls.deleteSnapshot(request, options, callback);
13911482
}
@@ -1460,6 +1551,13 @@ class SubscriberClient {
14601551
options = {};
14611552
}
14621553
options = options || {};
1554+
options.otherArgs = options.otherArgs || {};
1555+
options.otherArgs.headers = options.otherArgs.headers || {};
1556+
options.otherArgs.headers[
1557+
'x-goog-request-params'
1558+
] = gax.routingHeader.fromParams({
1559+
subscription: request.subscription,
1560+
});
14631561

14641562
return this._innerApiCalls.seek(request, options, callback);
14651563
}
@@ -1521,6 +1619,13 @@ class SubscriberClient {
15211619
options = {};
15221620
}
15231621
options = options || {};
1622+
options.otherArgs = options.otherArgs || {};
1623+
options.otherArgs.headers = options.otherArgs.headers || {};
1624+
options.otherArgs.headers[
1625+
'x-goog-request-params'
1626+
] = gax.routingHeader.fromParams({
1627+
resource: request.resource,
1628+
});
15241629

15251630
return this._innerApiCalls.setIamPolicy(request, options, callback);
15261631
}
@@ -1571,6 +1676,13 @@ class SubscriberClient {
15711676
options = {};
15721677
}
15731678
options = options || {};
1679+
options.otherArgs = options.otherArgs || {};
1680+
options.otherArgs.headers = options.otherArgs.headers || {};
1681+
options.otherArgs.headers[
1682+
'x-goog-request-params'
1683+
] = gax.routingHeader.fromParams({
1684+
resource: request.resource,
1685+
});
15741686

15751687
return this._innerApiCalls.getIamPolicy(request, options, callback);
15761688
}
@@ -1631,6 +1743,13 @@ class SubscriberClient {
16311743
options = {};
16321744
}
16331745
options = options || {};
1746+
options.otherArgs = options.otherArgs || {};
1747+
options.otherArgs.headers = options.otherArgs.headers || {};
1748+
options.otherArgs.headers[
1749+
'x-goog-request-params'
1750+
] = gax.routingHeader.fromParams({
1751+
resource: request.resource,
1752+
});
16341753

16351754
return this._innerApiCalls.testIamPermissions(request, options, callback);
16361755
}

0 commit comments

Comments
 (0)