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

from __future__ import annotations
from .meta import Meta, MetaTypedDict
from .permission import Permission, PermissionTypedDict
from typing import List
from typing_extensions import TypedDict
from unkey.py.types import BaseModel


class V2KeysSetPermissionsResponseBodyTypedDict(TypedDict):
    meta: MetaTypedDict
    r"""Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team."""
    data: List[PermissionTypedDict]
    r"""Complete list of all permissions now directly assigned to the key after the set operation has completed.

    The response includes:
    - The comprehensive, updated set of direct permissions (reflecting the complete replacement)
    - Both ID and name for each permission for easy reference
    - Permissions sorted alphabetically by name for consistent response format

    Important notes:
    - This only shows direct permissions, not those granted through roles
    - An empty array means the key has no direct permissions assigned
    - For a complete permission picture including roles, use keys.getKey instead
    """


class V2KeysSetPermissionsResponseBody(BaseModel):
    meta: Meta
    r"""Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team."""

    data: List[Permission]
    r"""Complete list of all permissions now directly assigned to the key after the set operation has completed.

    The response includes:
    - The comprehensive, updated set of direct permissions (reflecting the complete replacement)
    - Both ID and name for each permission for easy reference
    - Permissions sorted alphabetically by name for consistent response format

    Important notes:
    - This only shows direct permissions, not those granted through roles
    - An empty array means the key has no direct permissions assigned
    - For a complete permission picture including roles, use keys.getKey instead
    """
