Skip to content

Commit

Permalink
Updated php endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Apr 29, 2024
1 parent 9583c6e commit 90fcc37
Show file tree
Hide file tree
Showing 2,041 changed files with 59,996 additions and 65,365 deletions.
2 changes: 1 addition & 1 deletion jane/gyroscops.json

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions src/Authentication/ApiKeyAuthentication.php

This file was deleted.

27 changes: 27 additions & 0 deletions src/Authentication/JWTAuthentication.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Gyroscops\Api\Authentication;

class JWTAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin
{
private $apiKey;

public function __construct(string $apiKey)
{
$this->{'apiKey'} = $apiKey;
}

public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface
{
$request = $request->withHeader('Authorization', $this->{'apiKey'});

return $request;
}

public function getScope(): string
{
return 'JWT';
}
}
3,355 changes: 1,815 additions & 1,540 deletions src/Client.php

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions src/Endpoint/AcceptReferralRequestReferralRequestItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace Gyroscops\Api\Endpoint;

class AcceptReferralRequestReferralRequestItem extends \Gyroscops\Api\Runtime\Client\BaseEndpoint implements \Gyroscops\Api\Runtime\Client\Endpoint
Expand Down Expand Up @@ -37,7 +31,7 @@ public function getMethod(): string

public function getUri(): string
{
return str_replace(['{id}'], [$this->id], '/referral/referral-request/{id}/accept');
return str_replace(['{id}'], [$this->id], '/referral/referral-requests/{id}/accept');
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
Expand All @@ -55,8 +49,6 @@ public function getExtraHeaders(): array
}

/**
* {@inheritdoc}
*
* @return \Gyroscops\Api\Model\ReferralRequestJsonldReferralRequestRead|\Gyroscops\Api\Model\ReferralRequestReferralRequestRead
*
* @throws \Gyroscops\Api\Exception\AcceptReferralRequestReferralRequestItemBadRequestException
Expand All @@ -69,10 +61,10 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (200 === $status) {
if (mb_strpos($contentType, 'application/ld+json') !== false) {
if (false !== mb_strpos($contentType, 'application/ld+json')) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\ReferralRequestJsonldReferralRequestRead', 'json');
}
if (mb_strpos($contentType, 'application/json') !== false) {
if (false !== mb_strpos($contentType, 'application/json')) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\ReferralRequestReferralRequestRead', 'json');
}
}
Expand All @@ -90,6 +82,6 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re

public function getAuthenticationScopes(): array
{
return ['apiKey'];
return ['JWT'];
}
}
32 changes: 12 additions & 20 deletions src/Endpoint/AddAfterPipelineStepPipelineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace Gyroscops\Api\Endpoint;

class AddAfterPipelineStepPipelineItem extends \Gyroscops\Api\Runtime\Client\BaseEndpoint implements \Gyroscops\Api\Runtime\Client\Endpoint
Expand All @@ -19,9 +13,9 @@ class AddAfterPipelineStepPipelineItem extends \Gyroscops\Api\Runtime\Client\Bas
/**
* Adds a step after another one in a pipeline.
*
* @param string $id Resource identifier
* @param \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInputJsonld|\Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInput|null $requestBody
* @param array $accept Accept content header application/ld+json|application/json|text/html
* @param string $id Resource identifier
* @param \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInputJsonldPipelineWrite|\stdClass|null $requestBody
* @param array $accept Accept content header application/ld+json|application/json|text/html
*/
public function __construct(string $id, $requestBody = null, array $accept = [])
{
Expand All @@ -42,13 +36,13 @@ public function getUri(): string

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInputJsonld) {
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInputJsonldPipelineWrite) {
return [['Content-Type' => ['application/ld+json']], $serializer->serialize($this->body, 'json')];
}
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInput) {
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
if ($this->body instanceof \stdClass) {
return [['Content-Type' => ['application/json']], json_encode($this->body)];
}
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandInput) {
if ($this->body instanceof \stdClass) {
return [['Content-Type' => ['text/html']], $this->body];
}

Expand All @@ -65,9 +59,7 @@ public function getExtraHeaders(): array
}

/**
* {@inheritdoc}
*
* @return \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandJsonldRead|null
* @return \Gyroscops\Api\Model\PipelineAddAfterPipelineStepCommandJsonldPipelineReadPipelineSubresourceRead|null
*
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemBadRequestException
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepPipelineItemUnprocessableEntityException
Expand All @@ -79,10 +71,10 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (202 === $status) {
if (mb_strpos($contentType, 'application/ld+json') !== false) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddAfterPipelineStepCommandJsonldRead', 'json');
if (false !== mb_strpos($contentType, 'application/ld+json')) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddAfterPipelineStepCommandJsonldPipelineReadPipelineSubresourceRead', 'json');
}
if (mb_strpos($contentType, 'application/json') !== false) {
if (false !== mb_strpos($contentType, 'application/json')) {
return json_decode($body);
}
}
Expand All @@ -100,6 +92,6 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re

public function getAuthenticationScopes(): array
{
return ['apiKey'];
return ['JWT'];
}
}
100 changes: 100 additions & 0 deletions src/Endpoint/AddAfterPipelineStepWorkflowJobItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php

declare(strict_types=1);

namespace Gyroscops\Api\Endpoint;

class AddAfterPipelineStepWorkflowJobItem extends \Gyroscops\Api\Runtime\Client\BaseEndpoint implements \Gyroscops\Api\Runtime\Client\Endpoint
{
use \Gyroscops\Api\Runtime\Client\EndpointTrait;
protected $code;
protected $id;
protected $accept;

/**
* Adds a step after another one in a pipeline.
*
* @param string $code Step resource code
* @param string $id Resource identifier
* @param \Gyroscops\Api\Model\WorkflowJobAddAfterWorkflowPipelineStepCommandInputJsonld|\Gyroscops\Api\Model\WorkflowJobAddAfterWorkflowPipelineStepCommandInput|null $requestBody
* @param array $accept Accept content header application/ld+json|application/json|text/html
*/
public function __construct(string $code, string $id, $requestBody = null, array $accept = [])
{
$this->code = $code;
$this->id = $id;
$this->body = $requestBody;
$this->accept = $accept;
}

