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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .return_chat_status import ReturnChatStatus
from .return_config_spec import ReturnConfigSpec


class ReturnChat(UniversalBaseModel):
    """
    A description of chat and its status
    """

    chat_group_id: str = pydantic.Field()
    """
    Identifier for the Chat Group. Any chat resumed from this Chat will have the same `chat_group_id`. Formatted as a UUID.
    """

    config: typing.Optional[ReturnConfigSpec] = None
    end_timestamp: typing.Optional[int] = pydantic.Field(default=None)
    """
    Time at which the Chat ended. Measured in seconds since the Unix epoch.
    """

    event_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    The total number of events currently in this chat.
    """

    id: str = pydantic.Field()
    """
    Identifier for a Chat. Formatted as a UUID.
    """

    metadata: typing.Optional[str] = pydantic.Field(default=None)
    """
    Stringified JSON with additional metadata about the chat.
    """

    start_timestamp: int = pydantic.Field()
    """
    Time at which the Chat started. Measured in seconds since the Unix epoch.
    """

    status: ReturnChatStatus

    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
