| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | namespace Nexus\Mcp\Core\Schema\Notification; |
| 15: | |
| 16: | use Nexus\Assert\Assert; |
| 17: | use Nexus\Mcp\Core\Schema\JsonRpc\JsonRpcNotification; |
| 18: | use Nexus\Mcp\Core\Schema\NotificationParams\ElicitationCompleteNotificationParams; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | final readonly class ElicitationCompleteNotification extends JsonRpcNotification implements ServerNotification |
| 29: | { |
| 30: | public function __construct(ElicitationCompleteNotificationParams $params) |
| 31: | { |
| 32: | parent::__construct($params); |
| 33: | } |
| 34: | |
| 35: | #[\Override] |
| 36: | public static function getMethod(): string |
| 37: | { |
| 38: | return 'notifications/elicitation/complete'; |
| 39: | } |
| 40: | |
| 41: | #[\Override] |
| 42: | public static function fromArray(array $data): static |
| 43: | { |
| 44: | Assert::that($data)->hasOffset('params', 'missing the required "params" key.'); |
| 45: | Assert::that($data['params']) |
| 46: | ->isArray('"params" must be an object, {type} given.') |
| 47: | ->isMap('"params" must be a string-keyed object.') |
| 48: | ; |
| 49: | |
| 50: | return new self(ElicitationCompleteNotificationParams::fromArray($data['params'])); |
| 51: | } |
| 52: | } |
| 53: | |