mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-03 21:05:45 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
31 lines
691 B
PHP
31 lines
691 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
use Pterodactyl\Models\UserSSHKey;
|
|
|
|
class UserSSHKeyTransformer extends BaseClientTransformer
|
|
{
|
|
public function getResourceName(): string
|
|
{
|
|
return UserSSHKey::RESOURCE_NAME;
|
|
}
|
|
|
|
/**
|
|
* Return's a user's SSH key in an API response format.
|
|
*
|
|
* @return ApiPayload
|
|
*/
|
|
public function transform(UserSSHKey $model): array
|
|
{
|
|
return [
|
|
'name' => $model->name,
|
|
'fingerprint' => $model->fingerprint,
|
|
'public_key' => $model->public_key,
|
|
'created_at' => $this->formatTimestamp($model->created_at),
|
|
];
|
|
}
|
|
}
|