# 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 .file_response import FileResponse


class FileBatchUploadResponse(UniversalBaseModel):
    """
    Response for batch file upload.
    """

    success: bool = pydantic.Field()
    """
    Whether all uploads succeeded
    """

    message: str = pydantic.Field()
    """
    Summary message
    """

    files: typing.List[FileResponse] = pydantic.Field()
    """
    Uploaded files
    """

    total_uploaded: int = pydantic.Field()
    """
    Number of successful uploads
    """

    total_failed: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of failed uploads
    """

    errors: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
    """
    Error details for failed 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
