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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .group_project import GroupProject
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Group(UniversalBaseModel):
    id: str = pydantic.Field(alias="_id")
    name: str
    namespace: typing.Optional[str] = None
    host_name: typing.Optional[str] = pydantic.Field(alias="hostName", default=None)
    type: typing.Optional[str] = None
    property_type: typing.Optional[str] = pydantic.Field(alias="propertyType", default=None)
    user: str
    projects: typing.Optional[typing.List[GroupProject]] = None
    is_owner: typing.Optional[bool] = pydantic.Field(alias="isOwner", default=None)
    is_admin: typing.Optional[bool] = pydantic.Field(alias="isAdmin", default=None)
    is_editor: typing.Optional[bool] = pydantic.Field(alias="isEditor", default=None)

    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
