2020-04-04 17:59:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Transformers\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Backup;
|
|
|
|
|
|
|
|
class BackupTransformer extends BaseClientTransformer
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getResourceName(): string
|
|
|
|
{
|
|
|
|
return Backup::RESOURCE_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \Pterodactyl\Models\Backup $backup
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform(Backup $backup)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'uuid' => $backup->uuid,
|
2020-08-21 04:07:53 +00:00
|
|
|
'is_successful' => $backup->is_successful,
|
2020-04-04 17:59:25 +00:00
|
|
|
'name' => $backup->name,
|
2020-04-04 19:26:39 +00:00
|
|
|
'ignored_files' => $backup->ignored_files,
|
2020-04-04 17:59:25 +00:00
|
|
|
'sha256_hash' => $backup->sha256_hash,
|
|
|
|
'bytes' => $backup->bytes,
|
|
|
|
'created_at' => $backup->created_at->toIso8601String(),
|
2020-04-04 19:26:39 +00:00
|
|
|
'completed_at' => $backup->completed_at ? $backup->completed_at->toIso8601String() : null,
|
2020-04-04 17:59:25 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|