lasthourcloud/app/Data/CoolifyTaskArgs.php

31 lines
768 B
PHP
Raw Normal View History

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(
2024-06-10 20:43:34 +00:00
public string $server_uuid,
public string $command,
public string $type,
2023-05-03 05:15:45 +00:00
public ?string $type_uuid = null,
2023-12-08 21:51:42 +00:00
public ?int $process_id = null,
2024-06-10 20:43:34 +00:00
public ?Model $model = null,
public ?string $status = null,
public bool $ignore_errors = false,
public $call_event_on_finish = null,
public $call_event_data = null
2023-05-03 05:15:45 +00:00
) {
2024-06-10 20:43:34 +00:00
if (is_null($status)) {
2023-09-18 12:41:31 +00:00
$this->status = ProcessStatus::QUEUED->value;
}
2023-05-03 05:15:45 +00:00
}
}