Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 983411e

Browse files
fix: pass x-goog-request-params header for streaming calls
1 parent 287b89b commit 983411e

File tree

4 files changed

+55
-297
lines changed

4 files changed

+55
-297
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
**/*.log
22
**/node_modules
33
.coverage
4+
coverage
45
.nyc_output
56
docs/
7+
out/
68
build/
79
system-test/secrets.js
810
system-test/*key.json
911
*.lock
10-
**/package-lock.json
1112
.DS_Store
12-
__pycache__
1313
package-lock.json
14+
__pycache__

src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
144144
// identifiers to uniquely identify resources within the API.
145145
// Create useful helper objects for these.
146146
this._pathTemplates = {
147-
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
148147
assessmentPathTemplate: new gaxModule.PathTemplate(
149148
'projects/{project}/assessments/{assessment}'
150149
),
151150
keyPathTemplate: new gaxModule.PathTemplate(
152151
'projects/{project}/keys/{key}'
153152
),
153+
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
154154
};
155155

156156
// Some of the methods on this service return "paged" results,
@@ -901,9 +901,17 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
901901
*/
902902
listKeysStream(
903903
request?: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest,
904-
options?: gax.CallOptions | {}
904+
options?: gax.CallOptions
905905
): Transform {
906906
request = request || {};
907+
options = options || {};
908+
options.otherArgs = options.otherArgs || {};
909+
options.otherArgs.headers = options.otherArgs.headers || {};
910+
options.otherArgs.headers[
911+
'x-goog-request-params'
912+
] = gax.routingHeader.fromParams({
913+
parent: request.parent || '',
914+
});
907915
const callSettings = new gax.CallSettings(options);
908916
return this._descriptors.page.listKeys.createStream(
909917
this._innerApiCalls.listKeys as gax.GaxCall,
@@ -915,29 +923,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
915923
// -- Path templates --
916924
// --------------------
917925

918-
/**
919-
* Return a fully-qualified project resource name string.
920-
*
921-
* @param {string} project
922-
* @returns {string} Resource name string.
923-
*/
924-
projectPath(project: string) {
925-
return this._pathTemplates.projectPathTemplate.render({
926-
project,
927-
});
928-
}
929-
930-
/**
931-
* Parse the project from Project resource.
932-
*
933-
* @param {string} projectName
934-
* A fully-qualified path representing Project resource.
935-
* @returns {string} A string representing the project.
936-
*/
937-
matchProjectFromProjectName(projectName: string) {
938-
return this._pathTemplates.projectPathTemplate.match(projectName).project;
939-
}
940-
941926
/**
942927
* Return a fully-qualified assessment resource name string.
943928
*
@@ -1012,6 +997,29 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
1012997
return this._pathTemplates.keyPathTemplate.match(keyName).key;
1013998
}
1014999

1000+
/**
1001+
* Return a fully-qualified project resource name string.
1002+
*
1003+
* @param {string} project
1004+
* @returns {string} Resource name string.
1005+
*/
1006+
projectPath(project: string) {
1007+
return this._pathTemplates.projectPathTemplate.render({
1008+
project,
1009+
});
1010+
}
1011+
1012+
/**
1013+
* Parse the project from Project resource.
1014+
*
1015+
* @param {string} projectName
1016+
* A fully-qualified path representing Project resource.
1017+
* @returns {string} A string representing the project.
1018+
*/
1019+
matchProjectFromProjectName(projectName: string) {
1020+
return this._pathTemplates.projectPathTemplate.match(projectName).project;
1021+
}
1022+
10151023
/**
10161024
* Terminate the GRPC channel and close the client.
10171025
*

0 commit comments

Comments
 (0)