"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from openrouter.components import activityitem as components_activityitem
from openrouter.types import BaseModel
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class GetUserActivityGlobalsTypedDict(TypedDict):
    http_referer: NotRequired[str]
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """
    x_title: NotRequired[str]
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """


class GetUserActivityGlobals(BaseModel):
    http_referer: Annotated[
        Optional[str],
        pydantic.Field(alias="HTTP-Referer"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """

    x_title: Annotated[
        Optional[str],
        pydantic.Field(alias="X-Title"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """


class GetUserActivityRequestTypedDict(TypedDict):
    http_referer: NotRequired[str]
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """
    x_title: NotRequired[str]
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """
    date_: NotRequired[str]
    r"""Filter by a single UTC date in the last 30 days (YYYY-MM-DD format)."""


class GetUserActivityRequest(BaseModel):
    http_referer: Annotated[
        Optional[str],
        pydantic.Field(alias="HTTP-Referer"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """

    x_title: Annotated[
        Optional[str],
        pydantic.Field(alias="X-Title"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """

    date_: Annotated[
        Optional[str],
        pydantic.Field(alias="date"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Filter by a single UTC date in the last 30 days (YYYY-MM-DD format)."""


class GetUserActivityResponseTypedDict(TypedDict):
    r"""Returns user activity data grouped by endpoint"""

    data: List[components_activityitem.ActivityItemTypedDict]
    r"""List of activity items"""


class GetUserActivityResponse(BaseModel):
    r"""Returns user activity data grouped by endpoint"""

    data: List[components_activityitem.ActivityItem]
    r"""List of activity items"""
