Skip to content

Commit

Permalink
fix: include 'x-goog-request-params' header in requests (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Mar 28, 2019
1 parent 38502ad commit 482e745
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 5 deletions.
70 changes: 70 additions & 0 deletions src/v1/publisher_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
name: request.name,
});

return this._innerApiCalls.createTopic(request, options, callback);
}
Expand Down Expand Up @@ -407,6 +414,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
'topic.name': request.topic.name,
});

return this._innerApiCalls.updateTopic(request, options, callback);
}
Expand Down Expand Up @@ -468,6 +482,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
topic: request.topic,
});

return this._innerApiCalls.publish(request, options, callback);
}
Expand Down Expand Up @@ -515,6 +536,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
topic: request.topic,
});

return this._innerApiCalls.getTopic(request, options, callback);
}
Expand Down Expand Up @@ -610,6 +638,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project: request.project,
});

return this._innerApiCalls.listTopics(request, options, callback);
}
Expand Down Expand Up @@ -761,6 +796,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
topic: request.topic,
});

return this._innerApiCalls.listTopicSubscriptions(
request,
Expand Down Expand Up @@ -864,6 +906,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
topic: request.topic,
});

return this._innerApiCalls.deleteTopic(request, options, callback);
}
Expand Down Expand Up @@ -925,6 +974,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
resource: request.resource,
});

return this._innerApiCalls.setIamPolicy(request, options, callback);
}
Expand Down Expand Up @@ -975,6 +1031,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
resource: request.resource,
});

return this._innerApiCalls.getIamPolicy(request, options, callback);
}
Expand Down Expand Up @@ -1035,6 +1098,13 @@ class PublisherClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
resource: request.resource,
});

return this._innerApiCalls.testIamPermissions(request, options, callback);
}
Expand Down
119 changes: 119 additions & 0 deletions src/v1/subscriber_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
name: request.name,
});

return this._innerApiCalls.createSubscription(request, options, callback);
}
Expand Down Expand Up @@ -471,6 +478,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.getSubscription(request, options, callback);
}
Expand Down Expand Up @@ -537,6 +551,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
'subscription.name': request.subscription.name,
});

return this._innerApiCalls.updateSubscription(request, options, callback);
}
Expand Down Expand Up @@ -632,6 +653,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project: request.project,
});

return this._innerApiCalls.listSubscriptions(request, options, callback);
}
Expand Down Expand Up @@ -731,6 +759,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.deleteSubscription(request, options, callback);
}
Expand Down Expand Up @@ -792,6 +827,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.modifyAckDeadline(request, options, callback);
}
Expand Down Expand Up @@ -845,6 +887,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.acknowledge(request, options, callback);
}
Expand Down Expand Up @@ -907,6 +956,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.pull(request, options, callback);
}
Expand Down Expand Up @@ -1008,6 +1064,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.modifyPushConfig(request, options, callback);
}
Expand Down Expand Up @@ -1111,6 +1174,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project: request.project,
});

return this._innerApiCalls.listSnapshots(request, options, callback);
}
Expand Down Expand Up @@ -1258,6 +1328,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
name: request.name,
});

return this._innerApiCalls.createSnapshot(request, options, callback);
}
Expand Down Expand Up @@ -1335,6 +1412,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
'snapshot.name': request.snapshot.name,
});

return this._innerApiCalls.updateSnapshot(request, options, callback);
}
Expand Down Expand Up @@ -1386,6 +1470,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
snapshot: request.snapshot,
});

return this._innerApiCalls.deleteSnapshot(request, options, callback);
}
Expand Down Expand Up @@ -1460,6 +1551,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
subscription: request.subscription,
});

return this._innerApiCalls.seek(request, options, callback);
}
Expand Down Expand Up @@ -1521,6 +1619,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
resource: request.resource,
});

return this._innerApiCalls.setIamPolicy(request, options, callback);
}
Expand Down Expand Up @@ -1571,6 +1676,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
resource: request.resource,
});

return this._innerApiCalls.getIamPolicy(request, options, callback);
}
Expand Down Expand Up @@ -1631,6 +1743,13 @@ class SubscriberClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
resource: request.resource,
});

return this._innerApiCalls.testIamPermissions(request, options, callback);
}
Expand Down
Loading

0 comments on commit 482e745

Please sign in to comment.