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

from .base_search_response_dto import BaseSearchResponseDto
import typing
from .aggregations import Aggregations
import pydantic
from .user_input_dto import UserInputDto
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class AggregationCountResponseDto(BaseSearchResponseDto):
    """
    The response model for a successful `Aggregation count` request. Response field behavior:
    - Required fields are guaranteed to be present and non-null.
    - Optional fields may be `null`/`undefined` if the data couldn't be extracted
    during processing.
    """

    aggregations: typing.Optional[Aggregations] = pydantic.Field(default=None)
    """
    The aggregation results. Can be either a dictionary or a list of dictionaries.
    """

    user_input: typing.Optional[UserInputDto] = 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
