2020-03-19 05:28:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Schedules;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Permission;
|
|
|
|
|
2020-03-22 20:56:15 +00:00
|
|
|
class StoreTaskRequest extends ViewScheduleRequest
|
2020-03-19 05:28:32 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is allowed to create a new task for this schedule. We simply
|
|
|
|
* check if they can modify a schedule to determine if they're able to do this. There
|
|
|
|
* are no task specific permissions.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-03-22 20:56:15 +00:00
|
|
|
public function permission(): string
|
2020-03-19 05:28:32 +00:00
|
|
|
{
|
|
|
|
return Permission::ACTION_SCHEDULE_UPDATE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'action' => 'required|in:command,power',
|
|
|
|
'payload' => 'required|string',
|
|
|
|
'time_offset' => 'required|numeric|min:0|max:900',
|
|
|
|
'sequence_id' => 'sometimes|required|numeric|min:1',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|