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

from __future__ import annotations

import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.edit_dependent_required import EditDependentRequired
from .edit_conditional_property import EditConditionalPropertyParams


class EditConditionalClauseParams(typing_extensions.TypedDict):
    """
    Recursive conditional clause for edit schemas. Use these clauses with root-level `if` / `then` / `else`,
    `dependentRequired`, and logical combinators to model conditional field requirements.
    """

    properties: typing_extensions.NotRequired[typing.Dict[str, EditConditionalPropertyParams]]
    """
    Conditional field constraints keyed by top-level property name.
    """

    required: typing_extensions.NotRequired[typing.Sequence[str]]
    """
    List of fields that must be present when this clause applies.
    """

    dependent_required: typing_extensions.NotRequired[
        typing_extensions.Annotated[EditDependentRequired, FieldMetadata(alias="dependentRequired")]
    ]
    if_: typing_extensions.NotRequired[
        typing_extensions.Annotated["EditConditionalClauseParams", FieldMetadata(alias="if")]
    ]
    then: typing_extensions.NotRequired["EditConditionalClauseParams"]
    else_: typing_extensions.NotRequired[
        typing_extensions.Annotated["EditConditionalClauseParams", FieldMetadata(alias="else")]
    ]
    all_of: typing_extensions.NotRequired[
        typing_extensions.Annotated[typing.Sequence["EditConditionalClauseParams"], FieldMetadata(alias="allOf")]
    ]
    """
    List of nested conditional clauses that must all match.
    """

    one_of: typing_extensions.NotRequired[
        typing_extensions.Annotated[typing.Sequence["EditConditionalClauseParams"], FieldMetadata(alias="oneOf")]
    ]
    """
    List of nested conditional clauses where exactly one must match.
    """

    any_of: typing_extensions.NotRequired[
        typing_extensions.Annotated[typing.Sequence["EditConditionalClauseParams"], FieldMetadata(alias="anyOf")]
    ]
    """
    List of nested conditional clauses where at least one must match.
    """

    not_: typing_extensions.NotRequired[
        typing_extensions.Annotated["EditConditionalClauseParams", FieldMetadata(alias="not")]
    ]
