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

from __future__ import annotations
import pydantic
from typing import List
from typing_extensions import Annotated, TypedDict
from unkey.py.types import BaseModel


class V2KeysAddPermissionsRequestBodyTypedDict(TypedDict):
    key_id: str
    r"""Specifies which key receives the additional permissions using the database identifier returned from `keys.createKey`.
    Do not confuse this with the actual API key string that users include in requests.

    """
    permissions: List[str]
    r"""Grants additional permissions to the key through direct assignment or automatic creation.
    Duplicate permissions are ignored automatically, making this operation idempotent.

    Adding permissions never removes existing permissions or role-based permissions.

    Any permissions that do not exist will be auto created if the root key has permissions, otherwise this operation will fail with a 403 error.

    """


class V2KeysAddPermissionsRequestBody(BaseModel):
    key_id: Annotated[str, pydantic.Field(alias="keyId")]
    r"""Specifies which key receives the additional permissions using the database identifier returned from `keys.createKey`.
    Do not confuse this with the actual API key string that users include in requests.

    """

    permissions: List[str]
    r"""Grants additional permissions to the key through direct assignment or automatic creation.
    Duplicate permissions are ignored automatically, making this operation idempotent.

    Adding permissions never removes existing permissions or role-based permissions.

    Any permissions that do not exist will be auto created if the root key has permissions, otherwise this operation will fail with a 403 error.

    """
