# 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 .api_key_breakdown_item import ApiKeyBreakdownItem
from .assistant_breakdown_item import AssistantBreakdownItem
from .daily_breakdown_item import DailyBreakdownItem
from .department_breakdown_item import DepartmentBreakdownItem
from .flowplate_breakdown_item import FlowplateBreakdownItem
from .model_breakdown_item import ModelBreakdownItem
from .period_totals import PeriodTotals
from .priority_breakdown_item import PriorityBreakdownItem
from .user_breakdown_item import UserBreakdownItem


class UsageDetailReportResponse(UniversalBaseModel):
    """
    Response for GET /v1/analytics/usage/detail/{org_id}.
    """

    organization_id: str
    period: PeriodTotals
    by_model: typing.List[ModelBreakdownItem]
    by_api_key: typing.List[ApiKeyBreakdownItem]
    by_priority: typing.List[PriorityBreakdownItem]
    by_flowplate: typing.List[FlowplateBreakdownItem]
    by_user: typing.List[UserBreakdownItem]
    by_department: typing.List[DepartmentBreakdownItem]
    by_assistant: typing.List[AssistantBreakdownItem]
    daily_breakdown: typing.List[DailyBreakdownItem]
    generated_at: str = pydantic.Field()
    """
    ISO 8601 timestamp
    """

    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
