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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel
from .created_at import CreatedAt
from .extractor_version import ExtractorVersion
from .updated_at import UpdatedAt


class Extractor(UncheckedBaseModel):
    object: typing.Literal["extractor"] = pydantic.Field(default="extractor")
    """
    The type of object. Will always be `"extractor"`.
    """

    id: str = pydantic.Field()
    """
    The ID of the extractor.
    
    Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"`
    """

    name: str = pydantic.Field()
    """
    The name of the extractor.
    
    Example: `"Invoice Extractor"`
    """

    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")] = pydantic.Field(
        alias="createdAt"
    )
    updated_at: typing_extensions.Annotated[UpdatedAt, FieldMetadata(alias="updatedAt")] = pydantic.Field(
        alias="updatedAt"
    )
    draft_version: typing_extensions.Annotated[ExtractorVersion, FieldMetadata(alias="draftVersion")] = pydantic.Field(
        alias="draftVersion"
    )
    """
    The draft version of the extractor. This is the editable version in the Extend dashboard.
    """

    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


update_forward_refs(Extractor)
