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

from __future__ import annotations
from typing import Optional
from typing_extensions import NotRequired, TypedDict
from unkey.py.types import BaseModel


class V2PermissionsCreatePermissionRequestBodyTypedDict(TypedDict):
    name: str
    r"""Creates a permission with this human-readable name that describes its purpose.
    Names must be unique within your workspace to prevent conflicts during assignment.
    Use clear, semantic names that developers can easily understand when building authorization logic.
    Consider using hierarchical naming conventions like 'resource.action' for better organization.

    Examples: 'users.read', 'billing.write', 'analytics.view', 'admin.manage'

    """
    slug: str
    r"""Creates a URL-safe identifier for this permission that can be used in APIs and integrations.
    Must start with a letter and contain only letters, numbers, periods, underscores, and hyphens.
    Slugs are often used in REST endpoints, configuration files, and external integrations.
    Should closely match the name but in a format suitable for technical usage.
    Must be unique within your workspace to ensure reliable permission lookups.

    Keep slugs concise but descriptive for better developer experience.

    """
    description: NotRequired[str]
    r"""Provides detailed documentation of what this permission grants access to.
    Include information about affected resources, allowed actions, and any important limitations.
    This internal documentation helps team members understand permission scope and security implications.
    Not visible to end users - designed for development teams and security audits.

    Consider documenting:
    - What resources can be accessed
    - What operations are permitted
    - Any conditions or limitations
    - Related permissions that might be needed

    """


class V2PermissionsCreatePermissionRequestBody(BaseModel):
    name: str
    r"""Creates a permission with this human-readable name that describes its purpose.
    Names must be unique within your workspace to prevent conflicts during assignment.
    Use clear, semantic names that developers can easily understand when building authorization logic.
    Consider using hierarchical naming conventions like 'resource.action' for better organization.

    Examples: 'users.read', 'billing.write', 'analytics.view', 'admin.manage'

    """

    slug: str
    r"""Creates a URL-safe identifier for this permission that can be used in APIs and integrations.
    Must start with a letter and contain only letters, numbers, periods, underscores, and hyphens.
    Slugs are often used in REST endpoints, configuration files, and external integrations.
    Should closely match the name but in a format suitable for technical usage.
    Must be unique within your workspace to ensure reliable permission lookups.

    Keep slugs concise but descriptive for better developer experience.

    """

    description: Optional[str] = None
    r"""Provides detailed documentation of what this permission grants access to.
    Include information about affected resources, allowed actions, and any important limitations.
    This internal documentation helps team members understand permission scope and security implications.
    Not visible to end users - designed for development teams and security audits.

    Consider documenting:
    - What resources can be accessed
    - What operations are permitted
    - Any conditions or limitations
    - Related permissions that might be needed

    """
