Skip to content

Commit 8017676

Browse files
Ridflavioheleno
authored andcommitted
Generate fresh api client
Signed-off-by: Grant Millar <rid@cylo.io>
1 parent 33057a8 commit 8017676

767 files changed

Lines changed: 40192 additions & 28554 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Client.php

Lines changed: 1843 additions & 1973 deletions
Large diffs are not rendered by default.

src/Endpoint/BuildPrune.php

Lines changed: 46 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,83 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
namespace Docker\API\Endpoint;
64

75
class BuildPrune extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint
86
{
9-
use \Docker\API\Runtime\Client\EndpointTrait;
10-
117
/**
12-
* @param array $queryParameters {
13-
*
14-
* @var int $keep-storage Amount of disk space in bytes to keep for cache
15-
* @var bool $all Remove all types of build cache
16-
* @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
17-
* process on the list of build cache objects.
18-
*
19-
* Available filters:
20-
*
21-
* - `until=<duration>`: duration relative to daemon's time, during which build cache was not used, in Go's duration format (e.g., '24h')
22-
* - `id=<id>`
23-
* - `parent=<id>`
24-
* - `type=<string>`
25-
* - `description=<string>`
26-
* - `inuse`
27-
* - `shared`
28-
* - `private`
29-
*
30-
* }
31-
*/
32-
public function __construct(array $queryParameters = [])
8+
*
9+
*
10+
* @param array $queryParameters {
11+
* @var int $keep-storage Amount of disk space in bytes to keep for cache
12+
* @var bool $all Remove all types of build cache
13+
* @var string $filters A JSON encoded value of the filters (a `map[string][]string`) to
14+
process on the list of build cache objects.
15+
16+
Available filters:
17+
18+
- `until=<duration>`: duration relative to daemon's time, during which build cache was not used, in Go's duration format (e.g., '24h')
19+
- `id=<id>`
20+
- `parent=<id>`
21+
- `type=<string>`
22+
- `description=<string>`
23+
- `inuse`
24+
- `shared`
25+
- `private`
26+
27+
* }
28+
*/
29+
public function __construct(array $queryParameters = array())
3330
{
3431
$this->queryParameters = $queryParameters;
3532
}
36-
37-
public function getMethod(): string
33+
use \Docker\API\Runtime\Client\EndpointTrait;
34+
public function getMethod() : string
3835
{
3936
return 'POST';
4037
}
41-
42-
public function getUri(): string
38+
public function getUri() : string
4339
{
4440
return '/build/prune';
4541
}
46-
47-
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
42+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
4843
{
49-
return [[], null];
44+
return array(array(), null);
5045
}
51-
52-
public function getExtraHeaders(): array
46+
public function getExtraHeaders() : array
5347
{
54-
return ['Accept' => ['application/json']];
48+
return array('Accept' => array('application/json'));
5549
}
56-
57-
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
50+
protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver
5851
{
5952
$optionsResolver = parent::getQueryOptionsResolver();
60-
$optionsResolver->setDefined(['keep-storage', 'all', 'filters']);
61-
$optionsResolver->setRequired([]);
62-
$optionsResolver->setDefaults([]);
63-
$optionsResolver->setAllowedTypes('keep-storage', ['int']);
64-
$optionsResolver->setAllowedTypes('all', ['bool']);
65-
$optionsResolver->setAllowedTypes('filters', ['string']);
66-
53+
$optionsResolver->setDefined(array('keep-storage', 'all', 'filters'));
54+
$optionsResolver->setRequired(array());
55+
$optionsResolver->setDefaults(array());
56+
$optionsResolver->addAllowedTypes('keep-storage', array('int'));
57+
$optionsResolver->addAllowedTypes('all', array('bool'));
58+
$optionsResolver->addAllowedTypes('filters', array('string'));
6759
return $optionsResolver;
6860
}
69-
7061
/**
7162
* {@inheritdoc}
7263
*
7364
* @throws \Docker\API\Exception\BuildPruneInternalServerErrorException
7465
*
75-
* @return \Docker\API\Model\BuildPrunePostResponse200|null
66+
* @return null|\Docker\API\Model\BuildPrunePostResponse200
7667
*/
77-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
68+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
7869
{
79-
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
70+
$status = $response->getStatusCode();
71+
$body = (string) $response->getBody();
72+
if (is_null($contentType) === false && (200 === $status && mb_strpos($contentType, 'application/json') !== false)) {
8073
return $serializer->deserialize($body, 'Docker\\API\\Model\\BuildPrunePostResponse200', 'json');
8174
}
82-
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
83-
throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
75+
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
76+
throw new \Docker\API\Exception\BuildPruneInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
8477
}
8578
}
86-
87-
public function getAuthenticationScopes(): array
79+
public function getAuthenticationScopes() : array
8880
{
89-
return [];
81+
return array();
9082
}
91-
}
83+
}

src/Endpoint/ConfigCreate.php

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,66 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
namespace Docker\API\Endpoint;
64

