Skip to content

Commit

Permalink
fix: include 'x-goog-request-params' header in requests (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Mar 29, 2019
1 parent ae9c3a4 commit f13c687
Show file tree
Hide file tree
Showing 15 changed files with 551 additions and 5 deletions.
42 changes: 42 additions & 0 deletions packages/google-cloud-dialogflow/src/v2/agents_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@ class AgentsClient {
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.getAgent(request, options, callback);
}
Expand Down Expand Up @@ -427,6 +434,13 @@ class AgentsClient {
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.searchAgents(request, options, callback);
}
Expand Down Expand Up @@ -577,6 +591,13 @@ class AgentsClient {
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.trainAgent(request, options, callback);
}
Expand Down Expand Up @@ -676,6 +697,13 @@ class AgentsClient {
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.exportAgent(request, options, callback);
}
Expand Down Expand Up @@ -792,6 +820,13 @@ class AgentsClient {
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.importAgent(request, options, callback);
}
Expand Down Expand Up @@ -907,6 +942,13 @@ class AgentsClient {
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.restoreAgent(request, options, callback);
}
Expand Down
42 changes: 42 additions & 0 deletions packages/google-cloud-dialogflow/src/v2/contexts_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ class ContextsClient {
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.listContexts(request, options, callback);
}
Expand Down Expand Up @@ -413,6 +420,13 @@ class ContextsClient {
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.getContext(request, options, callback);
}
Expand Down Expand Up @@ -469,6 +483,13 @@ class ContextsClient {
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.createContext(request, options, callback);
}
Expand Down Expand Up @@ -521,6 +542,13 @@ class ContextsClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
'context.name': request.context.name,
});

return this._innerApiCalls.updateContext(request, options, callback);
}
Expand Down Expand Up @@ -560,6 +588,13 @@ class ContextsClient {
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.deleteContext(request, options, callback);
}
Expand Down Expand Up @@ -599,6 +634,13 @@ class ContextsClient {
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.deleteAllContexts(request, options, callback);
}
Expand Down
70 changes: 70 additions & 0 deletions packages/google-cloud-dialogflow/src/v2/entity_types_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ class EntityTypesClient {
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.listEntityTypes(request, options, callback);
}
Expand Down Expand Up @@ -534,6 +541,13 @@ class EntityTypesClient {
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.getEntityType(request, options, callback);
}
Expand Down Expand Up @@ -596,6 +610,13 @@ class EntityTypesClient {
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.createEntityType(request, options, callback);
}
Expand Down Expand Up @@ -655,6 +676,13 @@ class EntityTypesClient {
options = {};
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
'entity_type.name': request.entityType.name,
});

return this._innerApiCalls.updateEntityType(request, options, callback);
}
Expand Down Expand Up @@ -694,6 +722,13 @@ class EntityTypesClient {
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.deleteEntityType(request, options, callback);
}
Expand Down Expand Up @@ -808,6 +843,13 @@ class EntityTypesClient {
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.batchUpdateEntityTypes(
request,
Expand Down Expand Up @@ -924,6 +966,13 @@ class EntityTypesClient {
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.batchDeleteEntityTypes(
request,
Expand Down Expand Up @@ -1047,6 +1096,13 @@ class EntityTypesClient {
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.batchCreateEntities(request, options, callback);
}
Expand Down Expand Up @@ -1171,6 +1227,13 @@ class EntityTypesClient {
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.batchUpdateEntities(request, options, callback);
}
Expand Down Expand Up @@ -1290,6 +1353,13 @@ class EntityTypesClient {
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.batchDeleteEntities(request, options, callback);
}
Expand Down
Loading

0 comments on commit f13c687

Please sign in to comment.