forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
24
src/Requests/Cards/GetCardsRequest.php
Normal file
24
src/Requests/Cards/GetCardsRequest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Apoloz\AlfaBank\Requests\Cards;
|
||||
|
||||
use Apoloz\AlfaBank\Data\Cards\CardData;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
|
||||
class GetCardsRequest extends Request
|
||||
{
|
||||
protected Method $method = Method::GET;
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '/api/pp/v1/cards';
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): DataCollection
|
||||
{
|
||||
return CardData::collect($response->json('cards'), DataCollection::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user