-
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.
Changes by create-pull-request action (#31)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: qdequippe <[email protected]>
- Loading branch information
1 parent
1c88312
commit 89491a3
Showing
37 changed files
with
2,215 additions
and
5 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
82 changes: 82 additions & 0 deletions
82
generated/Endpoint/GetIdentityVerificationsIdentityVerificationId.php
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,82 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Endpoint; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Exception\GetIdentityVerificationsIdentityVerificationIdBadRequestException; | ||
use Qdequippe\Yousign\Api\Exception\GetIdentityVerificationsIdentityVerificationIdForbiddenException; | ||
use Qdequippe\Yousign\Api\Exception\GetIdentityVerificationsIdentityVerificationIdNotFoundException; | ||
use Qdequippe\Yousign\Api\Model\BadRequestResponse; | ||
use Qdequippe\Yousign\Api\Model\ForbiddenResponse; | ||
use Qdequippe\Yousign\Api\Model\NotFoundResponse; | ||
use Qdequippe\Yousign\Api\Model\VideoIdentityVerification; | ||
use Qdequippe\Yousign\Api\Runtime\Client\BaseEndpoint; | ||
use Qdequippe\Yousign\Api\Runtime\Client\Endpoint; | ||
use Qdequippe\Yousign\Api\Runtime\Client\EndpointTrait; | ||
use Symfony\Component\Serializer\SerializerInterface; | ||
|
||
class GetIdentityVerificationsIdentityVerificationId extends BaseEndpoint implements Endpoint | ||
{ | ||
use EndpointTrait; | ||
|
||
/** | ||
* Get the detailed results of an Identity Verification. | ||
* | ||
* @param string $identityVerificationId The Identity verification ID | ||
*/ | ||
public function __construct(protected string $identityVerificationId) | ||
{ | ||
} | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'GET'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return str_replace(['{identityVerificationId}'], [$this->identityVerificationId], '/video_identity_verifications/{identityVerificationId}'); | ||
} | ||
|
||
public function getBody(SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
return [[], null]; | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
/** | ||
* @return VideoIdentityVerification|null | ||
* | ||
* @throws GetIdentityVerificationsIdentityVerificationIdBadRequestException | ||
* @throws GetIdentityVerificationsIdentityVerificationIdForbiddenException | ||
* @throws GetIdentityVerificationsIdentityVerificationIdNotFoundException | ||
*/ | ||
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null) | ||
{ | ||
$status = $response->getStatusCode(); | ||
$body = (string) $response->getBody(); | ||
if (null !== $contentType && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
return $serializer->deserialize($body, VideoIdentityVerification::class, 'json'); | ||
} | ||
if (null !== $contentType && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new GetIdentityVerificationsIdentityVerificationIdBadRequestException($serializer->deserialize($body, BadRequestResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new GetIdentityVerificationsIdentityVerificationIdForbiddenException($serializer->deserialize($body, ForbiddenResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new GetIdentityVerificationsIdentityVerificationIdNotFoundException($serializer->deserialize($body, NotFoundResponse::class, 'json'), $response); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public function getAuthenticationScopes(): array | ||
{ | ||
return ['bearerAuth']; | ||
} | ||
} |
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,86 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Endpoint; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Exception\PostIdentityVerificationsBadRequestException; | ||
use Qdequippe\Yousign\Api\Exception\PostIdentityVerificationsForbiddenException; | ||
use Qdequippe\Yousign\Api\Exception\PostIdentityVerificationsNotFoundException; | ||
use Qdequippe\Yousign\Api\Model\BadRequestResponse; | ||
use Qdequippe\Yousign\Api\Model\CreateVideoIdentityVerification; | ||
use Qdequippe\Yousign\Api\Model\ForbiddenResponse; | ||
use Qdequippe\Yousign\Api\Model\NotFoundResponse; | ||
use Qdequippe\Yousign\Api\Model\VideoIdentityVerificationCreated; | ||
use Qdequippe\Yousign\Api\Runtime\Client\BaseEndpoint; | ||
use Qdequippe\Yousign\Api\Runtime\Client\Endpoint; | ||
use Qdequippe\Yousign\Api\Runtime\Client\EndpointTrait; | ||
use Symfony\Component\Serializer\SerializerInterface; | ||
|
||
class PostIdentityVerifications extends BaseEndpoint implements Endpoint | ||
{ | ||
use EndpointTrait; | ||
|
||
/** | ||
* Creates a new Identity Verification resource. | ||
*/ | ||
public function __construct(?CreateVideoIdentityVerification $requestBody = null) | ||
{ | ||
$this->body = $requestBody; | ||
} | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'POST'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return '/video_identity_verifications'; | ||
} | ||
|
||
public function getBody(SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
if ($this->body instanceof CreateVideoIdentityVerification) { | ||
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; | ||
} | ||
|
||
return [[], null]; | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
/** | ||
* @return VideoIdentityVerificationCreated|null | ||
* | ||
* @throws PostIdentityVerificationsBadRequestException | ||
* @throws PostIdentityVerificationsForbiddenException | ||
* @throws PostIdentityVerificationsNotFoundException | ||
*/ | ||
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null) | ||
{ | ||
$status = $response->getStatusCode(); | ||
$body = (string) $response->getBody(); | ||
if (null !== $contentType && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
return $serializer->deserialize($body, VideoIdentityVerificationCreated::class, 'json'); | ||
} | ||
if (null !== $contentType && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostIdentityVerificationsBadRequestException($serializer->deserialize($body, BadRequestResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostIdentityVerificationsForbiddenException($serializer->deserialize($body, ForbiddenResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostIdentityVerificationsNotFoundException($serializer->deserialize($body, NotFoundResponse::class, 'json'), $response); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public function getAuthenticationScopes(): array | ||
{ | ||
return ['bearerAuth']; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
generated/Exception/GetIdentityVerificationsIdentityVerificationIdBadRequestException.php
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,24 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Model\BadRequestResponse; | ||
|
||
class GetIdentityVerificationsIdentityVerificationIdBadRequestException extends BadRequestException | ||
{ | ||
public function __construct(private readonly BadRequestResponse $badRequestResponse, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Bad request'); | ||
} | ||
|
||
public function getBadRequestResponse(): BadRequestResponse | ||
{ | ||
return $this->badRequestResponse; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
generated/Exception/GetIdentityVerificationsIdentityVerificationIdForbiddenException.php
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,24 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Model\ForbiddenResponse; | ||
|
||
class GetIdentityVerificationsIdentityVerificationIdForbiddenException extends ForbiddenException | ||
{ | ||
public function __construct(private readonly ForbiddenResponse $forbiddenResponse, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Access forbidden'); | ||
} | ||
|
||
public function getForbiddenResponse(): ForbiddenResponse | ||
{ | ||
return $this->forbiddenResponse; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
generated/Exception/GetIdentityVerificationsIdentityVerificationIdNotFoundException.php
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,24 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Model\NotFoundResponse; | ||
|
||
class GetIdentityVerificationsIdentityVerificationIdNotFoundException extends NotFoundException | ||
{ | ||
public function __construct(private readonly NotFoundResponse $notFoundResponse, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Resource not found'); | ||
} | ||
|
||
public function getNotFoundResponse(): NotFoundResponse | ||
{ | ||
return $this->notFoundResponse; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
generated/Exception/PostIdentityVerificationsBadRequestException.php
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,24 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Model\BadRequestResponse; | ||
|
||
class PostIdentityVerificationsBadRequestException extends BadRequestException | ||
{ | ||
public function __construct(private readonly BadRequestResponse $badRequestResponse, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Bad request'); | ||
} | ||
|
||
public function getBadRequestResponse(): BadRequestResponse | ||
{ | ||
return $this->badRequestResponse; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
Oops, something went wrong.