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

from __future__ import annotations

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs


class DepartmentTreeResponse(UniversalBaseModel):
    """
    Nested tree node with children.
    """

    id: str
    name: str
    description: typing.Optional[str] = None
    parent_id: typing.Optional[str] = None
    path: str
    depth: int
    organization_id: str
    member_count: typing.Optional[int] = None
    is_active: typing.Optional[bool] = None
    is_default: typing.Optional[bool] = None
    color: typing.Optional[str] = None
    created_by: typing.Optional[str] = None
    created_at: typing.Optional[dt.datetime] = None
    children: typing.Optional[typing.List["DepartmentTreeResponse"]] = 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


update_forward_refs(DepartmentTreeResponse)
