forked from apoloz/alfa-bank-sdk
first commit
This commit is contained in:
38
src/Requests/NominalAccounts/Deals/Steps/GetStepsRequest.php
Normal file
38
src/Requests/NominalAccounts/Deals/Steps/GetStepsRequest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Gemini\AlfaBank\Requests\NominalAccounts\Deals\Steps;
|
||||
|
||||
use Gemini\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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user