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

from __future__ import annotations
import pydantic
from typing_extensions import Annotated, TypedDict
from unkey.py.types import BaseModel


class V2KeysRerollKeyRequestBodyTypedDict(TypedDict):
    key_id: str
    r"""The database identifier of the key to reroll.

    This is the unique ID returned when creating or listing keys, NOT the actual API key token.
    You can find this ID in:
    - The response from `keys.createKey`
    - Key verification responses
    - The Unkey dashboard
    - API key listing endpoints

    """
    expiration: int
    r"""Duration in milliseconds until the ORIGINAL key is revoked, starting from now.

    This parameter controls the overlap period for key rotation:
    - Set to `0` to revoke the original key immediately
    - Positive values keep the original key active for the specified duration
    - Allows graceful migration by giving users time to update their credentials

    Common overlap periods:
    - Immediate revocation: 0
    - 1 hour grace period: 3600000
    - 24 hours grace period: 86400000
    - 7 days grace period: 604800000
    - 30 days grace period: 2592000000

    """


class V2KeysRerollKeyRequestBody(BaseModel):
    key_id: Annotated[str, pydantic.Field(alias="keyId")]
    r"""The database identifier of the key to reroll.

    This is the unique ID returned when creating or listing keys, NOT the actual API key token.
    You can find this ID in:
    - The response from `keys.createKey`
    - Key verification responses
    - The Unkey dashboard
    - API key listing endpoints

    """

    expiration: int
    r"""Duration in milliseconds until the ORIGINAL key is revoked, starting from now.

    This parameter controls the overlap period for key rotation:
    - Set to `0` to revoke the original key immediately
    - Positive values keep the original key active for the specified duration
    - Allows graceful migration by giving users time to update their credentials

    Common overlap periods:
    - Immediate revocation: 0
    - 1 hour grace period: 3600000
    - 24 hours grace period: 86400000
    - 7 days grace period: 604800000
    - 30 days grace period: 2592000000

    """
