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

from __future__ import annotations
from .ratelimitresponse import RatelimitResponse, RatelimitResponseTypedDict
import pydantic
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
from unkey.py.types import BaseModel


class IdentityTypedDict(TypedDict):
    id: str
    r"""Identity ID"""
    external_id: str
    r"""External identity ID"""
    meta: NotRequired[Dict[str, Any]]
    r"""Identity metadata"""
    ratelimits: NotRequired[List[RatelimitResponseTypedDict]]
    r"""Identity ratelimits"""


class Identity(BaseModel):
    id: str
    r"""Identity ID"""

    external_id: Annotated[str, pydantic.Field(alias="externalId")]
    r"""External identity ID"""

    meta: Optional[Dict[str, Any]] = None
    r"""Identity metadata"""

    ratelimits: Optional[List[RatelimitResponse]] = None
    r"""Identity ratelimits"""
