# 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 .rate_limit_response_tier import RateLimitResponseTier


class RateLimitResponse(UniversalBaseModel):
    """
    Response when rate limit is exceeded
    """

    error: typing.Optional[str] = None
    limit_per_minute: typing.Optional[int] = pydantic.Field(default=None)
    """
    Your per-minute limit
    """

    requests_this_minute: typing.Optional[int] = pydantic.Field(default=None)
    """
    Requests made in the current minute
    """

    daily_limit: typing.Optional[int] = pydantic.Field(default=None)
    """
    Your daily limit (present on daily limit errors)
    """

    requests_today: typing.Optional[int] = pydantic.Field(default=None)
    """
    Requests made today (present on daily limit errors)
    """

    tier: typing.Optional[RateLimitResponseTier] = None
    hint: typing.Optional[str] = pydantic.Field(default=None)
    """
    Upgrade guidance
    """

    support: typing.Optional[str] = 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
