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

from __future__ import annotations
from ...core.pydantic_utilities import UniversalBaseModel
import typing_extensions
import typing
from ...core.serialization import FieldMetadata
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class SubscribeEvent_Audio(UniversalBaseModel):
    """
    The response from the server sent through the WebSocket.
    """

    message_type: typing_extensions.Annotated[typing.Literal["audio"], FieldMetadata(alias="messageType")] = "audio"
    audio_content: typing_extensions.Annotated[str, FieldMetadata(alias="audioContent")]

    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


class SubscribeEvent_ControlSessionStart(UniversalBaseModel):
    """
    The response from the server sent through the WebSocket.
    """

    message_type: typing_extensions.Annotated[
        typing.Literal["controlSessionStart"], FieldMetadata(alias="messageType")
    ] = "controlSessionStart"
    reason: typing.Optional[str] = None

    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


class SubscribeEvent_ControlSessionStop(UniversalBaseModel):
    """
    The response from the server sent through the WebSocket.
    """

    message_type: typing_extensions.Annotated[
        typing.Literal["controlSessionStop"], FieldMetadata(alias="messageType")
    ] = "controlSessionStop"
    reason: typing.Optional[str] = None

    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


class SubscribeEvent_ControlAudioDone(UniversalBaseModel):
    """
    The response from the server sent through the WebSocket.
    """

    message_type: typing_extensions.Annotated[
        typing.Literal["controlAudioDone"], FieldMetadata(alias="messageType")
    ] = "controlAudioDone"
    reason: typing.Optional[str] = None

    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


SubscribeEvent = typing.Union[
    SubscribeEvent_Audio,
    SubscribeEvent_ControlSessionStart,
    SubscribeEvent_ControlSessionStop,
    SubscribeEvent_ControlAudioDone,
]
