forked from apoloz/alfa-bank-sdk
30 lines
660 B
PHP
30 lines
660 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Apoloz\AlfaBank\Requests\Webhooks;
|
|
|
|
use Apoloz\AlfaBank\Data\Webhooks\Subscriptions\WebhookSubscriptionData;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Http\Response;
|
|
|
|
class GetWebhookRequest extends Request
|
|
{
|
|
protected Method $method = Method::GET;
|
|
|
|
public function __construct(
|
|
protected string $id
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return "/api/v2/webhooks/{$this->id}";
|
|
}
|
|
|
|
public function createDtoFromResponse(Response $response): WebhookSubscriptionData
|
|
{
|
|
return WebhookSubscriptionData::from($response->json());
|
|
}
|
|
}
|