"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from dataclasses_json import Undefined, dataclass_json
from dub import utils
from enum import Enum
from typing import List, Optional


class Plan(str, Enum):
    r"""The plan of the workspace."""
    FREE = 'free'
    PRO = 'pro'
    BUSINESS = 'business'
    BUSINESS_PLUS = 'business plus'
    BUSINESS_EXTRA = 'business extra'
    BUSINESS_MAX = 'business max'
    ENTERPRISE = 'enterprise'


class Role(str, Enum):
    r"""The role of the authenticated user in the workspace."""
    OWNER = 'owner'
    MEMBER = 'member'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class Users:
    role: Role = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('role') }})
    r"""The role of the authenticated user in the workspace."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class Domains:
    slug: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('slug') }})
    r"""The domain name."""
    primary: Optional[bool] = dataclasses.field(default=False, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('primary'), 'exclude': lambda f: f is None }})
    r"""Whether the domain is the primary domain for the workspace."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class WorkspaceSchema:
    UNSET='__SPEAKEASY_UNSET__'
    id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }})
    r"""The unique ID of the workspace."""
    name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }})
    r"""The name of the workspace."""
    slug: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('slug') }})
    r"""The slug of the workspace."""
    usage: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('usage') }})
    r"""The usage of the workspace."""
    usage_limit: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('usageLimit') }})
    r"""The usage limit of the workspace."""
    links_usage: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('linksUsage') }})
    r"""The links usage of the workspace."""
    links_limit: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('linksLimit') }})
    r"""The links limit of the workspace."""
    domains_limit: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('domainsLimit') }})
    r"""The domains limit of the workspace."""
    tags_limit: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tagsLimit') }})
    r"""The tags limit of the workspace."""
    users_limit: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('usersLimit') }})
    r"""The users limit of the workspace."""
    plan: Plan = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('plan') }})
    r"""The plan of the workspace."""
    stripe_id: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('stripeId') }})
    r"""The Stripe ID of the workspace."""
    billing_cycle_start: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billingCycleStart') }})
    r"""The date and time when the billing cycle starts for the workspace."""
    stripe_connect_id: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('stripeConnectId') }})
    r"""[BETA]: The Stripe Connect ID of the workspace."""
    created_at: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdAt') }})
    r"""The date and time when the workspace was created."""
    users: List[Users] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('users') }})
    r"""The role of the authenticated user in the workspace."""
    domains: List[Domains] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('domains') }})
    r"""The domains of the workspace."""
    invite_code: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('inviteCode') }})
    r"""The invite code of the workspace."""
    logo: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('logo'), 'exclude': lambda f: f is WorkspaceSchema.UNSET }})
    r"""The logo of the workspace."""
    beta_tester: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('betaTester'), 'exclude': lambda f: f is None }})
    r"""Whether the workspace is enrolled in the beta testing program."""
    

