# 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 .api_key_limit import ApiKeyLimit
from .api_limits import ApiLimits
from .limits_summary import LimitsSummary
from .organization_limits import OrganizationLimits


class UsageLimitsResponse(UniversalBaseModel):
    """
    Response model for GET /v1/analytics/usage/limits/{org_id}.
    """

    organization_limits: OrganizationLimits = pydantic.Field()
    """
    Organization-level limits
    """

    api_limits: ApiLimits = pydantic.Field()
    """
    API-level aggregated limits
    """

    api_key_limits: typing.List[ApiKeyLimit] = pydantic.Field()
    """
    Per-key breakdown
    """

    summary: LimitsSummary = pydantic.Field()
    """
    Overall statistics
    """

    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
