first commit
This commit is contained in:
38
src/Requests/Webhooks/GetWebhooksRequest.php
Normal file
38
src/Requests/Webhooks/GetWebhooksRequest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Gemini\AlfaBank\Requests\Webhooks;
|
||||
|
||||
use Gemini\AlfaBank\Data\WebhookCollectionData;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
|
||||
class GetWebhooksRequest extends Request
|
||||
{
|
||||
protected Method $method = Method::GET;
|
||||
|
||||
public function __construct(
|
||||
protected ?int $offset = 0,
|
||||
protected ?int $limit = 20,
|
||||
protected ?string $object = null
|
||||
) {}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '/api/v2/webhooks';
|
||||
}
|
||||
|
||||
protected function defaultQuery(): array
|
||||
{
|
||||
return array_filter([
|
||||
'offset' => $this->offset,
|
||||
'limit' => $this->limit,
|
||||
'object' => $this->object,
|
||||
]);
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): WebhookCollectionData
|
||||
{
|
||||
return WebhookCollectionData::from($response->json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user