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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from .agent_user_row import AgentUserRow
from .table_response_base import TableResponseBase


class AgentUserTableResponse(TableResponseBase):
    """
    Examples
    --------
    import datetime

    from mavenagi.analytics import (
        AgentUserRow,
        AgentUserTableResponse,
        CellData_Double,
        FieldValue_DateTime,
    )

    AgentUserTableResponse(
        headers=["user_count"],
        rows=[
            AgentUserRow(
                identifier={
                    "CreatedAt": FieldValue_DateTime(
                        value=datetime.datetime.fromisoformat(
                            "2023-10-01 00:00:00+00:00",
                        )
                    )
                },
                data={"user_count": CellData_Double(value=5.0)},
            )
        ],
    )
    """

    rows: typing.List[AgentUserRow] = pydantic.Field()
    """
    Each row contains the user count for the given search query and corresponding time grouping.
    """

    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
