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

import typing

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


class DurationBucket(UniversalBaseModel):
    """
    One bucket in a duration distribution histogram.
    """

    label: str = pydantic.Field()
    """
    e.g., '0-5 min', '5-15 min'
    """

    min_seconds: float
    max_seconds: float
    count: int
    percentage: float

    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
