from __future__ import annotations

from typing import NotRequired, TypedDict

type ScalarValue = str | int | float | bool | None
type JsonValue = ScalarValue | list["JsonValue"] | dict[str, "JsonValue"]


class UsageAggregateProperties(TypedDict, total=False):
    subscriptionId: str
    subscriptionName: str
    resourceGroup: str
    resourceGroupName: str
    resourceId: str
    resourceName: str
    instanceId: str
    instanceName: str
    instanceData: str
    meterId: str
    meterName: str
    meterCategory: str
    meterSubCategory: str
    unit: str
    usageStart: str
    usageEnd: str
    usageStartTime: str
    usageEndTime: str
    quantity: ScalarValue
    infoFields: dict[str, JsonValue]


class UsageAggregate(TypedDict, total=False):
    id: str
    name: str
    type: str
    kind: str
    tags: dict[str, str]
    properties: UsageAggregateProperties


class UsageAggregatesResponse(TypedDict):
    value: list[UsageAggregate]
    nextLink: NotRequired[str]
