Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Transformers/Api/Client/UserSSHKeyTransformer.php
10284 views
1
<?php
2
3
namespace Pterodactyl\Transformers\Api\Client;
4
5
use Pterodactyl\Models\UserSSHKey;
6
7
class UserSSHKeyTransformer extends BaseClientTransformer
8
{
9
public function getResourceName(): string
10
{
11
return UserSSHKey::RESOURCE_NAME;
12
}
13
14
/**
15
* Return's a user's SSH key in an API response format.
16
*/
17
public function transform(UserSSHKey $model): array
18
{
19
return [
20
'name' => $model->name,
21
'fingerprint' => $model->fingerprint,
22
'public_key' => $model->public_key,
23
'created_at' => $model->created_at->toAtomString(),
24
];
25
}
26
}
27
28