*/ final class SetLogLevelRequest extends Request { /** * @param LoggingLevel $level The level of logging that the client wants to receive from the server. The server * should send all logs at this level and higher (i.e., more severe) to the client as * notifications/message. */ public function __construct( public readonly LoggingLevel $level, ) { } public static function getMethod(): string { return 'logging/setLevel'; } protected static function fromParams(?array $params): static { if (!isset($params['level']) || !\is_string($params['level']) || '' === $params['level']) { throw new InvalidArgumentException('Missing or invalid "level" parameter for "logging/setLevel".'); } return new self(LoggingLevel::from($params['level'])); } /** * @return array{level: value-of} */ protected function getParams(): array { return [ 'level' => $this->level->value, ]; } }