# 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

if typing.TYPE_CHECKING:
    from .edit_conditional_object_property import EditConditionalObjectPropertyParams


class EditConditionalPropertyParams(typing_extensions.TypedDict):
    """
    Field-level schema fragment used inside conditional clauses. These condition objects support nested JSON
    Schema structure such as `type`, `enum`, `items`, `properties`, `required`, and `contains`, but do not
    allow any `extend_edit:*` placement or styling keys.
    """

    type: typing_extensions.NotRequired[typing.Any]
    """
    JSON Schema type for the conditional property. Can be a simple type such as `"object"` or `"array"`,
    a nullable tuple like `["string", "null"]`, or omitted for enum-only constraints.
    """

    description: typing_extensions.NotRequired[str]
    """
    Description of the field constraint.
    """

    enum: typing_extensions.NotRequired[typing.Sequence[str]]
    """
    Allowed values for enum-based conditional constraints.
    """

    items: typing_extensions.NotRequired["EditConditionalObjectPropertyParams"]
    """
    Nested array item schema for conditional array constraints.
    """

    properties: typing_extensions.NotRequired[typing.Dict[str, "EditConditionalPropertyParams"]]
    """
    Nested object property constraints.
    """

    required: typing_extensions.NotRequired[typing.Sequence[str]]
    """
    Required nested object properties.
    """

    additional_properties: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="additionalProperties")]
    ]
    """
    Whether additional nested object properties are allowed.
    """

    const: typing_extensions.NotRequired[typing.Any]
    """
    Exact value that the property must match.
    """

    pattern: typing_extensions.NotRequired[str]
    """
    Regular expression that string values must match.
    """

    contains: typing_extensions.NotRequired["EditConditionalPropertyParams"]
    """
    Conditional schema that at least one array item must satisfy.
    """

    minimum: typing_extensions.NotRequired[float]
    """
    Inclusive lower bound for numeric values.
    """

    maximum: typing_extensions.NotRequired[float]
    """
    Inclusive upper bound for numeric values.
    """

    exclusive_minimum: typing_extensions.NotRequired[
        typing_extensions.Annotated[float, FieldMetadata(alias="exclusiveMinimum")]
    ]
    """
    Exclusive lower bound for numeric values.
    """

    exclusive_maximum: typing_extensions.NotRequired[
        typing_extensions.Annotated[float, FieldMetadata(alias="exclusiveMaximum")]
    ]
    """
    Exclusive upper bound for numeric values.
    """

    min_length: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="minLength")]]
    """
    Minimum string length.
    """

    max_length: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="maxLength")]]
    """
    Maximum string length.
    """

    min_items: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="minItems")]]
    """
    Minimum number of array items.
    """

    max_items: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="maxItems")]]
    """
    Maximum number of array items.
    """

    min_contains: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="minContains")]]
    """
    Minimum number of matching items for `contains`.
    """

    max_contains: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="maxContains")]]
    """
    Maximum number of matching items for `contains`.
    """
