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

from .user_message_base import UserMessageBase
import typing_extensions
from .entity_id import EntityId
from ...core.serialization import FieldMetadata
import pydantic
import typing
from .user_message_attachment import UserMessageAttachment
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class UserMessage(UserMessageBase):
    conversation_message_id: typing_extensions.Annotated[EntityId, FieldMetadata(alias="conversationMessageId")] = (
        pydantic.Field()
    )
    """
    The ID that uniquely identifies this message within the conversation
    """

    language: typing.Optional[str] = pydantic.Field(default=None)
    """
    The language of the message in ISO 639-1 code format
    """

    attachments: typing.List[UserMessageAttachment] = pydantic.Field()
    """
    The attachments associated with the message
    """

    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
