"""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 V2KeysSetRolesResponseBodyTypedDict(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 now directly assigned to the key after the set operation has completed.

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

    Important notes:
    - This response shows the final state after the complete replacement
    - If you provided an empty array in the request, this will also be empty
    - This only shows direct role assignments on the key
    - Role permissions are not expanded in this response - use keys.getKey for complete details
    - An empty array indicates the key now has no roles assigned at all
    """


class V2KeysSetRolesResponseBody(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 now directly assigned to the key after the set operation has completed.

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

    Important notes:
    - This response shows the final state after the complete replacement
    - If you provided an empty array in the request, this will also be empty
    - This only shows direct role assignments on the key
    - Role permissions are not expanded in this response - use keys.getKey for complete details
    - An empty array indicates the key now has no roles assigned at all
    """
