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:
27
src/Requests/Webhooks/GetWebhookRequest.php
Normal file
27
src/Requests/Webhooks/GetWebhookRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user