# 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 .edit_root_json import EditRootJson
from .edit_schema_generation_config_advanced_options import EditSchemaGenerationConfigAdvancedOptions


class EditSchemaGenerationConfig(UncheckedBaseModel):
    """
    Configuration options for edit schema generation.
    """

    input_schema: typing_extensions.Annotated[typing.Optional[EditRootJson], FieldMetadata(alias="inputSchema")] = (
        pydantic.Field(alias="inputSchema", default=None)
    )
    """
    Optional existing edit schema to map onto the detected form fields. When provided, the response may include a `mappingResult`
    that shows which input schema paths matched the generated form fields.
    """

    instructions: typing.Optional[str] = pydantic.Field(default=None)
    """
    Custom instructions provided for schema generation.
    """

    advanced_options: typing_extensions.Annotated[
        typing.Optional[EditSchemaGenerationConfigAdvancedOptions], FieldMetadata(alias="advancedOptions")
    ] = pydantic.Field(alias="advancedOptions", default=None)
    """
    Advanced options for schema generation.
    """

    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(EditSchemaGenerationConfig)
