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

import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.created_at import CreatedAt
from .extract_config import ExtractConfigParams


class ExtractorVersionParams(typing_extensions.TypedDict):
    object: typing.Literal["extractor_version"]
    """
    The type of object. Will always be `"extractor_version"`.
    """

    id: str
    """
    The unique identifier for this version of the extractor.
    
    Example: `"exv_xK9mLPqRtN3vS8wF5hB2cQ"`
    """

    description: typing.Optional[str]
    """
    A description of this version of the extractor.
    
    Example: `"Updated extraction fields for new invoice format"`
    """

    version: str
    """
    The version number or identifier for this specific version of the extractor. The draft version will have version="draft".
    
    Examples: `"1.0"`, `"2.1"`, `"draft"`
    """

    config: ExtractConfigParams
    """
    The configuration settings for this version of the extractor. This is a union of two possible shapes:
    
    - **[JSON Schema config](https://docs.extend.ai/2026-02-09/product/extraction/schema):** The current config format. All extractors created through this API version use this shape.
    - **[Legacy config](https://docs.extend.ai/2025-04-21/product/legacy/legacy-schema):** A fields-array config from a previous API version. This shape is only returned for extractors that were originally configured with the legacy format. This API version does not support creating extractors with legacy configs.
    """

    extractor_id: typing_extensions.Annotated[str, FieldMetadata(alias="extractorId")]
    """
    The ID of the extractor that this version belongs to.
    
    Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"`
    """

    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")]
