coolify/app/Data/CoolifyTaskArgs.php

31 lines
775 B
PHP
Raw Normal View History

2023-05-03 07:15:45 +02:00
<?php
namespace App\Data;
use App\Enums\ProcessStatus;
use Illuminate\Database\Eloquent\Model;
use Spatie\LaravelData\Data;
2023-05-03 08:24:34 +02:00
/**
* The parameters to execute a CoolifyTask, organized in a DTO.
*/
2023-05-03 07:15:45 +02:00
class CoolifyTaskArgs extends Data
{
public function __construct(
public string $server_uuid,
2023-05-03 07:15:45 +02: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 07:15:45 +02: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,
public $call_event_on_finish = null,
public $call_event_data = null
2023-05-03 07:15:45 +02:00
) {
2023-09-18 14:41:31 +02:00
if(is_null($status)){
$this->status = ProcessStatus::QUEUED->value;
}
2023-05-03 07:15:45 +02:00
}
}