# 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 .message import Message


class MessageListResponse(UniversalBaseModel):
    messages: typing.Optional[typing.List[Message]] = pydantic.Field(default=None)
    """
    A list of message objects.
    """

    row_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of messages returned.
    """

    total_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    The total number of messages.
    """

    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
