Lines 0.00% 0 / 2
Functions and Methods 0.00% 0 / 2
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ExposeEntityRequest 0.00% 0 / 2 0.00% 0 / 2 6 0.00% 0 / 1
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 createUnreachableFailure 0.00% 0 / 1 0.00% 0 / 1 2
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Ipc\Message;
6
7use Stewart\Contracts\Exception\ExposureException;
8use Stewart\Contracts\Exposure\DeviceInfo;
9use Stewart\Contracts\Exposure\ExposedEntityKey;
10use Stewart\Contracts\Exposure\ExposedStateChange;
11use Stewart\Contracts\Exposure\ExposureConfig;
12use Stewart\Runtime\Model\CorrelationId;
13use Stewart\Runtime\Model\ResourceScope;
14use Throwable;
15
16#[IpcMessage(tag: 'expose_entity_request')]
17final readonly class ExposeEntityRequest implements WorkerMessage, HaCallRequest
18{
19    public function __construct(
20        public CorrelationId $correlationId,
21        public ResourceScope $scope,
22        public ExposedEntityKey $key,
23        public ExposureConfig $config,
24        public ?DeviceInfo $device,
25        public ExposedStateChange $change,
26    ) {}
27
28    public function createUnreachableFailure(string $detail, ?Throwable $previous = null): ExposureException
29    {
30        return ExposureException::unreachable($this->key, $detail, $previous);
31    }
32}