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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class ExecutionLogEntry(UniversalBaseModel):
    """
    Execution log entry response.
    """

    id: str = pydantic.Field()
    """
    Log entry ID
    """

    tool_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    Tool key (e.g., clickup, github)
    """

    action_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Action that was executed
    """

    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Execution status
    """

    execution_time_ms: typing.Optional[int] = pydantic.Field(default=None)
    """
    Execution time in ms
    """

    error_code: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error code if failed
    """

    error_message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error message if failed
    """

    neurons_used: typing.Optional[int] = pydantic.Field(default=None)
    """
    Neurons consumed
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Execution timestamp
    """

    credential_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Credential used
    """

    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
