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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .agent_api_key_summary import AgentApiKeySummary


class AgentApiKeyCollectionStats(UniversalBaseModel):
    """
    Collection-level statistics for agent API keys.
    """

    total_keys: typing.Optional[int] = None
    active_keys: typing.Optional[int] = None
    revoked_keys: typing.Optional[int] = None
    suspended_keys: typing.Optional[int] = None
    expired_keys: typing.Optional[int] = None
    keys_needing_renewal: typing.Optional[int] = None
    total_requests_last_24_h: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="total_requests_last_24h")
    ] = None
    unique_clusters_accessed: typing.Optional[int] = None
    most_active_key: typing.Optional[AgentApiKeySummary] = None

    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
