# 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 .posted_event_message_spec import PostedEventMessageSpec


class PostedEventMessageSpecs(UniversalBaseModel):
    """
    Collection of event messages returned by the server.

    Event messages are sent by the server when specific events occur during a chat session. These messages are used to configure behaviors for EVI, such as controlling how EVI starts a new conversation.
    """

    on_inactivity_timeout: typing.Optional[PostedEventMessageSpec] = None
    on_max_duration_timeout: typing.Optional[PostedEventMessageSpec] = None
    on_new_chat: typing.Optional[PostedEventMessageSpec] = 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
