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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .literal_json_schema_property_constant_value import LiteralJsonSchemaPropertyConstantValue
from .literal_json_schema_property_type import LiteralJsonSchemaPropertyType


class LiteralJsonSchemaProperty(UncheckedBaseModel):
    """
    Schema property for literal JSON types. IMPORTANT: Only ONE of the following fields can be set: description (LLM provides value), dynamic_variable (value from variable), is_system_provided (system provides value), or constant_value (fixed value). These are mutually exclusive.
    """

    type: LiteralJsonSchemaPropertyType
    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    The description of the property. When set, the LLM will provide the value based on this description. Mutually exclusive with dynamic_variable, is_system_provided, and constant_value.
    """

    enum: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of allowed string values for string type parameters
    """

    is_system_provided: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If true, the value will be populated by the system at runtime. Used by API Integration Webhook tools for templating. Mutually exclusive with description, dynamic_variable, and constant_value.
    """

    dynamic_variable: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the dynamic variable to use for this property's value. Mutually exclusive with description, is_system_provided, and constant_value.
    """

    constant_value: typing.Optional[LiteralJsonSchemaPropertyConstantValue] = pydantic.Field(default=None)
    """
    A constant value to use for this property. Mutually exclusive with description, dynamic_variable, and is_system_provided.
    """

    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
