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

from ...core.pydantic_utilities import UniversalBaseModel
import typing
from .int_key_value import IntKeyValue
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class BucketAgg(UniversalBaseModel):
    """
    Aggregation buckets for entities in a project.
    """

    key: str
    doc_count: int
    label: typing.Optional[str] = None
    comment: typing.Optional[str] = None
    hs_code_sums: typing.Optional[IntKeyValue] = 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
