forked from apoloz/alfa-bank-sdk
first commit
This commit is contained in:
44
src/Requests/Auth/UserInfo/GetClientConsentsRequest.php
Normal file
44
src/Requests/Auth/UserInfo/GetClientConsentsRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Gemini\AlfaBank\Requests\Auth\UserInfo;
|
||||
|
||||
use Gemini\AlfaBank\Data\Auth\UserInfo\ClientConsentCollectionData;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
|
||||
class GetClientConsentsRequest extends Request
|
||||
{
|
||||
protected Method $method = Method::GET;
|
||||
|
||||
public function __construct(
|
||||
protected ?string $clientId = null,
|
||||
protected ?string $sub = null,
|
||||
protected ?string $organizationIdHash = null,
|
||||
protected ?bool $isActive = null,
|
||||
protected ?int $limit = 1000,
|
||||
protected ?int $offset = 0,
|
||||
) {}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '/oidc/client-consents';
|
||||
}
|
||||
|
||||
protected function defaultQuery(): array
|
||||
{
|
||||
return array_filter([
|
||||
'clientId' => $this->clientId,
|
||||
'sub' => $this->sub,
|
||||
'organizationIdHash' => $this->organizationIdHash,
|
||||
'isActive' => $this->isActive,
|
||||
'limit' => $this->limit,
|
||||
'offset' => $this->offset,
|
||||
], fn($value) => $value !== null);
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): ClientConsentCollectionData
|
||||
{
|
||||
return ClientConsentCollectionData::from($response->json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user