From c74babd94b455d02feb3657fd12c56663ea50a92 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 28 Mar 2019 15:22:54 -0700 Subject: [PATCH] fix: include 'x-goog-request-params' header in requests (#149) --- .../src/v1beta1/auto_ml_client.js | 98 +++++++++++++++++++ .../src/v1beta1/prediction_service_client.js | 7 ++ packages/google-cloud-automl/synth.metadata | 10 +- 3 files changed, 110 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_client.js b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.js index 019736b6167..423d410dd2c 100644 --- a/packages/google-cloud-automl/src/v1beta1/auto_ml_client.js +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.js @@ -356,6 +356,13 @@ class AutoMlClient { 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.createDataset(request, options, callback); } @@ -402,6 +409,13 @@ class AutoMlClient { 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.getDataset(request, options, callback); } @@ -505,6 +519,13 @@ class AutoMlClient { 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.listDatasets(request, options, callback); } @@ -663,6 +684,13 @@ class AutoMlClient { 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.deleteDataset(request, options, callback); } @@ -775,6 +803,13 @@ class AutoMlClient { 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.importData(request, options, callback); } @@ -886,6 +921,13 @@ class AutoMlClient { 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.exportData(request, options, callback); } @@ -999,6 +1041,13 @@ class AutoMlClient { 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.createModel(request, options, callback); } @@ -1045,6 +1094,13 @@ class AutoMlClient { 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.getModel(request, options, callback); } @@ -1151,6 +1207,13 @@ class AutoMlClient { 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.listModels(request, options, callback); } @@ -1315,6 +1378,13 @@ class AutoMlClient { 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.deleteModel(request, options, callback); } @@ -1363,6 +1433,13 @@ class AutoMlClient { 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.deployModel(request, options, callback); } @@ -1411,6 +1488,13 @@ class AutoMlClient { 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.undeployModel(request, options, callback); } @@ -1457,6 +1541,13 @@ class AutoMlClient { 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.getModelEvaluation(request, options, callback); } @@ -1565,6 +1656,13 @@ class AutoMlClient { 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.listModelEvaluations(request, options, callback); } diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_client.js b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.js index 12d8e5abef1..9be57d81da3 100644 --- a/packages/google-cloud-automl/src/v1beta1/prediction_service_client.js +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.js @@ -245,6 +245,13 @@ class PredictionServiceClient { 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.predict(request, options, callback); } diff --git a/packages/google-cloud-automl/synth.metadata b/packages/google-cloud-automl/synth.metadata index d757c14f51e..af9ec1419ec 100644 --- a/packages/google-cloud-automl/synth.metadata +++ b/packages/google-cloud-automl/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-13T11:08:21.745399Z", + "updateTime": "2019-03-28T11:25:30.156871Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.17", - "dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b" + "version": "0.16.20", + "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e340f4a01ec287f7bb86e2331b5e98c473d10afd", - "internalRef": "238151361" + "sha": "6a84b3267b0a95e922608b9891219075047eee29", + "internalRef": "240640999" } }, {