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

from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import Literal, Union
from typing_extensions import Annotated, TypedDict


WorkspaceMemberRole = Union[
    Literal[
        "admin",
        "member",
    ],
    UnrecognizedStr,
]
r"""Role of the member in the workspace"""


class WorkspaceMemberTypedDict(TypedDict):
    created_at: str
    r"""ISO 8601 timestamp of when the membership was created"""
    id: str
    r"""Unique identifier for the workspace membership"""
    role: WorkspaceMemberRole
    r"""Role of the member in the workspace"""
    user_id: str
    r"""Clerk user ID of the member"""
    workspace_id: str
    r"""ID of the workspace"""


class WorkspaceMember(BaseModel):
    created_at: str
    r"""ISO 8601 timestamp of when the membership was created"""

    id: str
    r"""Unique identifier for the workspace membership"""

    role: Annotated[WorkspaceMemberRole, PlainValidator(validate_open_enum(False))]
    r"""Role of the member in the workspace"""

    user_id: str
    r"""Clerk user ID of the member"""

    workspace_id: str
    r"""ID of the workspace"""
