# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class Workspace(UncheckedBaseModel):
    """
    A ModelSerializer that takes additional arguments for
    "fields", "omit" and "expand" in order to
    control which fields are displayed, and whether to replace simple
    values with complex, nested serializations
    """

    color: typing.Optional[str] = None
    created_by: typing.Optional[int] = None
    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Workspace description
    """

    id: typing.Optional[int] = None
    is_archived: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Workspace is archived
    """

    is_personal: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Workspace is a personal user workspace
    """

    membership: typing.Optional[str] = None
    projects_count: typing.Optional[int] = None
    title: str = pydantic.Field()
    """
    Workspace name
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
