You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.0 KiB
PHP
29 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Cloud;
|
|
|
|
/** Immutable result returned after the transition intent and job commit. */
|
|
final class CloudPublicNetworkTransitionDispatch
|
|
{
|
|
public function __construct(
|
|
private readonly int $transitionId,
|
|
private readonly int $jobId,
|
|
private readonly string $operationId,
|
|
private readonly CloudPublicNetworkSnapshot $target,
|
|
private readonly bool $replayed
|
|
) {
|
|
if ($transitionId < 1 || $jobId < 1
|
|
|| preg_match('/^[a-f0-9]{32}$/D', $operationId) !== 1) {
|
|
throw new \InvalidArgumentException(
|
|
'Public-network transition dispatch is invalid.'
|
|
);
|
|
}
|
|
}
|
|
|
|
public function transitionId(): int { return $this->transitionId; }
|
|
public function jobId(): int { return $this->jobId; }
|
|
public function operationId(): string { return $this->operationId; }
|
|
public function target(): CloudPublicNetworkSnapshot { return $this->target; }
|
|
public function replayed(): bool { return $this->replayed; }
|
|
}
|