"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from typing import Optional
from typing_extensions import NotRequired, TypedDict
from unkey.py.types import BaseModel


class KeysVerifyKeyRatelimitTypedDict(TypedDict):
    name: str
    r"""References an existing ratelimit by its name. Key Ratelimits will take precedence over identifier-based limits."""
    cost: NotRequired[int]
    r"""Optionally override how expensive this operation is and how many tokens are deducted from the current limit."""
    limit: NotRequired[int]
    r"""Optionally override the maximum number of requests allowed within the specified interval."""
    duration: NotRequired[int]
    r"""Optionally override the duration of the rate limit window duration."""


class KeysVerifyKeyRatelimit(BaseModel):
    name: str
    r"""References an existing ratelimit by its name. Key Ratelimits will take precedence over identifier-based limits."""

    cost: Optional[int] = 1
    r"""Optionally override how expensive this operation is and how many tokens are deducted from the current limit."""

    limit: Optional[int] = None
    r"""Optionally override the maximum number of requests allowed within the specified interval."""

    duration: Optional[int] = None
    r"""Optionally override the duration of the rate limit window duration."""
