Skip to content

Commit

Permalink
fix: include 'x-goog-request-params' header in requests (#149)
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 0787b3c commit c74babd
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 5 deletions.
98 changes: 98 additions & 0 deletions packages/google-cloud-automl/src/v1beta1/auto_ml_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/google-cloud-automl/synth.metadata
Original file line number Diff line number Diff line change
@@ -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"
}
},
{
Expand Down

0 comments on commit c74babd

Please sign in to comment.