# 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 .filesystem_file_response import FilesystemFileResponse


class ListFilesResponse(UniversalBaseModel):
    """
    Response model for listing files in a filesystem.
    """

    files: typing.List[FilesystemFileResponse] = pydantic.Field()
    """
    List of file entries.
    """

    filesystem_id: str = pydantic.Field()
    """
    The filesystem ID.
    """

    synced_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When the manifest was last synced.
    """

    total_count: int = pydantic.Field()
    """
    Total number of matching files.
    """

    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
