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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class UpdateDocumentRequest(UniversalBaseModel):
    """
    Schema for updating the document. For PUT requests, the request body metadata replaces the existing
    metadata. For PATCH requests, the request body metadata is merged with the existing metadata,
    adding or modifying only the specified fields.
    """

    metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    The metadata for a document as an arbitrary object. Properties of this object
    can be used by document level filter attributes.
    """

    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
