forked from apoloz/alfa-bank-sdk
39 lines
933 B
PHP
39 lines
933 B
PHP
<?php
|
|
|
|
namespace Apoloz\AlfaBank\Requests\NominalAccounts\Deals\Steps;
|
|
|
|
use Apoloz\AlfaBank\Data\NominalAccounts\Deals\Steps\StepData;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Http\Response;
|
|
use Spatie\LaravelData\DataCollection;
|
|
|
|
class GetStepsRequest extends Request
|
|
{
|
|
protected Method $method = Method::GET;
|
|
|
|
public function __construct(
|
|
protected string $dealId,
|
|
protected ?int $limit = 50,
|
|
protected ?int $offset = 0
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return "/api/na/jp/v1/deals/{$this->dealId}/steps";
|
|
}
|
|
|
|
protected function defaultQuery(): array
|
|
{
|
|
return [
|
|
'limit' => $this->limit,
|
|
'offset' => $this->offset,
|
|
];
|
|
}
|
|
|
|
public function createDtoFromResponse(Response $response): DataCollection
|
|
{
|
|
return StepData::collect($response->json(), DataCollection::class);
|
|
}
|
|
}
|