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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel


class EditConfigAdvancedOptions(UncheckedBaseModel):
    """
    Advanced options for the edit operation.
    """

    table_parsing_enabled: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="tableParsingEnabled")
    ] = pydantic.Field(alias="tableParsingEnabled", default=None)
    """
    Whether to parse table regions as arrays of objects. Defaults to `false`.
    """

    flatten_pdf: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="flattenPdf")] = pydantic.Field(
        alias="flattenPdf", default=None
    )
    """
    Whether to flatten the PDF (form widgets will not be editable with a PDF edit). Defaults to `true`.
    """

    radio_enums_enabled: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="radioEnumsEnabled")
    ] = pydantic.Field(alias="radioEnumsEnabled", default=None)
    """
    Whether to model radio fields as enums. This ensures only one radio widget is filled. Defaults to false.
    """

    native_fields_only: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="nativeFieldsOnly")] = (
        pydantic.Field(alias="nativeFieldsOnly", default=None)
    )
    """
    If enabled, only native AcroForm from the PDF will be imported and used in the schema (skips object detection). Defaults to false.
    """

    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
