Skip to content

Commit

Permalink
Operation "backend.statistic.getTestCoverage" was added
Browse files Browse the repository at this point in the history
  • Loading branch information
SDKgen-Bot committed Jul 27, 2024
1 parent 5403bed commit f3e68db
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdkgen.lock

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions src/BackendStatisticTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,45 @@ public function getTimeAverage(?int $startIndex = null, ?int $count = null, ?str
}
}

/**
* @return BackendStatisticChart
* @throws CommonMessageException
* @throws ClientException
*/
public function getTestCoverage(): BackendStatisticChart
{
$url = $this->parser->url('/backend/statistic/test_coverage', [
]);

$options = [
'query' => $this->parser->query([
], [
]),
];

try {
$response = $this->httpClient->request('GET', $url, $options);
$data = (string) $response->getBody();

return $this->parser->parse($data, BackendStatisticChart::class);
} catch (ClientException $e) {
throw $e;
} catch (BadResponseException $e) {
$data = (string) $e->getResponse()->getBody();

switch ($e->getResponse()->getStatusCode()) {
case 401:
throw new CommonMessageException($this->parser->parse($data, CommonMessage::class));
case 500:
throw new CommonMessageException($this->parser->parse($data, CommonMessage::class));
default:
throw new UnknownStatusCodeException('The server returned an unknown status code');
}
} catch (\Throwable $e) {
throw new ClientException('An unknown error occurred: ' . $e->getMessage());
}
}

/**
* @param int|null $startIndex
* @param int|null $count
Expand Down

0 comments on commit f3e68db

Please sign in to comment.