# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class TextToDialogueWebsocketError(UncheckedBaseModel):
    message: str = pydantic.Field()
    """
    Human-readable error description.
    """

    error: str = pydantic.Field()
    """
    Machine-readable error identifier (for example `authentication_required`).
    """

    code: int = pydantic.Field()
    """
    WebSocket close code that will follow this payload.
    """

    param: typing.Optional[str] = pydantic.Field(default=None)
    """
    Field name related to the error, when applicable.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
