Skip to content

Commit aebd5ea

Browse files
authored
Merge pull request #3 from php-etl/feature/update-endpoints
Updated the generated client
2 parents 0beedf3 + b2bc475 commit aebd5ea

File tree

2,088 files changed

+92594
-65929
lines changed

Some content is hidden

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

2,088 files changed

+92594
-65929
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"extra": {
4040
"branch-alias": {
41-
"dev-main": "0.2.x-dev"
41+
"dev-main": "0.3.x-dev"
4242
}
4343
}
4444
}

jane/gyroscops.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/Authentication/ApiKeyAuthentication.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public function __construct(string $apiKey)
2121

2222
public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface
2323
{
24-
return $request->withHeader('Authorization', $this->{'apiKey'});
24+
$request = $request->withHeader('Authorization', $this->{'apiKey'});
25+
26+
return $request;
2527
}
2628

2729
public function getScope(): string

src/Client.php

Lines changed: 1408 additions & 1221 deletions
Large diffs are not rendered by default.

src/Endpoint/AcceptReferralRequestReferralRequestItem.php

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ class AcceptReferralRequestReferralRequestItem extends \Gyroscops\Api\Runtime\Cl
1414
{
1515
use \Gyroscops\Api\Runtime\Client\EndpointTrait;
1616
protected $id;
17+
protected $accept;
1718

1819
/**
1920
* Accepts a referral request.
2021
*
2122
* @param string $id Resource identifier
2223
* @param null $requestBody
24+
* @param array $accept Accept content header application/ld+json|application/json|text/html
2325
*/
24-
public function __construct(string $id, $requestBody = null)
26+
public function __construct(string $id, $requestBody = null, array $accept = [])
2527
{
2628
$this->id = $id;
2729
$this->body = $requestBody;
30+
$this->accept = $accept;
2831
}
2932

3033
public function getMethod(): string
@@ -44,31 +47,42 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
4447

4548
public function getExtraHeaders(): array
4649
{
47-
return ['Accept' => ['application/json']];
50+
if (empty($this->accept)) {
51+
return ['Accept' => ['application/ld+json', 'application/json']];
52+
}
53+
54+
return $this->accept;
4855
}
4956

5057
/**
5158
* {@inheritdoc}
5259
*
53-
* @return \Gyroscops\Api\Model\ReferralRequestReferralRequestRead|null
60+
* @return \Gyroscops\Api\Model\ReferralRequestJsonldReferralRequestRead|\Gyroscops\Api\Model\ReferralRequestReferralRequestRead|null
5461
*
5562
* @throws \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemBadRequestException
5663
* @throws \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemUnprocessableEntityException
5764
* @throws \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemNotFoundException
5865
*/
59-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
66+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
6067
{
61-
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
62-
return $serializer->deserialize($body, \Gyroscops\Api\Model\ReferralRequestReferralRequestRead::class, 'json');
68+
$status = $response->getStatusCode();
69+
$body = (string) $response->getBody();
70+
if (200 === $status) {
71+
if (mb_strpos($contentType, 'application/ld+json') !== false) {
72+
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\ReferralRequestJsonldReferralRequestRead', 'json');
73+
}
74+
if (mb_strpos($contentType, 'application/json') !== false) {
75+
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\ReferralRequestReferralRequestRead', 'json');
76+
}
6377
}
6478
if (400 === $status) {
65-
throw new \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemBadRequestException();
79+
throw new \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemBadRequestException($response);
6680
}
6781
if (422 === $status) {
68-
throw new \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemUnprocessableEntityException();
82+
throw new \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemUnprocessableEntityException($response);
6983
}
7084
if (404 === $status) {
71-
throw new \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemNotFoundException();
85+
throw new \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemNotFoundException($response);
7286
}
7387
}
7488

src/Endpoint/AddAfterPipelineStepPipelineItem.php

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ class AddAfterPipelineStepPipelineItem extends \Gyroscops\Api\Runtime\Client\Bas
1414
{
1515
use \Gyroscops\Api\Runtime\Client\EndpointTrait;
1616
protected $id;
17+
protected $accept;
1718

1819
/**
1920
* Adds a step after another one in a pipeline.
2021
*
2122
* @param string $id Resource identifier
2223
* @param \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInputJsonld|\Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInput|null $requestBody
24+
* @param array $accept Accept content header application/ld+json|application/json|text/html
2325
*/
24-
public function __construct(string $id, $requestBody = null)
26+
public function __construct(string $id, $requestBody = null, array $accept = [])
2527
{
2628
$this->id = $id;
2729
$this->body = $requestBody;
30+
$this->accept = $accept;
2831
}
2932

3033
public function getMethod(): string
@@ -34,13 +37,13 @@ public function getMethod(): string
3437

3538
public function getUri(): string
3639
{
37-
return str_replace(['{id}'], [$this->id], '/runtime/pipeline/{id}/step/{code}/add-after');
40+
return str_replace(['{id}'], [$this->id], '/runtime/pipelines/{id}/steps/{code}/add-after');
3841
}
3942

4043
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
4144
{
4245
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInputJsonld) {
43-
return [['Content-Type' => ['application/ld+json']], $this->body];
46+
return [['Content-Type' => ['application/ld+json']], $serializer->serialize($this->body, 'json')];
4447
}
4548
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInput) {
4649
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
@@ -54,29 +57,42 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
5457

5558
public function getExtraHeaders(): array
5659
{
57-
return ['Accept' => ['application/json']];
60+
if (empty($this->accept)) {
61+
return ['Accept' => ['application/ld+json', 'application/json']];
62+
}
63+
64+
return $this->accept;
5865
}
5966

6067
/**
6168
* {@inheritdoc}
6269
*
70+
* @return \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandJsonldRead|null
71+
*
6372
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemBadRequestException
6473
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemUnprocessableEntityException
6574
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemNotFoundException
6675
*/
67-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
76+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
6877
{
69-
if ((null === $contentType) === false && (202 === $status && false !== mb_strpos($contentType, 'application/json'))) {
70-
return json_decode($body, null, 512, \JSON_THROW_ON_ERROR);
78+
$status = $response->getStatusCode();
79+
$body = (string) $response->getBody();
80+
if (202 === $status) {
81+
if (mb_strpos($contentType, 'application/ld+json') !== false) {
82+
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddAfterPipelineStepCommandJsonldRead', 'json');
83+
}
84+
if (mb_strpos($contentType, 'application/json') !== false) {
85+
return json_decode($body);
86+
}
7187
}
7288
if (400 === $status) {
73-
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemBadRequestException();
89+
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemBadRequestException($response);
7490
}
7591
if (422 === $status) {
76-
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemUnprocessableEntityException();
92+
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemUnprocessableEntityException($response);
7793
}
7894
if (404 === $status) {
79-
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemNotFoundException();
95+
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemNotFoundException($response);
8096
}
8197
}
8298

src/Endpoint/AddBeforePipelineStepPipelineItem.php

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ class AddBeforePipelineStepPipelineItem extends \Gyroscops\Api\Runtime\Client\Ba
1414
{
1515
use \Gyroscops\Api\Runtime\Client\EndpointTrait;
1616
protected $id;
17+
protected $accept;
1718

1819
/**
1920
* Adds a step before another one in a pipeline.
2021
*
2122
* @param string $id Resource identifier
2223
* @param \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInputJsonld|\Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInput|null $requestBody
24+
* @param array $accept Accept content header application/ld+json|application/json|text/html
2325
*/
24-
public function __construct(string $id, $requestBody = null)
26+
public function __construct(string $id, $requestBody = null, array $accept = [])
2527
{
2628
$this->id = $id;
2729
$this->body = $requestBody;
30+
$this->accept = $accept;
2831
}
2932

3033
public function getMethod(): string
@@ -34,13 +37,13 @@ public function getMethod(): string
3437

3538
public function getUri(): string
3639
{
37-
return str_replace(['{id}'], [$this->id], '/runtime/pipeline/{id}/step/{code}/add-before');
40+
return str_replace(['{id}'], [$this->id], '/runtime/pipelines/{id}/steps/{code}/add-before');
3841
}
3942

4043
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
4144
{
4245
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInputJsonld) {
43-
return [['Content-Type' => ['application/ld+json']], $this->body];
46+
return [['Content-Type' => ['application/ld+json']], $serializer->serialize($this->body, 'json')];
4447
}
4548
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInput) {
4649
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
@@ -54,29 +57,42 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
5457

5558
public function getExtraHeaders(): array
5659
{
57-
return ['Accept' => ['application/json']];
60+
if (empty($this->accept)) {
61+
return ['Accept' => ['application/ld+json', 'application/json']];
62+
}
63+
64+
return $this->accept;
5865
}
5966

6067
/**
6168
* {@inheritdoc}
6269
*
70+
* @return \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandJsonldRead|null
71+
*
6372
* @throws \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemBadRequestException
6473
* @throws \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemUnprocessableEntityException
6574
* @throws \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemNotFoundException
6675
*/
67-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
76+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
6877
{
69-
if ((null === $contentType) === false && (202 === $status && false !== mb_strpos($contentType, 'application/json'))) {
70-
return json_decode($body, null, 512, \JSON_THROW_ON_ERROR);
78+
$status = $response->getStatusCode();
79+
$body = (string) $response->getBody();
80+
if (202 === $status) {
81+
if (mb_strpos($contentType, 'application/ld+json') !== false) {
82+
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddBeforePipelineStepCommandJsonldRead', 'json');
83+
}
84+
if (mb_strpos($contentType, 'application/json') !== false) {
85+
return json_decode($body);
86+
}
7187
}
7288
if (400 === $status) {
73-
throw new \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemBadRequestException();
89+
throw new \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemBadRequestException($response);
7490
}
7591
if (422 === $status) {
76-
throw new \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemUnprocessableEntityException();
92+
throw new \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemUnprocessableEntityException($response);
7793
}
7894
if (404 === $status) {
79-
throw new \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemNotFoundException();
95+
throw new \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemNotFoundException($response);
8096
}
8197
}
8298

src/Endpoint/AddComposerAuthPipelinePipelineItem.php

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ class AddComposerAuthPipelinePipelineItem extends \Gyroscops\Api\Runtime\Client\
1414
{
1515
use \Gyroscops\Api\Runtime\Client\EndpointTrait;
1616
protected $id;
17+
protected $accept;
1718

1819
/**
1920
* Adds a composer auth to a pipeline.
2021
*
2122
* @param string $id Resource identifier
2223
* @param \Gyroscops\Api\Model\PipelineAddPipelineComposerAuthCommandInputJsonld|\Gyroscops\Api\Model\PipelineAddPipelineComposerAuthCommandInput|null $requestBody
24+
* @param array $accept Accept content header application/ld+json|application/json|text/html
2325
*/
24-
public function __construct(string $id, $requestBody = null)
26+
public function __construct(string $id, $requestBody = null, array $accept = [])
2527
{
2628
$this->id = $id;
2729
$this->body = $requestBody;
30+
$this->accept = $accept;
2831
}
2932

3033
public function getMethod(): string
@@ -34,13 +37,13 @@ public function getMethod(): string
3437

3538
public function getUri(): string
3639
{
37-
return str_replace(['{id}'], [$this->id], '/runtime/pipeline/{id}/add-composer-auth');
40+
return str_replace(['{id}'], [$this->id], '/runtime/pipelines/{id}/add-composer-auth');
3841
}
3942

4043
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
4144
{
4245
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddPipelineComposerAuthCommandInputJsonld) {
43-
return [['Content-Type' => ['application/ld+json']], $this->body];
46+
return [['Content-Type' => ['application/ld+json']], $serializer->serialize($this->body, 'json')];
4447
}
4548
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddPipelineComposerAuthCommandInput) {
4649
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
@@ -54,29 +57,42 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
5457

5558
public function getExtraHeaders(): array
5659
{
57-
return ['Accept' => ['application/json']];
60+
if (empty($this->accept)) {
61+
return ['Accept' => ['application/ld+json', 'application/json']];
62+
}
63+
64+
return $this->accept;
5865
}
5966

6067
/**
6168
* {@inheritdoc}
6269
*
70+
* @return \Gyroscops\Api\Model\PipelineAddPipelineComposerAuthCommandJsonldRead|null
71+
*
6372
* @throws \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemBadRequestException
6473
* @throws \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemUnprocessableEntityException
6574
* @throws \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemNotFoundException
6675
*/
67-
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
76+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
6877
{
69-
if ((null === $contentType) === false && (202 === $status && false !== mb_strpos($contentType, 'application/json'))) {
70-
return json_decode($body, null, 512, \JSON_THROW_ON_ERROR);
78+
$status = $response->getStatusCode();
79+
$body = (string) $response->getBody();
80+
if (202 === $status) {
81+
if (mb_strpos($contentType, 'application/ld+json') !== false) {
82+
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddPipelineComposerAuthCommandJsonldRead', 'json');
83+
}
84+
if (mb_strpos($contentType, 'application/json') !== false) {
85+
return json_decode($body);
86+
}
7187
}
7288
if (400 === $status) {
73-
throw new \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemBadRequestException();
89+
throw new \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemBadRequestException($response);
7490
}
7591
if (422 === $status) {
76-
throw new \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemUnprocessableEntityException();
92+
throw new \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemUnprocessableEntityException($response);
7793
}
7894
if (404 === $status) {
79-
throw new \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemNotFoundException();
95+
throw new \Gyroscops\Api\Exception\AddComposerAuthPipelinePipelineItemNotFoundException($response);
8096
}
8197
}
8298

0 commit comments

Comments
 (0)