# 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 .test_tool_success_response_validation_results import TestToolSuccessResponseValidationResults


class TestToolSuccessResponse(UniversalBaseModel):
    """
    Successful execution response from testing a Lambda tool.
    """

    type: typing.Literal["success"] = "success"
    output: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    The output returned by the function.
    """

    latency_millis: int = pydantic.Field()
    """
    Time taken to execute the function in milliseconds.
    """

    memory_used_mb: typing.Optional[int] = pydantic.Field(default=None)
    """
    Memory used during execution in megabytes.
    """

    validation_results: typing.Optional[TestToolSuccessResponseValidationResults] = pydantic.Field(default=None)
    """
    Results of input/output schema validation.
    """

    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
