"""Auto-generated by bindgen. Do not edit."""
# ruff: noqa: E501, F401, I001
# fmt: off

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, ClassVar, Optional, TYPE_CHECKING, Union

from wasmtime.component import Variant as _WitVariant
from wasmtime.component import VariantCase as _WitVariantCase


@dataclass(kw_only=True)
class ElicitRequest:
    """Request for user input."""
    client_id: str
    message: str
    request: str


class ElicitAction(str):
    """Outcome of an elicitation request."""
    __slots__ = ()

    ACCEPT: ElicitAction
    DECLINE: ElicitAction
    CANCEL: ElicitAction

ElicitAction.ACCEPT = ElicitAction('accept')  # type: ignore[attr-defined]
ElicitAction.DECLINE = ElicitAction('decline')  # type: ignore[attr-defined]
ElicitAction.CANCEL = ElicitAction('cancel')  # type: ignore[attr-defined]


@dataclass(kw_only=True)
class ElicitResponse:
    """Response to an elicitation request."""
    action: ElicitAction
    content: str | None


class ElicitationError:
    """Why an elicitation call failed."""
    if TYPE_CHECKING:
        UnknownClient: ClassVar[type["_ElicitationError_UnknownClient"]]
        HandlerFailed: ClassVar[type["_ElicitationError_HandlerFailed"]]
        TimedOut: ClassVar[type["_ElicitationError_TimedOut"]]
        _CASES: ClassVar[dict[str, type]]
        @staticmethod
        def lift(raw: _WitVariant) -> "ElicitationError": ...

class _ElicitationError_UnknownClient(_WitVariantCase, ElicitationError):
    """No handler registered for the given `client-id`."""
    tag = 'unknown-client'
ElicitationError.UnknownClient = _ElicitationError_UnknownClient  # type: ignore[attr-defined]

class _ElicitationError_HandlerFailed(_WitVariantCase, ElicitationError):
    """Handler raised an exception."""
    tag = 'handler-failed'
ElicitationError.HandlerFailed = _ElicitationError_HandlerFailed  # type: ignore[attr-defined]

class _ElicitationError_TimedOut(_WitVariantCase, ElicitationError):
    """Request timed out waiting for a human response."""
    tag = 'timed-out'
ElicitationError.TimedOut = _ElicitationError_TimedOut  # type: ignore[attr-defined]

ElicitationError._CASES = {  # type: ignore[attr-defined]
    'unknown-client': ElicitationError.UnknownClient,
    'handler-failed': ElicitationError.HandlerFailed,
    'timed-out': ElicitationError.TimedOut,
}


def _ElicitationError_lift(raw: _WitVariant) -> ElicitationError:
    cls = ElicitationError._CASES.get(raw.tag)  # type: ignore[attr-defined]
    if cls is None:
        raise ValueError(f'unknown ElicitationError arm: {raw.tag!r}')
    return cls(raw.payload)
ElicitationError.lift = staticmethod(_ElicitationError_lift)  # type: ignore[attr-defined]
