39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Gemini\AlfaBank\Requests\NominalAccounts\Identification;
|
|
|
|
use Gemini\AlfaBank\Data\NominalAccounts\Identification\UnidentifiedTransactionCollectionData;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Http\Response;
|
|
|
|
class GetUnidentifiedTransactionsRequest extends Request
|
|
{
|
|
protected Method $method = Method::GET;
|
|
|
|
public function __construct(
|
|
protected string $accountNumber,
|
|
protected ?int $limit = null,
|
|
protected ?int $offset = null,
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return '/api/na/jp/v1/unidentified-transactions';
|
|
}
|
|
|
|
protected function defaultQuery(): array
|
|
{
|
|
return array_filter([
|
|
'accountNumber' => $this->accountNumber,
|
|
'limit' => $this->limit,
|
|
'offset' => $this->offset,
|
|
]);
|
|
}
|
|
|
|
public function createDtoFromResponse(Response $response): UnidentifiedTransactionCollectionData
|
|
{
|
|
return UnidentifiedTransactionCollectionData::from($response->json());
|
|
}
|
|
}
|