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

from __future__ import annotations
from .meta import Meta, MetaTypedDict
from .role import Role, RoleTypedDict
from typing import List
from typing_extensions import TypedDict
from unkey.py.types import BaseModel


class V2KeysAddRolesResponseBodyTypedDict(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[RoleTypedDict]
    r"""Complete list of all roles directly assigned to the key after the operation completes.

    The response includes:
    - All roles now assigned to the key (both pre-existing and newly added)
    - Both ID and name of each role for easy reference

    Important notes:
    - The response shows the complete current state after the addition
    - An empty array means the key has no roles assigned (unlikely after an add operation)
    - This only shows direct role assignments, not inherited or nested roles
    - Role permissions are not expanded in this response - use keys.getKey for full details
    """


class V2KeysAddRolesResponseBody(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[Role]
    r"""Complete list of all roles directly assigned to the key after the operation completes.

    The response includes:
    - All roles now assigned to the key (both pre-existing and newly added)
    - Both ID and name of each role for easy reference

    Important notes:
    - The response shows the complete current state after the addition
    - An empty array means the key has no roles assigned (unlikely after an add operation)
    - This only shows direct role assignments, not inherited or nested roles
    - Role permissions are not expanded in this response - use keys.getKey for full details
    """
