# 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
from .auto_sync_info import AutoSyncInfo
from .document_usage_mode_enum import DocumentUsageModeEnum
from .external_folder_sync_info import ExternalFolderSyncInfo
from .get_knowledge_base_summary_folder_response_model_dependent_agents_item import (
    GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem,
)
from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel
from .knowledge_base_folder_path_segment_summary_response_model import (
    KnowledgeBaseFolderPathSegmentSummaryResponseModel,
)
from .resource_access_info import ResourceAccessInfo


class GetKnowledgeBaseSummaryFolderResponseModel(UncheckedBaseModel):
    id: str
    name: str
    metadata: KnowledgeBaseDocumentMetadataResponseModel
    supported_usages: typing.List[DocumentUsageModeEnum]
    access_info: ResourceAccessInfo
    folder_parent_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the parent folder, or null if the document is at the root level.
    """

    folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field(
        default=None
    )
    """
    The folder path segments leading to this entity, from root to parent folder.
    """

    dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] = pydantic.Field()
    """
    This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead.
    """

    children_count: int
    document_count: int = pydantic.Field()
    """
    Number of non-folder documents anywhere in this folder's subtree (recursive). Counting stops past 1000;
    """

    auto_sync_info: typing.Optional[AutoSyncInfo] = None
    external_sync_info: typing.Optional[ExternalFolderSyncInfo] = None
    is_frozen: typing.Optional[bool] = 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
