|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +/* |
| 6 | + * This file has been auto generated by Jane, |
| 7 | + * |
| 8 | + * Do no edit it directly. |
| 9 | + */ |
| 10 | + |
| 11 | +namespace Docker\API\Endpoint; |
| 12 | + |
| 13 | +class ConfigList extends \Jane\OpenApiRuntime\Client\BaseEndpoint |
| 14 | +{ |
| 15 | + /** |
| 16 | + * @param array $queryParameters { |
| 17 | + * |
| 18 | + * @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list. Available filters: |
| 19 | +
|
| 20 | + - `id=<config id>` |
| 21 | + - `label=<key> or label=<key>=value` |
| 22 | + - `name=<config name>` |
| 23 | + - `names=<config name>` |
| 24 | +
|
| 25 | + * } |
| 26 | + */ |
| 27 | + public function __construct(array $queryParameters = []) |
| 28 | + { |
| 29 | + $this->queryParameters = $queryParameters; |
| 30 | + } |
| 31 | + |
| 32 | + public function getMethod(): string |
| 33 | + { |
| 34 | + return 'GET'; |
| 35 | + } |
| 36 | + |
| 37 | + public function getUri(): string |
| 38 | + { |
| 39 | + return '/configs'; |
| 40 | + } |
| 41 | + |
| 42 | + public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null) |
| 43 | + { |
| 44 | + return [[], null]; |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * {@inheritdoc} |
| 49 | + * |
| 50 | + * @throws \Docker\API\Exception\ConfigListInternalServerErrorException |
| 51 | + * @throws \Docker\API\Exception\ConfigListServiceUnavailableException |
| 52 | + * |
| 53 | + * @return null|\Docker\API\Model\Config[] |
| 54 | + */ |
| 55 | + public function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer) |
| 56 | + { |
| 57 | + if (200 === $status) { |
| 58 | + return $serializer->deserialize($body, 'Docker\\API\\Model\\Config[]', 'json'); |
| 59 | + } |
| 60 | + if (500 === $status) { |
| 61 | + throw new \Docker\API\Exception\ConfigListInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); |
| 62 | + } |
| 63 | + if (503 === $status) { |
| 64 | + throw new \Docker\API\Exception\ConfigListServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json')); |
| 65 | + } |
| 66 | + } |
| 67 | + |
| 68 | + public function getExtraHeaders(): array |
| 69 | + { |
| 70 | + return ['Accept' => ['application/json']]; |
| 71 | + } |
| 72 | + |
| 73 | + protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver |
| 74 | + { |
| 75 | + $optionsResolver = parent::getQueryOptionsResolver(); |
| 76 | + $optionsResolver->setDefined(['filters']); |
| 77 | + $optionsResolver->setRequired([]); |
| 78 | + $optionsResolver->setDefaults([]); |
| 79 | + $optionsResolver->setAllowedTypes('filters', ['string']); |
| 80 | + |
| 81 | + return $optionsResolver; |
| 82 | + } |
| 83 | +} |
0 commit comments