2021-07-17 21:45:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\UserSSHKey;
|
2021-08-07 20:06:45 +00:00
|
|
|
use Pterodactyl\Transformers\Api\Transformer;
|
2021-07-17 21:45:46 +00:00
|
|
|
|
2021-08-07 20:06:45 +00:00
|
|
|
class UserSSHKeyTransformer extends Transformer
|
2021-07-17 21:45:46 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return the resource name for the JSONAPI output.
|
|
|
|
*/
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
2021-08-07 20:06:45 +00:00
|
|
|
return UserSSHKey::RESOURCE_NAME;
|
2021-07-17 21:45:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function transform(UserSSHKey $model): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => $model->id,
|
|
|
|
'name' => $model->name,
|
|
|
|
'public_key' => $model->public_key,
|
2021-08-07 20:06:45 +00:00
|
|
|
'created_at' => self::formatTimestamp($model->created_at),
|
2021-07-17 21:45:46 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|