-
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.
[create-pull-request] automated change
- Loading branch information
Showing
160 changed files
with
1,804 additions
and
295 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
84 changes: 84 additions & 0 deletions
84
generated/Endpoint/PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtp.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,84 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Endpoint; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpBadRequestException; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpForbiddenException; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpNotFoundException; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpUnauthorizedException; | ||
use Qdequippe\Yousign\Api\Model\GetSignatureRequests401Response; | ||
use Qdequippe\Yousign\Api\Model\ViolationResponse; | ||
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 PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtp extends BaseEndpoint implements Endpoint | ||
{ | ||
use EndpointTrait; | ||
|
||
/** | ||
* Send a one-time password (OTP) to a specified Signer. This endpoint is useful for integrating the signing flow into your application and allowing the Signer to sign through the API. Once the OTP is sent, the Signer must provide it back to complete the Signature Request. | ||
* | ||
* @param string $signatureRequestId Signature Request Id | ||
* @param string $signerId Signer Id | ||
*/ | ||
public function __construct(protected string $signatureRequestId, protected string $signerId) | ||
{ | ||
} | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'POST'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return str_replace(['{signatureRequestId}', '{signerId}'], [$this->signatureRequestId, $this->signerId], '/signature_requests/{signatureRequestId}/signers/{signerId}/send_otp'); | ||
} | ||
|
||
public function getBody(SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
return [[], null]; | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
/** | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpBadRequestException | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpUnauthorizedException | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpForbiddenException | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpNotFoundException | ||
*/ | ||
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null) | ||
{ | ||
$status = $response->getStatusCode(); | ||
$body = (string) $response->getBody(); | ||
if (204 === $status) { | ||
return null; | ||
} | ||
if (null !== $contentType && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpBadRequestException($serializer->deserialize($body, ViolationResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (401 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpUnauthorizedException($serializer->deserialize($body, GetSignatureRequests401Response::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpForbiddenException($response); | ||
} | ||
if (null !== $contentType && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpNotFoundException($response); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public function getAuthenticationScopes(): array | ||
{ | ||
return ['bearerAuth']; | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
generated/Endpoint/PostSignatureRequestsSignatureRequestIdSignersSignerIdSign.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,90 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Endpoint; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignBadRequestException; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignForbiddenException; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignNotFoundException; | ||
use Qdequippe\Yousign\Api\Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignUnauthorizedException; | ||
use Qdequippe\Yousign\Api\Model\GetSignatureRequests401Response; | ||
use Qdequippe\Yousign\Api\Model\SignerSign; | ||
use Qdequippe\Yousign\Api\Model\ViolationResponse; | ||
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 PostSignatureRequestsSignatureRequestIdSignersSignerIdSign extends BaseEndpoint implements Endpoint | ||
{ | ||
use EndpointTrait; | ||
|
||
/** | ||
* Sign a Signature Request on behalf of a given Signer. | ||
* | ||
* @param string $signatureRequestId Signature Request Id | ||
* @param string $signerId Signer Id | ||
*/ | ||
public function __construct(protected string $signatureRequestId, protected string $signerId, ?SignerSign $requestBody = null) | ||
{ | ||
$this->body = $requestBody; | ||
} | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'POST'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return str_replace(['{signatureRequestId}', '{signerId}'], [$this->signatureRequestId, $this->signerId], '/signature_requests/{signatureRequestId}/signers/{signerId}/sign'); | ||
} | ||
|
||
public function getBody(SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
if ($this->body instanceof SignerSign) { | ||
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; | ||
} | ||
|
||
return [[], null]; | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
/** | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSignBadRequestException | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSignUnauthorizedException | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSignForbiddenException | ||
* @throws PostSignatureRequestsSignatureRequestIdSignersSignerIdSignNotFoundException | ||
*/ | ||
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null) | ||
{ | ||
$status = $response->getStatusCode(); | ||
$body = (string) $response->getBody(); | ||
if (204 === $status) { | ||
return null; | ||
} | ||
if (null !== $contentType && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSignBadRequestException($serializer->deserialize($body, ViolationResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (401 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSignUnauthorizedException($serializer->deserialize($body, GetSignatureRequests401Response::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSignForbiddenException($response); | ||
} | ||
if (null !== $contentType && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new PostSignatureRequestsSignatureRequestIdSignersSignerIdSignNotFoundException($response); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public function getAuthenticationScopes(): array | ||
{ | ||
return ['bearerAuth']; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...tion/PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpBadRequestException.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\ViolationResponse; | ||
|
||
class PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpBadRequestException extends BadRequestException | ||
{ | ||
public function __construct(private readonly ViolationResponse $violationResponse, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Bad request'); | ||
} | ||
|
||
public function getViolationResponse(): ViolationResponse | ||
{ | ||
return $this->violationResponse; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ption/PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpForbiddenException.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,21 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
|
||
class PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpForbiddenException extends ForbiddenException | ||
{ | ||
public function __construct(/** | ||
* @var ResponseInterface | ||
*/ | ||
private readonly ?ResponseInterface $response = null) | ||
{ | ||
parent::__construct('Access forbidden'); | ||
} | ||
|
||
public function getResponse(): ?ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...eption/PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpNotFoundException.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,21 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
|
||
class PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpNotFoundException extends NotFoundException | ||
{ | ||
public function __construct(/** | ||
* @var ResponseInterface | ||
*/ | ||
private readonly ?ResponseInterface $response = null) | ||
{ | ||
parent::__construct('Resource not found'); | ||
} | ||
|
||
public function getResponse(): ?ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...on/PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpUnauthorizedException.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\GetSignatureRequests401Response; | ||
|
||
class PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpUnauthorizedException extends UnauthorizedException | ||
{ | ||
public function __construct(private readonly GetSignatureRequests401Response $getSignatureRequests401Response, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Access unauthorized'); | ||
} | ||
|
||
public function getGetSignatureRequests401Response(): GetSignatureRequests401Response | ||
{ | ||
return $this->getSignatureRequests401Response; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ception/PostSignatureRequestsSignatureRequestIdSignersSignerIdSignBadRequestException.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\ViolationResponse; | ||
|
||
class PostSignatureRequestsSignatureRequestIdSignersSignerIdSignBadRequestException extends BadRequestException | ||
{ | ||
public function __construct(private readonly ViolationResponse $violationResponse, private readonly ResponseInterface $response) | ||
{ | ||
parent::__construct('Bad request'); | ||
} | ||
|
||
public function getViolationResponse(): ViolationResponse | ||
{ | ||
return $this->violationResponse; | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...xception/PostSignatureRequestsSignatureRequestIdSignersSignerIdSignForbiddenException.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,21 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
|
||
class PostSignatureRequestsSignatureRequestIdSignersSignerIdSignForbiddenException extends ForbiddenException | ||
{ | ||
public function __construct(/** | ||
* @var ResponseInterface | ||
*/ | ||
private readonly ?ResponseInterface $response = null) | ||
{ | ||
parent::__construct('Access forbidden'); | ||
} | ||
|
||
public function getResponse(): ?ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
Oops, something went wrong.