From 005e89fdc1117f947e9bd75d6a6f17ae31c8de12 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 28 Mar 2019 15:00:31 -0700 Subject: [PATCH] fix: include 'x-goog-request-params' header in requests (#146) fix: include 'x-goog-request-params' header in requests --- .../src/v1/cloud_redis_client.js | 42 +++++++++++++++++++ .../src/v1beta1/cloud_redis_client.js | 35 ++++++++++++++++ packages/google-cloud-redis/synth.metadata | 10 ++--- 3 files changed, 82 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-redis/src/v1/cloud_redis_client.js b/packages/google-cloud-redis/src/v1/cloud_redis_client.js index e14043efbd4..9797a45e4c7 100644 --- a/packages/google-cloud-redis/src/v1/cloud_redis_client.js +++ b/packages/google-cloud-redis/src/v1/cloud_redis_client.js @@ -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); } @@ -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); } @@ -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); } @@ -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); } @@ -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); } @@ -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); } diff --git a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.js b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.js index 1a2f21f7421..95913d6a65a 100644 --- a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.js +++ b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.js @@ -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); } @@ -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); } @@ -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); } @@ -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); } @@ -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); } diff --git a/packages/google-cloud-redis/synth.metadata b/packages/google-cloud-redis/synth.metadata index 682569137c7..aa621067f79 100644 --- a/packages/google-cloud-redis/synth.metadata +++ b/packages/google-cloud-redis/synth.metadata @@ -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" } }, {