-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Afosto
committed
Mar 5, 2021
1 parent
3a65b6a
commit 2269644
Showing
80 changed files
with
3,855 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file has been auto generated by Jane, | ||
* | ||
* Do no edit it directly. | ||
*/ | ||
|
||
namespace Afosto\Sdk\Endpoint; | ||
|
||
class CreateTheme extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint | ||
{ | ||
/** | ||
* Add a theme. | ||
*/ | ||
public function __construct(\Afosto\Sdk\Model\TplThemeCreateModel $body) | ||
{ | ||
$this->body = $body; | ||
} | ||
|
||
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait; | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'POST'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return '/tpl/templates/themes'; | ||
} | ||
|
||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
return $this->getSerializedBody($serializer); | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* @throws \Afosto\Sdk\Exception\CreateThemeBadRequestException | ||
* @throws \Afosto\Sdk\Exception\CreateThemeUnauthorizedException | ||
* @throws \Afosto\Sdk\Exception\CreateThemeForbiddenException | ||
* @throws \Afosto\Sdk\Exception\CreateThemeNotFoundException | ||
* @throws \Afosto\Sdk\Exception\CreateThemeInternalServerErrorException | ||
* @throws \Afosto\Sdk\Exception\CreateThemeServiceUnavailableException | ||
* | ||
* @return \Afosto\Sdk\Model\TplTheme|null | ||
*/ | ||
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType) | ||
{ | ||
if (200 === $status) { | ||
return $serializer->deserialize($body, 'Afosto\\Sdk\\Model\\TplTheme', 'json'); | ||
} | ||
if (400 === $status) { | ||
throw new \Afosto\Sdk\Exception\CreateThemeBadRequestException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (401 === $status) { | ||
throw new \Afosto\Sdk\Exception\CreateThemeUnauthorizedException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (403 === $status) { | ||
throw new \Afosto\Sdk\Exception\CreateThemeForbiddenException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (404 === $status) { | ||
throw new \Afosto\Sdk\Exception\CreateThemeNotFoundException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (500 === $status) { | ||
throw new \Afosto\Sdk\Exception\CreateThemeInternalServerErrorException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (503 === $status) { | ||
throw new \Afosto\Sdk\Exception\CreateThemeServiceUnavailableException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file has been auto generated by Jane, | ||
* | ||
* Do no edit it directly. | ||
*/ | ||
|
||
namespace Afosto\Sdk\Endpoint; | ||
|
||
class ListBuilds extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint | ||
{ | ||
protected $id; | ||
|
||
/** | ||
* List a single repository's builds. | ||
* | ||
* @param array $queryParameters { | ||
* | ||
* @var string $secret | ||
* } | ||
* | ||
* @param array $headerParameters { | ||
* | ||
* @var string $x-page | ||
* @var string $x-page-size | ||
* } | ||
*/ | ||
public function __construct(string $id, array $queryParameters = [], array $headerParameters = []) | ||
{ | ||
$this->id = $id; | ||
$this->queryParameters = $queryParameters; | ||
$this->headerParameters = $headerParameters; | ||
} | ||
|
||
use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait; | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'GET'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return str_replace(['{id}'], [$this->id], '/tpl/templates/repositories/{id}/builds'); | ||
} | ||
|
||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
return [[], null]; | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver | ||
{ | ||
$optionsResolver = parent::getQueryOptionsResolver(); | ||
$optionsResolver->setDefined(['secret']); | ||
$optionsResolver->setRequired([]); | ||
$optionsResolver->setDefaults([]); | ||
$optionsResolver->setAllowedTypes('secret', ['string']); | ||
|
||
return $optionsResolver; | ||
} | ||
|
||
protected function getHeadersOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver | ||
{ | ||
$optionsResolver = parent::getHeadersOptionsResolver(); | ||
$optionsResolver->setDefined(['x-page', 'x-page-size']); | ||
$optionsResolver->setRequired([]); | ||
$optionsResolver->setDefaults([]); | ||
$optionsResolver->setAllowedTypes('x-page', ['string']); | ||
$optionsResolver->setAllowedTypes('x-page-size', ['string']); | ||
|
||
return $optionsResolver; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* @throws \Afosto\Sdk\Exception\ListBuildsBadRequestException | ||
* @throws \Afosto\Sdk\Exception\ListBuildsUnauthorizedException | ||
* @throws \Afosto\Sdk\Exception\ListBuildsForbiddenException | ||
* @throws \Afosto\Sdk\Exception\ListBuildsNotFoundException | ||
* @throws \Afosto\Sdk\Exception\ListBuildsInternalServerErrorException | ||
* @throws \Afosto\Sdk\Exception\ListBuildsServiceUnavailableException | ||
* | ||
* @return \Afosto\Sdk\Model\TplBuild[]|null | ||
*/ | ||
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType) | ||
{ | ||
if (200 === $status) { | ||
return $serializer->deserialize($body, 'Afosto\\Sdk\\Model\\TplBuild[]', 'json'); | ||
} | ||
if (400 === $status) { | ||
throw new \Afosto\Sdk\Exception\ListBuildsBadRequestException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (401 === $status) { | ||
throw new \Afosto\Sdk\Exception\ListBuildsUnauthorizedException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (403 === $status) { | ||
throw new \Afosto\Sdk\Exception\ListBuildsForbiddenException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (404 === $status) { | ||
throw new \Afosto\Sdk\Exception\ListBuildsNotFoundException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (500 === $status) { | ||
throw new \Afosto\Sdk\Exception\ListBuildsInternalServerErrorException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
if (503 === $status) { | ||
throw new \Afosto\Sdk\Exception\ListBuildsServiceUnavailableException($serializer->deserialize($body, 'Afosto\\Sdk\\Model\\Error', 'json')); | ||
} | ||
} | ||
} |
Oops, something went wrong.