# 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_error_response_error import TestToolErrorResponseError


class TestToolErrorResponse(UniversalBaseModel):
    """
    Error response from testing a Lambda tool.
    """

    type: typing.Literal["error"] = "error"
    error: TestToolErrorResponseError = pydantic.Field()
    """
    Error information from the failed execution.
    """

    latency_millis: int = pydantic.Field()
    """
    Time taken before the error occurred in milliseconds.
    """

    memory_used_mb: typing.Optional[int] = pydantic.Field(default=None)
    """
    Memory used before the error occurred in megabytes.
    """

    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
