2019-12-09 22:03:10 -08:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2019-12-09 22:03:10 -08:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Settings;
|
|
|
|
|
|
2026-10-11 09:04:02 -04:00
|
|
|
use Pterodactyl\Actions\Servers\UpdateServerDetails;
|
2019-12-09 22:03:10 -08:00
|
|
|
use Pterodactyl\Contracts\Http\ClientPermissionsRequest;
|
2026-10-05 18:10:18 -04:00
|
|
|
use Pterodactyl\Enum\Permissions;
|
2019-12-09 22:03:10 -08:00
|
|
|
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
|
|
|
|
|
|
|
|
|
|
class RenameServerRequest extends ClientApiRequest implements ClientPermissionsRequest
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Returns the permissions string indicating which permission should be used to
|
2022-10-31 17:20:53 +01:00
|
|
|
* validate that the authenticated user has permission to perform this action against
|
2019-12-09 22:03:10 -08:00
|
|
|
* the given resource (server).
|
|
|
|
|
*/
|
|
|
|
|
public function permission(): string
|
|
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
return Permissions::SettingsRename->value;
|
2019-12-09 22:03:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The rules to apply when validating this request.
|
2026-10-05 18:10:18 -04:00
|
|
|
*
|
|
|
|
|
* @return ValidationRules
|
2019-12-09 22:03:10 -08:00
|
|
|
*/
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
2026-10-11 09:04:02 -04:00
|
|
|
$rules = UpdateServerDetails::rules();
|
|
|
|
|
|
2019-12-09 22:03:10 -08:00
|
|
|
return [
|
2026-10-11 09:04:02 -04:00
|
|
|
'name' => $rules['name'],
|
|
|
|
|
'description' => $rules['description'],
|
2019-12-09 22:03:10 -08:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|