# 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
from .agent_api_key_type import AgentApiKeyType


class AgentApiKey(UniversalBaseModel):
    agent_id: str = pydantic.Field()
    """
    The UUID of the agent
    """

    api_key_type: AgentApiKeyType = pydantic.Field()
    """
    The type of the agent API key (either internal or external)
    """

    created_at: dt.datetime = pydantic.Field()
    """
    When the agent API key was created
    """

    id: str = pydantic.Field()
    """
    The unique identifier of the agent API key.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The optional name of the agent API key.
    """

    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
