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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .browse_folder_item_type import BrowseFolderItemType


class BrowseFolderItem(UniversalBaseModel):
    """
    A single item in the folder browser listing.
    """

    id: str = pydantic.Field()
    """
    Item ID
    """

    name: str = pydantic.Field()
    """
    Display name
    """

    type: BrowseFolderItemType = pydantic.Field()
    """
    Item type
    """

    path: typing.Optional[str] = pydantic.Field(default=None)
    """
    Navigation path for this item
    """

    has_children: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether expandable
    """

    child_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of children
    """

    web_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Web URL
    """

    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
