2022-05-14 21:31:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\UserSSHKey;
|
2022-12-15 00:05:46 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2022-05-14 21:31:53 +00:00
|
|
|
|
2022-12-15 00:05:46 +00:00
|
|
|
class UserSSHKeyTransformer extends Transformer
|
2022-05-14 21:31:53 +00:00
|
|
|
{
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return UserSSHKey::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return's a user's SSH key in an API response format.
|
|
|
|
*/
|
|
|
|
public function transform(UserSSHKey $model): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $model->name,
|
|
|
|
'fingerprint' => $model->fingerprint,
|
|
|
|
'public_key' => $model->public_key,
|
2022-12-15 00:05:46 +00:00
|
|
|
'created_at' => self::formatTimestamp($model->created_at),
|
2022-05-14 21:31:53 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|