# 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 CredentialTestResult(UniversalBaseModel):
    """
    Result of a credential test.
    """

    credential_id: str = pydantic.Field()
    """
    Credential ID
    """

    tool_key: str = pydantic.Field()
    """
    Tool key
    """

    success: bool = pydantic.Field()
    """
    Whether the test succeeded
    """

    action_tested: str = pydantic.Field()
    """
    Action that was tested
    """

    message: str = pydantic.Field()
    """
    Result message
    """

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

    tested_at: dt.datetime = pydantic.Field()
    """
    Timestamp of test
    """

    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
