Files
shlink/module/Rest/src/Service/ApiKeyServiceInterface.php
2023-09-21 09:47:21 +02:00

29 lines
655 B
PHP

<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Rest\Service;
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
use Shlinkio\Shlink\Rest\ApiKey\Model\ApiKeyMeta;
use Shlinkio\Shlink\Rest\Entity\ApiKey;
interface ApiKeyServiceInterface
{
public function create(ApiKeyMeta $apiKeyMeta): ApiKey;
public function createInitial(string $key): ?ApiKey;
public function check(string $key): ApiKeyCheckResult;
/**
* @throws InvalidArgumentException
*/
public function disable(string $key): ApiKey;
/**
* @return ApiKey[]
*/
public function listKeys(bool $enabledOnly = false): array;
}