Skip to content

Commit

Permalink
Add additional request name headers (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and dwsupplee committed Mar 28, 2019
1 parent da46332 commit f80234b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
15 changes: 15 additions & 0 deletions ErrorReporting/src/V1beta1/Gapic/ErrorGroupServiceGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RequestParamsHeaderDescriptor;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
Expand Down Expand Up @@ -292,6 +293,13 @@ public function getGroup($groupName, array $optionalArgs = [])
$request = new GetGroupRequest();
$request->setGroupName($groupName);

$requestParams = new RequestParamsHeaderDescriptor([
'group_name' => $request->getGroupName(),
]);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();

return $this->startCall(
'GetGroup',
ErrorGroup::class,
Expand Down Expand Up @@ -336,6 +344,13 @@ public function updateGroup($group, array $optionalArgs = [])
$request = new UpdateGroupRequest();
$request->setGroup($group);

$requestParams = new RequestParamsHeaderDescriptor([
'group.name' => $request->getGroup()->getName(),
]);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();

return $this->startCall(
'UpdateGroup',
ErrorGroup::class,
Expand Down
22 changes: 22 additions & 0 deletions ErrorReporting/src/V1beta1/Gapic/ErrorStatsServiceGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RequestParamsHeaderDescriptor;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
Expand Down Expand Up @@ -389,6 +390,13 @@ public function listGroupStats($projectName, $timeRange, array $optionalArgs = [
$request->setPageToken($optionalArgs['pageToken']);
}

$requestParams = new RequestParamsHeaderDescriptor([
'project_name' => $request->getProjectName(),
]);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();

return $this->getPagedListResponse(
'ListGroupStats',
$optionalArgs,
Expand Down Expand Up @@ -483,6 +491,13 @@ public function listEvents($projectName, $groupId, array $optionalArgs = [])
$request->setPageToken($optionalArgs['pageToken']);
}

$requestParams = new RequestParamsHeaderDescriptor([
'project_name' => $request->getProjectName(),
]);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();

return $this->getPagedListResponse(
'ListEvents',
$optionalArgs,
Expand Down Expand Up @@ -530,6 +545,13 @@ public function deleteEvents($projectName, array $optionalArgs = [])
$request = new DeleteEventsRequest();
$request->setProjectName($projectName);

$requestParams = new RequestParamsHeaderDescriptor([
'project_name' => $request->getProjectName(),
]);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();

return $this->startCall(
'DeleteEvents',
DeleteEventsResponse::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RequestParamsHeaderDescriptor;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
Expand Down Expand Up @@ -299,6 +300,13 @@ public function reportErrorEvent($projectName, $event, array $optionalArgs = [])
$request->setProjectName($projectName);
$request->setEvent($event);

$requestParams = new RequestParamsHeaderDescriptor([
'project_name' => $request->getProjectName(),
]);
$optionalArgs['headers'] = isset($optionalArgs['headers'])
? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
: $requestParams->getHeader();

return $this->startCall(
'ReportErrorEvent',
ReportErrorEventResponse::class,
Expand Down
10 changes: 5 additions & 5 deletions ErrorReporting/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-02-26T11:00:08.066885Z",
"updateTime": "2019-03-28T10:00:57.378625Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.14",
"dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7"
"version": "0.16.20",
"dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "29f098cb03a9983cc9cb15993de5da64419046f2",
"internalRef": "235621085"
"sha": "6a84b3267b0a95e922608b9891219075047eee29",
"internalRef": "240640999"
}
}
],
Expand Down

0 comments on commit f80234b

Please sign in to comment.