Files

27 lines
624 B
PHP
Raw Permalink Normal View History

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