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

feat: improve support for x-goog-request-params #111

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions src/v1/cloud_build_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.getBuild(request, options, callback);
}
Expand Down Expand Up @@ -530,6 +537,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.cancelBuild(request, options, callback);
}
Expand Down Expand Up @@ -621,6 +635,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.createBuildTrigger(request, options, callback);
}
Expand Down Expand Up @@ -706,6 +727,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.getBuildTrigger(request, options, callback);
}
Expand Down Expand Up @@ -797,6 +825,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.deleteBuildTrigger(request, options, callback);
}
Expand Down Expand Up @@ -890,6 +925,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.updateBuildTrigger(request, options, callback);
}
Expand Down Expand Up @@ -1410,6 +1452,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.createBuild(request, options, callback);
}
Expand Down Expand Up @@ -1529,6 +1578,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.retryBuild(request, options, callback);
}
Expand Down Expand Up @@ -1624,6 +1680,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.runBuildTrigger(request, options, callback);
}
Expand Down Expand Up @@ -1726,6 +1789,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.listBuilds(request, options, callback);
}
Expand Down Expand Up @@ -1764,6 +1834,13 @@ export class CloudBuildClient {
): Transform {
request = request || {};
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
const callSettings = new gax.CallSettings(options);
this.initialize();
return this.descriptors.page.listBuilds.createStream(
Expand Down Expand Up @@ -1799,6 +1876,13 @@ export class CloudBuildClient {
): AsyncIterable<protos.google.devtools.cloudbuild.v1.IBuild> {
request = request || {};
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
options = options || {};
const callSettings = new gax.CallSettings(options);
this.initialize();
Expand Down Expand Up @@ -1904,6 +1988,13 @@ export class CloudBuildClient {
options = optionsOrCallback as gax.CallOptions;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
this.initialize();
return this.innerApiCalls.listBuildTriggers(request, options, callback);
}
Expand Down Expand Up @@ -1940,6 +2031,13 @@ export class CloudBuildClient {
): Transform {
request = request || {};
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
const callSettings = new gax.CallSettings(options);
this.initialize();
return this.descriptors.page.listBuildTriggers.createStream(
Expand Down Expand Up @@ -1973,6 +2071,13 @@ export class CloudBuildClient {
): AsyncIterable<protos.google.devtools.cloudbuild.v1.IBuildTrigger> {
request = request || {};
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers[
'x-goog-request-params'
] = gax.routingHeader.fromParams({
project_id: request.projectId || '',
});
options = options || {};
const callSettings = new gax.CallSettings(options);
this.initialize();
Expand Down
2 changes: 1 addition & 1 deletion synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-cloudbuild.git",
"sha": "cda6e80da542affe1cfc77fcaffbd31ef96d6959"
"sha": "eaa52923d28e6f61c425f7d40a29a15305de9c86"
}
},
{
Expand Down
Loading