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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .update_message_response_role import UpdateMessageResponseRole


class UpdateMessageResponse(UniversalBaseModel):
    """
    Response schema for updated message.
    """

    id: str = pydantic.Field()
    """
    Message ID with msg_ prefix
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last update timestamp
    """

    thread_id: str = pydantic.Field()
    """
    Thread ID with thread_ prefix
    """

    role: UpdateMessageResponseRole = pydantic.Field()
    """
    Message role
    """

    content: str = pydantic.Field()
    """
    Message text content
    """

    attachments: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
    """
    File attachments
    """

    metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Custom metadata
    """

    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
