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

from __future__ import annotations
from datetime import datetime
from duckyai.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class APIKeyTypedDict(TypedDict):
    id: str
    r"""The composite ID of the API key (project_id:key_name)"""
    key_name: str
    r"""The name of the API key"""
    created_by: str
    r"""The identifier of the user who created the API key"""
    created_at: datetime
    r"""The timestamp when the API key was created"""
    key: str
    r"""The API key"""
    last_used_at: NotRequired[datetime]
    r"""The timestamp when the API key was last used"""


class APIKey(BaseModel):
    id: str
    r"""The composite ID of the API key (project_id:key_name)"""

    key_name: str
    r"""The name of the API key"""

    created_by: str
    r"""The identifier of the user who created the API key"""

    created_at: datetime
    r"""The timestamp when the API key was created"""

    key: str
    r"""The API key"""

    last_used_at: Optional[datetime] = None
    r"""The timestamp when the API key was last used"""
