# 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


class VectorStoreFileResponse(UniversalBaseModel):
    """
    Schema for vector store file response.
    """

    id: str = pydantic.Field()
    """
    Unique identifier for the file association
    """

    vector_store_id: str = pydantic.Field()
    """
    ID of the vector store
    """

    file_id: str = pydantic.Field()
    """
    ID of the file
    """

    added_by: typing.Optional[str] = pydantic.Field(default=None)
    """
    User ID who added the file (if added by user)
    """

    added_by_api_key_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    API key ID that added the file (if added by API key)
    """

    added_at: dt.datetime = pydantic.Field()
    """
    Timestamp when the file was added
    """

    processing_status: str = pydantic.Field()
    """
    Processing status: pending, processing, completed, failed
    """

    processing_started_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When processing started
    """

    processing_completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When processing completed
    """

    error_message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error message if processing failed
    """

    chunk_count: int = pydantic.Field()
    """
    Number of chunks created from this file
    """

    embedding_model: typing.Optional[str] = pydantic.Field(default=None)
    """
    Embedding model used for processing
    """

    file_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Original filename
    """

    file_size: typing.Optional[int] = pydantic.Field(default=None)
    """
    File size in bytes
    """

    mime_type: typing.Optional[str] = pydantic.Field(default=None)
    """
    File MIME type
    """

    estimated_completion_seconds: typing.Optional[int] = pydantic.Field(default=None)
    """
    Estimated seconds until processing completes (only for pending/processing status)
    """

    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
