2023-05-03 05:15:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Data;
|
|
|
|
|
|
|
|
use App\Enums\ProcessStatus;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Spatie\LaravelData\Data;
|
|
|
|
|
2023-05-03 06:24:34 +00:00
|
|
|
/**
|
|
|
|
* The parameters to execute a CoolifyTask, organized in a DTO.
|
|
|
|
*/
|
2023-05-03 05:15:45 +00:00
|
|
|
class CoolifyTaskArgs extends Data
|
|
|
|
{
|
|
|
|
public function __construct(
|
2023-09-15 13:34:25 +00:00
|
|
|
public string $server_uuid,
|
2023-05-03 05:15:45 +00:00
|
|
|
public string $command,
|
|
|
|
public string $type,
|
|
|
|
public ?string $type_uuid = null,
|
2023-12-08 21:51:42 +00:00
|
|
|
public ?int $process_id = null,
|
2023-05-03 05:15:45 +00:00
|
|
|
public ?Model $model = null,
|
2023-09-18 12:41:31 +00:00
|
|
|
public ?string $status = null ,
|
2023-06-07 13:39:08 +00:00
|
|
|
public bool $ignore_errors = false,
|
2023-12-08 11:12:44 +00:00
|
|
|
public $call_event_on_finish = null,
|
2024-03-12 10:22:02 +00:00
|
|
|
public $call_event_data = null
|
2023-05-03 05:15:45 +00:00
|
|
|
) {
|
2023-09-18 12:41:31 +00:00
|
|
|
if(is_null($status)){
|
|
|
|
$this->status = ProcessStatus::QUEUED->value;
|
|
|
|
}
|
2023-05-03 05:15:45 +00:00
|
|
|
}
|
|
|
|
}
|