# 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 TopUserItem(UniversalBaseModel):
    """
    Individual user in the top users ranking.
    """

    user_id: str = pydantic.Field()
    """
    User ID
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    User's full name
    """

    email: str = pydantic.Field()
    """
    User's email address
    """

    total_cost_chf: float = pydantic.Field()
    """
    Total cost in CHF
    """

    total_requests: int = pydantic.Field()
    """
    Total number of requests
    """

    total_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total tokens consumed
    """

    total_synapses: typing.Optional[float] = pydantic.Field(default=None)
    """
    Total synapses consumed
    """

    percentage_of_org: typing.Optional[float] = pydantic.Field(default=None)
    """
    User's share of total org cost
    """

    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
