Skip to content

Commit

Permalink
fix: include 'x-goog-request-params' header in requests (#146)
Browse files Browse the repository at this point in the history
fix: include 'x-goog-request-params' header in requests
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Mar 28, 2019
1 parent 65e834e commit 005e89f
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
42 changes: 42 additions & 0 deletions packages/google-cloud-redis/src/v1/cloud_redis_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ class CloudRedisClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
parent: request.parent,
});

return this._innerApiCalls.listInstances(request, options, callback);
}
Expand Down Expand Up @@ -490,6 +497,13 @@ class CloudRedisClient {
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.getInstance(request, options, callback);
}
Expand Down Expand Up @@ -642,6 +656,13 @@ class CloudRedisClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
parent: request.parent,
});

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

return this._innerApiCalls.updateInstance(request, options, callback);
}
Expand Down Expand Up @@ -888,6 +916,13 @@ class CloudRedisClient {
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.deleteInstance(request, options, callback);
}
Expand Down Expand Up @@ -1001,6 +1036,13 @@ class CloudRedisClient {
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.failoverInstance(request, options, callback);
}
Expand Down
35 changes: 35 additions & 0 deletions packages/google-cloud-redis/src/v1beta1/cloud_redis_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,13 @@ class CloudRedisClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
parent: request.parent,
});

return this._innerApiCalls.listInstances(request, options, callback);
}
Expand Down Expand Up @@ -472,6 +479,13 @@ class CloudRedisClient {
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.getInstance(request, options, callback);
}
Expand Down Expand Up @@ -624,6 +638,13 @@ class CloudRedisClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
parent: request.parent,
});

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

return this._innerApiCalls.updateInstance(request, options, callback);
}
Expand Down Expand Up @@ -869,6 +897,13 @@ class CloudRedisClient {
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.deleteInstance(request, options, callback);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/google-cloud-redis/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-03-22T11:20:45.231693Z",
"updateTime": "2019-03-28T11:39:26.866269Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.18",
"dockerImage": "googleapis/artman@sha256:e8ac9200640e76d54643f370db71a1556bf254f565ce46b45a467bbcbacbdb37"
"version": "0.16.20",
"dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "e2a116ac081210002ec2e634f1f840a453ebd182",
"internalRef": "239695990"
"sha": "6a84b3267b0a95e922608b9891219075047eee29",
"internalRef": "240640999"
}
},
{
Expand Down

0 comments on commit 005e89f

Please sign in to comment.