43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\TenantConfiguration;
|
|
|
|
final readonly class ExchangePowerShellProcessCommandBuilderResult
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $context
|
|
*/
|
|
private function __construct(
|
|
public bool $successful,
|
|
public ?ExchangePowerShellProcessCommand $command = null,
|
|
public ?string $reasonCode = null,
|
|
public ?string $failureCode = null,
|
|
public ?string $message = null,
|
|
public array $context = [],
|
|
) {}
|
|
|
|
/**
|
|
* @param array<string, mixed> $context
|
|
*/
|
|
public static function built(ExchangePowerShellProcessCommand $command, array $context = []): self
|
|
{
|
|
return new self(successful: true, command: $command, context: $context);
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $context
|
|
*/
|
|
public static function blocked(string $reasonCode, string $failureCode, string $message, array $context = []): self
|
|
{
|
|
return new self(
|
|
successful: false,
|
|
reasonCode: $reasonCode,
|
|
failureCode: $failureCode,
|
|
message: $message,
|
|
context: $context,
|
|
);
|
|
}
|
|
}
|