2022-05-14 21:31:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\UserSSHKey;
|
|
|
|
|
2022-05-14 22:08:48 +00:00
|
|
|
class UserSSHKeyTransformer extends BaseClientTransformer
|
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-10-14 16:59:20 +00:00
|
|
|
'created_at' => $model->created_at->toAtomString(),
|
2022-05-14 21:31:53 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|