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

from __future__ import annotations
from enum import Enum
from supertone.types import BaseModel
from supertone.utils import FieldMetadata, QueryParamMetadata
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class BucketWidth(str, Enum):
    r"""Time bucket width for aggregation"""

    HOUR = "hour"
    DAY = "day"


class BreakdownType(str, Enum):
    VOICE_ID = "voice_id"
    VOICE_NAME = "voice_name"
    API_KEY = "api_key"
    MODEL = "model"


class GetUsageRequestTypedDict(TypedDict):
    start_time: str
    r"""Start time in RFC3339 format"""
    end_time: str
    r"""End time in RFC3339 format"""
    bucket_width: NotRequired[BucketWidth]
    r"""Time bucket width for aggregation"""
    breakdown_type: NotRequired[List[BreakdownType]]
    r"""Dimensions to break down usage data"""
    page_size: NotRequired[float]
    r"""Number of results per page"""
    next_page_token: NotRequired[str]
    r"""Pagination token from previous response"""


class GetUsageRequest(BaseModel):
    start_time: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]
    r"""Start time in RFC3339 format"""

    end_time: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]
    r"""End time in RFC3339 format"""

    bucket_width: Annotated[
        Optional[BucketWidth],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = BucketWidth.DAY
    r"""Time bucket width for aggregation"""

    breakdown_type: Annotated[
        Optional[List[BreakdownType]],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Dimensions to break down usage data"""

    page_size: Annotated[
        Optional[float],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 10
    r"""Number of results per page"""

    next_page_token: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Pagination token from previous response"""