public function getMethod(): string
{
return 'PUT';
}

public function getUri(): string
{
return str_replace(['{code}', '{id}'], [$this->code, $this->id], '/runtime/workflows/jobs/{id}/pipelines/steps/{code}/add-after');
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
if ($this->body instanceof \Gyroscops\Api\Model\WorkflowJobAddAfterWorkflowPipelineStepCommandInputJsonld) {
return [['Content-Type' => ['application/ld+json']], $serializer->serialize($this->body, 'json')];
}
if ($this->body instanceof \Gyroscops\Api\Model\WorkflowJobAddAfterWorkflowPipelineStepCommandInput) {
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
}
if ($this->body instanceof \Gyroscops\Api\Model\WorkflowJobAddAfterWorkflowPipelineStepCommandInput) {
return [['Content-Type' => ['text/html']], $this->body];
}

return [[], null];
}

public function getExtraHeaders(): array
{
if (empty($this->accept)) {
return ['Accept' => ['application/ld+json', 'application/json']];
}

return $this->accept;
}

/**
* @return \Gyroscops\Api\Model\WorkflowJobAddAfterWorkflowPipelineStepCommandJsonldJobRead|null
*
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepWorkflowJobItemBadRequestException
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepWorkflowJobItemUnprocessableEntityException
* @throws \Gyroscops\Api\Exception\AddAfterPipelineStepWorkflowJobItemNotFoundException
* @throws \Gyroscops\Api\Exception\UnexpectedStatusCodeException
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (202 === $status) {
if (false !== mb_strpos($contentType, 'application/ld+json')) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\WorkflowJobAddAfterWorkflowPipelineStepCommandJsonldJobRead', 'json');
}
if (false !== mb_strpos($contentType, 'application/json')) {
return json_decode($body);
}
}
if (400 === $status) {
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepWorkflowJobItemBadRequestException($response);
}
if (422 === $status) {
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepWorkflowJobItemUnprocessableEntityException($response);
}
if (404 === $status) {
throw new \Gyroscops\Api\Exception\AddAfterPipelineStepWorkflowJobItemNotFoundException($response);
}
throw new \Gyroscops\Api\Exception\UnexpectedStatusCodeException($status, $body);
}

public function getAuthenticationScopes(): array
{
return ['JWT'];
}
}
32 changes: 12 additions & 20 deletions src/Endpoint/AddBeforePipelineStepPipelineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace Gyroscops\Api\Endpoint;

class AddBeforePipelineStepPipelineItem extends \Gyroscops\Api\Runtime\Client\BaseEndpoint implements \Gyroscops\Api\Runtime\Client\Endpoint
Expand All @@ -19,9 +13,9 @@ class AddBeforePipelineStepPipelineItem extends \Gyroscops\Api\Runtime\Client\Ba
/**
* Adds a step before another one in a pipeline.
*
* @param string $id Resource identifier
* @param \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInputJsonld|\Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInput|null $requestBody
* @param array $accept Accept content header application/ld+json|application/json|text/html
* @param string $id Resource identifier
* @param \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInputJsonldPipelineWrite|\stdClass|null $requestBody
* @param array $accept Accept content header application/ld+json|application/json|text/html
*/
public function __construct(string $id, $requestBody = null, array $accept = [])
{
Expand All @@ -42,13 +36,13 @@ public function getUri(): string

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInputJsonld) {
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInputJsonldPipelineWrite) {
return [['Content-Type' => ['application/ld+json']], $serializer->serialize($this->body, 'json')];
}
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInput) {
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
if ($this->body instanceof \stdClass) {
return [['Content-Type' => ['application/json']], json_encode($this->body)];
}
if ($this->body instanceof \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandInput) {
if ($this->body instanceof \stdClass) {
return [['Content-Type' => ['text/html']], $this->body];
}

Expand All @@ -65,9 +59,7 @@ public function getExtraHeaders(): array
}

/**
* {@inheritdoc}
*
* @return \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandJsonldRead|null
* @return \Gyroscops\Api\Model\PipelineAddBeforePipelineStepCommandJsonldPipelineReadPipelineSubresourceRead|null
*
* @throws \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemBadRequestException
* @throws \Gyroscops\Api\Exception\AddBeforePipelineStepPipelineItemUnprocessableEntityException
Expand All @@ -79,10 +71,10 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (202 === $status) {
if (mb_strpos($contentType, 'application/ld+json') !== false) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddBeforePipelineStepCommandJsonldRead', 'json');
if (false !== mb_strpos($contentType, 'application/ld+json')) {
return $serializer->deserialize($body, 'Gyroscops\\Api\\Model\\PipelineAddBeforePipelineStepCommandJsonldPipelineReadPipelineSubresourceRead', 'json');
}
if (mb_strpos($contentType, 'application/json') !== false) {
if (false !== mb_strpos($contentType, 'application/json')) {
return json_decode($body);
}
}
Expand All @@ -100,6 +92,6 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re

public function getAuthenticationScopes(): array
{
return ['apiKey'];
return ['JWT'];
}
}
Loading

0 comments on commit 90fcc37

Please sign in to comment.