# 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 .execution_configuration import ExecutionConfiguration


class UpdateLambdaToolRequest(UniversalBaseModel):
    """
    Request to update a lambda tool, allowing modifications to code, configuration, and metadata.

    When code is updated, input and output schemas are automatically re-discovered from function parameter type annotations.
    """

    type: typing.Literal["lambda"] = "lambda"
    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the tool should be enabled or disabled.
    """

    title: typing.Optional[str] = pydantic.Field(default=None)
    """
    Updated user-friendly display name for the tool.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Updated description of what the tool does.
    """

    code: typing.Optional[str] = pydantic.Field(default=None)
    """
    Updated code for the lambda function. Use function parameter type annotations for automatic schema discovery.
    """

    execution_configuration: typing.Optional[ExecutionConfiguration] = pydantic.Field(default=None)
    """
    Updated execution configuration.
    """

    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
