# 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 .glob_file_info import GlobFileInfo


class FileGlobResult(UniversalBaseModel):
    """
    Enhanced glob result
    """

    path: str = pydantic.Field()
    """
    Base directory path
    """

    pattern: str = pydantic.Field()
    """
    Glob pattern used
    """

    files: typing.Optional[typing.List[GlobFileInfo]] = pydantic.Field(default=None)
    """
    List of matched files
    """

    total_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total number of matches
    """

    truncated: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether results were truncated
    """

    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
