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

from __future__ import annotations
from .consumermetadata import ConsumerMetadata, ConsumerMetadataTypedDict
from .links import Links, LinksTypedDict
from .meta import Meta, MetaTypedDict
from .requestcountallocation import (
    RequestCountAllocation,
    RequestCountAllocationTypedDict,
)
from apideck_unify.types import BaseModel
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class DataTypedDict(TypedDict):
    consumer_id: NotRequired[str]
    application_id: NotRequired[str]
    metadata: NotRequired[ConsumerMetadataTypedDict]
    r"""The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended."""
    aggregated_request_count: NotRequired[float]
    request_counts: NotRequired[RequestCountAllocationTypedDict]
    created: NotRequired[str]
    modified: NotRequired[str]
    request_count_updated: NotRequired[str]
    services: NotRequired[List[str]]


class Data(BaseModel):
    consumer_id: Optional[str] = None

    application_id: Optional[str] = None

    metadata: Optional[ConsumerMetadata] = None
    r"""The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended."""

    aggregated_request_count: Optional[float] = None

    request_counts: Optional[RequestCountAllocation] = None

    created: Optional[str] = None

    modified: Optional[str] = None

    request_count_updated: Optional[str] = None

    services: Optional[List[str]] = None


class GetConsumersResponseTypedDict(TypedDict):
    r"""Consumers"""

    status_code: int
    r"""HTTP Response Status Code"""
    status: str
    r"""HTTP Response Status"""
    data: List[DataTypedDict]
    meta: NotRequired[MetaTypedDict]
    r"""Response metadata"""
    links: NotRequired[LinksTypedDict]
    r"""Links to navigate to previous or next pages through the API"""


class GetConsumersResponse(BaseModel):
    r"""Consumers"""

    status_code: int
    r"""HTTP Response Status Code"""

    status: str
    r"""HTTP Response Status"""

    data: List[Data]

    meta: Optional[Meta] = None
    r"""Response metadata"""

    links: Optional[Links] = None
    r"""Links to navigate to previous or next pages through the API"""
