Files
shlink/module/Rest/src/Entity/ApiKeyRole.php
2022-04-23 18:41:16 +02:00

42 lines
768 B
PHP

<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Rest\Entity;
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
use Shlinkio\Shlink\Rest\ApiKey\Role;
class ApiKeyRole extends AbstractEntity
{
public function __construct(private Role $roleName, private array $meta, private ApiKey $apiKey)
{
}
public function role(): Role
{
return $this->roleName;
}
/** @deprecated Use role() instead */
public function name(): Role
{
return $this->role();
}
public function meta(): array
{
return $this->meta;
}
public function updateMeta(array $newMeta): void
{
$this->meta = $newMeta;
}
public function apiKey(): ApiKey
{
return $this->apiKey;
}
}