-
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 (#28)
- Loading branch information
1 parent
e4905ee
commit f121171
Showing
58 changed files
with
3,782 additions
and
4 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
86 changes: 86 additions & 0 deletions
86
...ted/Endpoint/DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestId.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,86 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Endpoint; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Qdequippe\Yousign\Api\Exception\DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdBadRequestException; | ||
use Qdequippe\Yousign\Api\Exception\DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdForbiddenException; | ||
use Qdequippe\Yousign\Api\Exception\DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdNotFoundException; | ||
use Qdequippe\Yousign\Api\Exception\DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdUnauthorizedException; | ||
use Qdequippe\Yousign\Api\Model\BadRequestResponse; | ||
use Qdequippe\Yousign\Api\Model\ForbiddenResponse; | ||
use Qdequippe\Yousign\Api\Model\NotFoundResponse; | ||
use Qdequippe\Yousign\Api\Model\UnauthorizedResponse; | ||
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 DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestId extends BaseEndpoint implements Endpoint | ||
{ | ||
use EndpointTrait; | ||
|
||
/** | ||
* Delete a Signer Consent Request from signature request. This action is only permitted when the Signature Request is a draft. | ||
* | ||
* @param string $signatureRequestId Signature Request Id | ||
* @param string $consentRequestId Signer Consent Request Id | ||
*/ | ||
public function __construct(protected string $signatureRequestId, protected string $consentRequestId) | ||
{ | ||
} | ||
|
||
public function getMethod(): string | ||
{ | ||
return 'DELETE'; | ||
} | ||
|
||
public function getUri(): string | ||
{ | ||
return str_replace(['{signatureRequestId}', '{consentRequestId}'], [$this->signatureRequestId, $this->consentRequestId], '/signature_requests/{signatureRequestId}/consent_requests/{consentRequestId}'); | ||
} | ||
|
||
public function getBody(SerializerInterface $serializer, $streamFactory = null): array | ||
{ | ||
return [[], null]; | ||
} | ||
|
||
public function getExtraHeaders(): array | ||
{ | ||
return ['Accept' => ['application/json']]; | ||
} | ||
|
||
/** | ||
* @throws DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdBadRequestException | ||
* @throws DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdUnauthorizedException | ||
* @throws DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdForbiddenException | ||
* @throws DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdNotFoundException | ||
*/ | ||
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 DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdBadRequestException($serializer->deserialize($body, BadRequestResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (401 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdUnauthorizedException($serializer->deserialize($body, UnauthorizedResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (403 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdForbiddenException($serializer->deserialize($body, ForbiddenResponse::class, 'json'), $response); | ||
} | ||
if (null !== $contentType && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) { | ||
throw new DeleteSignatureRequestsSignatureRequestIdConsentRequestsConsentRequestIdNotFoundException($serializer->deserialize($body, NotFoundResponse::class, 'json'), $response); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public function getAuthenticationScopes(): array | ||
{ | ||
return ['bearerAuth']; | ||
} | ||
} |
Oops, something went wrong.