# !!!
# WARNING: This file is autogenerated
# Only modify code within MANUAL() sections
# or your changes may be overwritten later!
# !!!

from __future__ import annotations

from typing import List, Optional

import pydantic

from stytch.core.response_base import ResponseBase


class PolicyResource(pydantic.BaseModel):
    resource_id: str
    description: str
    actions: List[str]


class PolicyRolePermission(pydantic.BaseModel):
    resource_id: str
    actions: List[str]


class PolicyRole(pydantic.BaseModel):
    role_id: str
    description: str
    permissions: List[PolicyRolePermission]


class PolicyScopePermission(pydantic.BaseModel):
    resource_id: str
    actions: List[str]


class PolicyScope(pydantic.BaseModel):
    scope: str
    description: str
    permissions: List[PolicyScopePermission]


class Policy(pydantic.BaseModel):
    roles: List[PolicyRole]
    resources: List[PolicyResource]
    scopes: List[PolicyScope]


class PolicyResponse(ResponseBase):
    policy: Optional[Policy] = None
