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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .tool_parameter_param_type import ToolParameterParamType
from .tool_parameter_validation_rules import ToolParameterValidationRules


class ToolParameter(UniversalBaseModel):
    pk_param_id: typing.Optional[str] = None
    param_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Parameter name
    """

    param_type: typing.Optional[ToolParameterParamType] = pydantic.Field(default=None)
    """
    Parameter data type
    """

    is_required: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this parameter is required
    """

    param_description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description of the parameter
    """

    default_value: typing.Optional[typing.Optional[typing.Any]] = None
    validation_rules: typing.Optional[ToolParameterValidationRules] = pydantic.Field(default=None)
    """
    Validation rules for the parameter
    """

    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
