Skip to content

Commit

Permalink
[create-pull-request] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
qdequippe committed May 20, 2024
1 parent 8ad9073 commit fa2d165
Show file tree
Hide file tree
Showing 160 changed files with 1,804 additions and 295 deletions.
41 changes: 41 additions & 0 deletions generated/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
use Qdequippe\Yousign\Api\Endpoint\PostSignatureRequestsSignatureRequestIdReactivate;
use Qdequippe\Yousign\Api\Endpoint\PostSignatureRequestsSignatureRequestIdSignatures;
use Qdequippe\Yousign\Api\Endpoint\PostSignatureRequestsSignatureRequestIdSigners;
use Qdequippe\Yousign\Api\Endpoint\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtp;
use Qdequippe\Yousign\Api\Endpoint\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendReminder;
use Qdequippe\Yousign\Api\Endpoint\PostSignatureRequestsSignatureRequestIdSignersSignerIdSign;
use Qdequippe\Yousign\Api\Endpoint\PostWebhooksSubscriptions;
use Qdequippe\Yousign\Api\Endpoint\PutSignatureRequestsSignatureRequestIdMetadata;
use Qdequippe\Yousign\Api\Endpoint\UpdateSignatureRequestsSignatureRequestIdDocumentsDocumentIdFieldsFieldId;
Expand All @@ -99,6 +101,7 @@
use Qdequippe\Yousign\Api\Model\PostSignatureRequestsSignatureRequestIdDocumentsDocumentIdReplaceRequest;
use Qdequippe\Yousign\Api\Model\PostSignatureRequestsSignatureRequestIdReactivateRequest;
use Qdequippe\Yousign\Api\Model\Signer;
use Qdequippe\Yousign\Api\Model\SignerSign;
use Qdequippe\Yousign\Api\Model\UpdateContact;
use Qdequippe\Yousign\Api\Model\UpdateCustomExperience;
use Qdequippe\Yousign\Api\Model\UpdateDocument;
Expand Down Expand Up @@ -633,6 +636,25 @@ public function patchSignatureRequestsSignatureRequestIdSignersSignerId(string $
return $this->executeEndpoint(new PatchSignatureRequestsSignatureRequestIdSignersSignerId($signatureRequestId, $signerId, $requestBody), $fetch);
}

/**
* 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
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return ResponseInterface|null
*
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpBadRequestException
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpUnauthorizedException
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpForbiddenException
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtpNotFoundException
*/
public function postSignatureRequestsSignatureRequestIdSignersSignerIdSendOtp(string $signatureRequestId, string $signerId, string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new PostSignatureRequestsSignatureRequestIdSignersSignerIdSendOtp($signatureRequestId, $signerId), $fetch);
}

/**
* @param string $signatureRequestId Signature Request Id
* @param string $signerId Signer Id
Expand Down Expand Up @@ -685,6 +707,25 @@ public function getSignatureRequestsSignatureRequestIdSignersSignerIdAuditTrails
return $this->executeEndpoint(new GetSignatureRequestsSignatureRequestIdSignersSignerIdAuditTrails($signatureRequestId, $signerId), $fetch);
}

/**
* Sign a Signature Request on behalf of a given Signer.
*
* @param string $signatureRequestId Signature Request Id
* @param string $signerId Signer Id
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
*
* @return ResponseInterface|null
*
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignBadRequestException
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignUnauthorizedException
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignForbiddenException
* @throws Exception\PostSignatureRequestsSignatureRequestIdSignersSignerIdSignNotFoundException
*/
public function postSignatureRequestsSignatureRequestIdSignersSignerIdSign(string $signatureRequestId, string $signerId, ?SignerSign $requestBody = null, string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new PostSignatureRequestsSignatureRequestIdSignersSignerIdSign($signatureRequestId, $signerId, $requestBody), $fetch);
}

/**
* @param string $signatureRequestId Signature Request Id
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
Expand Down
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'];
}
}
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'];
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
Loading

0 comments on commit fa2d165

Please sign in to comment.