75
class ConfigCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint
86
{
9-
use \Docker\API\Runtime\Client\EndpointTrait;
10-
7+
/**
8+
*
9+
*
10+
* @param null|\Docker\API\Model\ConfigsCreatePostBody $requestBody
11+
*/
1112
public function __construct(?\Docker\API\Model\ConfigsCreatePostBody $requestBody = null)
1213
{
1314
$this->body = $requestBody;
1415
}
15-
16-
public function getMethod(): string
16+
use \Docker\API\Runtime\Client\EndpointTrait;
17+
public function getMethod() : string
1718
{
1819
return 'POST';
1920
}
20-
21-
public function getUri(): string
21+
public function getUri() : string
2222
{
2323
return '/configs/create';
2424
}
25-
26-
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
25+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
2726
{
2827
if ($this->body instanceof \Docker\API\Model\ConfigsCreatePostBody) {
29-
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
28+
return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json'));
3029
}
31-
32-
return [[], null];
30+
return array(array(), null);
3331
}
34-
35-
public function getExtraHeaders(): array
32+
public function getExtraHeaders() : array
3633
{
37-
return ['Accept' => ['application/json']];
34+
return array('Accept' => array('application/json'));
3835
}
39-
4036
/**
4137
* {@inheritdoc}
4238
*
4339
* @throws \Docker\API\Exception\ConfigCreateConflictException
4440
* @throws \Docker\API\Exception\ConfigCreateInternalServerErrorException
4541
* @throws \Docker\API\Exception\ConfigCreateServiceUnavailableException
4642
*
47-
* @return \Docker\API\Model\IdResponse|null
43+
* @return null|\Docker\API\Model\IdResponse
4844
*/
49-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
45+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
5046
{
51-
if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) {
47+
$status = $response->getStatusCode();
48+
$body = (string) $response->getBody();
49+
if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) {
5250
return $serializer->deserialize($body, 'Docker\\API\\Model\\IdResponse', 'json');
5351
}
54-
if ((null === $contentType) === false && (409 === $status && false !== mb_strpos($contentType, 'application/json'))) {
55-
throw new \Docker\API\Exception\ConfigCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
52+
if (is_null($contentType) === false && (409 === $status && mb_strpos($contentType, 'application/json') !== false)) {
53+
throw new \Docker\API\Exception\ConfigCreateConflictException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5654
}
57-
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
58-
throw new \Docker\API\Exception\ConfigCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
55+
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
56+
throw new \Docker\API\Exception\ConfigCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5957
}
60-
if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) {
61-
throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
58+
if (is_null($contentType) === false && (503 === $status && mb_strpos($contentType, 'application/json') !== false)) {
59+
throw new \Docker\API\Exception\ConfigCreateServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
6260
}
6361
}
64-
65-
public function getAuthenticationScopes(): array
62+
public function getAuthenticationScopes() : array
6663
{
67-
return [];
64+
return array();
6865
}
69-
}
66+
}

src/Endpoint/ConfigDelete.php

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
namespace Docker\API\Endpoint;
64

75
class ConfigDelete extends \Docker\API\Runtime\Client\BaseEndpoint implements \Docker\API\Runtime\Client\Endpoint
86
{
9-
use \Docker\API\Runtime\Client\EndpointTrait;
107
protected $id;
11-
128
/**
9+
*
10+
*
1311
* @param string $id ID of the config
1412
*/
1513
public function __construct(string $id)
1614
{
1715
$this->id = $id;
1816
}
19-
20-
public function getMethod(): string
17+
use \Docker\API\Runtime\Client\EndpointTrait;
18+
public function getMethod() : string
2119
{
2220
return 'DELETE';
2321
}
24-
25-
public function getUri(): string
22+
public function getUri() : string
2623
{
27-
return str_replace(['{id}'], [$this->id], '/configs/{id}');
24+
return str_replace(array('{id}'), array($this->id), '/configs/{id}');
2825
}
29-
30-
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
26+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
3127
{
32-
return [[], null];
28+
return array(array(), null);
3329
}
34-
35-
public function getExtraHeaders(): array
30+
public function getExtraHeaders() : array
3631
{
37-
return ['Accept' => ['application/json']];
32+
return array('Accept' => array('application/json'));
3833
}
39-
4034
/**
4135
* {@inheritdoc}
4236
*
@@ -46,23 +40,24 @@ public function getExtraHeaders(): array
4640
*
4741
* @return null
4842
*/
49-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
43+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
5044
{
45+
$status = $response->getStatusCode();
46+
$body = (string) $response->getBody();
5147
if (204 === $status) {
5248
}
53-
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
54-
throw new \Docker\API\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
49+
if (is_null($contentType) === false && (404 === $status && mb_strpos($contentType, 'application/json') !== false)) {
50+
throw new \Docker\API\Exception\ConfigDeleteNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5551
}
56-
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
57-
throw new \Docker\API\Exception\ConfigDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
52+
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
53+
throw new \Docker\API\Exception\ConfigDeleteInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
5854
}
59-
if ((null === $contentType) === false && (503 === $status && false !== mb_strpos($contentType, 'application/json'))) {
60-
throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'));
55+
if (is_null($contentType) === false && (503 === $status && mb_strpos($contentType, 'application/json') !== false)) {
56+
throw new \Docker\API\Exception\ConfigDeleteServiceUnavailableException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
6157
}
6258
}
63-
64-
public function getAuthenticationScopes(): array
59+
public function getAuthenticationScopes() : array
6560
{
66-
return [];
61+
return array();
6762
}
68-
}
63+
}

0 commit comments

Comments
 (0)