# 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 SummaryResponse(UniversalBaseModel):
    """
    Dashboard summary with all key metrics.
    """

    total_sessions: int = pydantic.Field()
    """
    Total number of sessions in date range
    """

    active_sessions: int = pydantic.Field()
    """
    Currently active sessions (initializing, joining, active, recording)
    """

    completed_sessions: int = pydantic.Field()
    """
    Completed sessions
    """

    failed_sessions: int = pydantic.Field()
    """
    Failed sessions
    """

    total_duration_hours: float = pydantic.Field()
    """
    Sum of all session durations in hours
    """

    avg_duration_minutes: float = pydantic.Field()
    """
    Average session duration in minutes
    """

    total_participants_unique: int = pydantic.Field()
    """
    Approximate unique participant count from participant_history
    """

    platform_distribution: typing.Dict[str, int] = pydantic.Field()
    """
    Session counts by platform (e.g., {'meet': 15, 'zoom': 8})
    """

    success_rate: float = pydantic.Field()
    """
    Completed / (completed + failed), 0.0 when no completed or failed
    """

    sessions_today: int = pydantic.Field()
    """
    Sessions created today
    """

    sessions_this_week: int = pydantic.Field()
    """
    Sessions created in the last 7 days
    """

    transcription_enabled_rate: float = pydantic.Field()
    """
    Fraction of sessions with transcription enabled
    """

    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
