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