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

from __future__ import annotations
from datetime import datetime
from polar_sdk.types import BaseModel
from typing import Union
from typing_extensions import TypeAliasType, TypedDict


OrdersModelTypedDict = TypeAliasType("OrdersModelTypedDict", Union[int, float])


OrdersModel = TypeAliasType("OrdersModel", Union[int, float])


RevenueTypedDict = TypeAliasType("RevenueTypedDict", Union[int, float])


Revenue = TypeAliasType("Revenue", Union[int, float])


NetRevenueTypedDict = TypeAliasType("NetRevenueTypedDict", Union[int, float])


NetRevenue = TypeAliasType("NetRevenue", Union[int, float])


CumulativeRevenueTypedDict = TypeAliasType(
    "CumulativeRevenueTypedDict", Union[int, float]
)


CumulativeRevenue = TypeAliasType("CumulativeRevenue", Union[int, float])


NetCumulativeRevenueTypedDict = TypeAliasType(
    "NetCumulativeRevenueTypedDict", Union[int, float]
)


NetCumulativeRevenue = TypeAliasType("NetCumulativeRevenue", Union[int, float])


AverageOrderValueTypedDict = TypeAliasType(
    "AverageOrderValueTypedDict", Union[int, float]
)


AverageOrderValue = TypeAliasType("AverageOrderValue", Union[int, float])


NetAverageOrderValueTypedDict = TypeAliasType(
    "NetAverageOrderValueTypedDict", Union[int, float]
)


NetAverageOrderValue = TypeAliasType("NetAverageOrderValue", Union[int, float])


OneTimeProductsTypedDict = TypeAliasType("OneTimeProductsTypedDict", Union[int, float])


OneTimeProducts = TypeAliasType("OneTimeProducts", Union[int, float])


OneTimeProductsRevenueTypedDict = TypeAliasType(
    "OneTimeProductsRevenueTypedDict", Union[int, float]
)


OneTimeProductsRevenue = TypeAliasType("OneTimeProductsRevenue", Union[int, float])


OneTimeProductsNetRevenueTypedDict = TypeAliasType(
    "OneTimeProductsNetRevenueTypedDict", Union[int, float]
)


OneTimeProductsNetRevenue = TypeAliasType(
    "OneTimeProductsNetRevenue", Union[int, float]
)


NewSubscriptionsTypedDict = TypeAliasType(
    "NewSubscriptionsTypedDict", Union[int, float]
)


NewSubscriptions = TypeAliasType("NewSubscriptions", Union[int, float])


NewSubscriptionsRevenueTypedDict = TypeAliasType(
    "NewSubscriptionsRevenueTypedDict", Union[int, float]
)


NewSubscriptionsRevenue = TypeAliasType("NewSubscriptionsRevenue", Union[int, float])


NewSubscriptionsNetRevenueTypedDict = TypeAliasType(
    "NewSubscriptionsNetRevenueTypedDict", Union[int, float]
)


NewSubscriptionsNetRevenue = TypeAliasType(
    "NewSubscriptionsNetRevenue", Union[int, float]
)


RenewedSubscriptionsTypedDict = TypeAliasType(
    "RenewedSubscriptionsTypedDict", Union[int, float]
)


RenewedSubscriptions = TypeAliasType("RenewedSubscriptions", Union[int, float])


RenewedSubscriptionsRevenueTypedDict = TypeAliasType(
    "RenewedSubscriptionsRevenueTypedDict", Union[int, float]
)


RenewedSubscriptionsRevenue = TypeAliasType(
    "RenewedSubscriptionsRevenue", Union[int, float]
)


RenewedSubscriptionsNetRevenueTypedDict = TypeAliasType(
    "RenewedSubscriptionsNetRevenueTypedDict", Union[int, float]
)


RenewedSubscriptionsNetRevenue = TypeAliasType(
    "RenewedSubscriptionsNetRevenue", Union[int, float]
)


ActiveSubscriptionsTypedDict = TypeAliasType(
    "ActiveSubscriptionsTypedDict", Union[int, float]
)


ActiveSubscriptions = TypeAliasType("ActiveSubscriptions", Union[int, float])


MonthlyRecurringRevenueTypedDict = TypeAliasType(
    "MonthlyRecurringRevenueTypedDict", Union[int, float]
)


MonthlyRecurringRevenue = TypeAliasType("MonthlyRecurringRevenue", Union[int, float])


CommittedMonthlyRecurringRevenueTypedDict = TypeAliasType(
    "CommittedMonthlyRecurringRevenueTypedDict", Union[int, float]
)


CommittedMonthlyRecurringRevenue = TypeAliasType(
    "CommittedMonthlyRecurringRevenue", Union[int, float]
)


CheckoutsModelTypedDict = TypeAliasType("CheckoutsModelTypedDict", Union[int, float])


CheckoutsModel = TypeAliasType("CheckoutsModel", Union[int, float])


SucceededCheckoutsTypedDict = TypeAliasType(
    "SucceededCheckoutsTypedDict", Union[int, float]
)


SucceededCheckouts = TypeAliasType("SucceededCheckouts", Union[int, float])


CheckoutsConversionTypedDict = TypeAliasType(
    "CheckoutsConversionTypedDict", Union[int, float]
)


CheckoutsConversion = TypeAliasType("CheckoutsConversion", Union[int, float])


CanceledSubscriptionsTypedDict = TypeAliasType(
    "CanceledSubscriptionsTypedDict", Union[int, float]
)


CanceledSubscriptions = TypeAliasType("CanceledSubscriptions", Union[int, float])


CanceledSubscriptionsCustomerServiceTypedDict = TypeAliasType(
    "CanceledSubscriptionsCustomerServiceTypedDict", Union[int, float]
)


CanceledSubscriptionsCustomerService = TypeAliasType(
    "CanceledSubscriptionsCustomerService", Union[int, float]
)


CanceledSubscriptionsLowQualityTypedDict = TypeAliasType(
    "CanceledSubscriptionsLowQualityTypedDict", Union[int, float]
)


CanceledSubscriptionsLowQuality = TypeAliasType(
    "CanceledSubscriptionsLowQuality", Union[int, float]
)


CanceledSubscriptionsMissingFeaturesTypedDict = TypeAliasType(
    "CanceledSubscriptionsMissingFeaturesTypedDict", Union[int, float]
)


CanceledSubscriptionsMissingFeatures = TypeAliasType(
    "CanceledSubscriptionsMissingFeatures", Union[int, float]
)


CanceledSubscriptionsSwitchedServiceTypedDict = TypeAliasType(
    "CanceledSubscriptionsSwitchedServiceTypedDict", Union[int, float]
)


CanceledSubscriptionsSwitchedService = TypeAliasType(
    "CanceledSubscriptionsSwitchedService", Union[int, float]
)


CanceledSubscriptionsTooComplexTypedDict = TypeAliasType(
    "CanceledSubscriptionsTooComplexTypedDict", Union[int, float]
)


CanceledSubscriptionsTooComplex = TypeAliasType(
    "CanceledSubscriptionsTooComplex", Union[int, float]
)


CanceledSubscriptionsTooExpensiveTypedDict = TypeAliasType(
    "CanceledSubscriptionsTooExpensiveTypedDict", Union[int, float]
)


CanceledSubscriptionsTooExpensive = TypeAliasType(
    "CanceledSubscriptionsTooExpensive", Union[int, float]
)


CanceledSubscriptionsUnusedTypedDict = TypeAliasType(
    "CanceledSubscriptionsUnusedTypedDict", Union[int, float]
)


CanceledSubscriptionsUnused = TypeAliasType(
    "CanceledSubscriptionsUnused", Union[int, float]
)


CanceledSubscriptionsOtherTypedDict = TypeAliasType(
    "CanceledSubscriptionsOtherTypedDict", Union[int, float]
)


CanceledSubscriptionsOther = TypeAliasType(
    "CanceledSubscriptionsOther", Union[int, float]
)


class MetricPeriodTypedDict(TypedDict):
    timestamp: datetime
    r"""Timestamp of this period data."""
    orders: OrdersModelTypedDict
    revenue: RevenueTypedDict
    net_revenue: NetRevenueTypedDict
    cumulative_revenue: CumulativeRevenueTypedDict
    net_cumulative_revenue: NetCumulativeRevenueTypedDict
    average_order_value: AverageOrderValueTypedDict
    net_average_order_value: NetAverageOrderValueTypedDict
    one_time_products: OneTimeProductsTypedDict
    one_time_products_revenue: OneTimeProductsRevenueTypedDict
    one_time_products_net_revenue: OneTimeProductsNetRevenueTypedDict
    new_subscriptions: NewSubscriptionsTypedDict
    new_subscriptions_revenue: NewSubscriptionsRevenueTypedDict
    new_subscriptions_net_revenue: NewSubscriptionsNetRevenueTypedDict
    renewed_subscriptions: RenewedSubscriptionsTypedDict
    renewed_subscriptions_revenue: RenewedSubscriptionsRevenueTypedDict
    renewed_subscriptions_net_revenue: RenewedSubscriptionsNetRevenueTypedDict
    active_subscriptions: ActiveSubscriptionsTypedDict
    monthly_recurring_revenue: MonthlyRecurringRevenueTypedDict
    committed_monthly_recurring_revenue: CommittedMonthlyRecurringRevenueTypedDict
    checkouts: CheckoutsModelTypedDict
    succeeded_checkouts: SucceededCheckoutsTypedDict
    checkouts_conversion: CheckoutsConversionTypedDict
    canceled_subscriptions: CanceledSubscriptionsTypedDict
    canceled_subscriptions_customer_service: (
        CanceledSubscriptionsCustomerServiceTypedDict
    )
    canceled_subscriptions_low_quality: CanceledSubscriptionsLowQualityTypedDict
    canceled_subscriptions_missing_features: (
        CanceledSubscriptionsMissingFeaturesTypedDict
    )
    canceled_subscriptions_switched_service: (
        CanceledSubscriptionsSwitchedServiceTypedDict
    )
    canceled_subscriptions_too_complex: CanceledSubscriptionsTooComplexTypedDict
    canceled_subscriptions_too_expensive: CanceledSubscriptionsTooExpensiveTypedDict
    canceled_subscriptions_unused: CanceledSubscriptionsUnusedTypedDict
    canceled_subscriptions_other: CanceledSubscriptionsOtherTypedDict


class MetricPeriod(BaseModel):
    timestamp: datetime
    r"""Timestamp of this period data."""

    orders: OrdersModel

    revenue: Revenue

    net_revenue: NetRevenue

    cumulative_revenue: CumulativeRevenue

    net_cumulative_revenue: NetCumulativeRevenue

    average_order_value: AverageOrderValue

    net_average_order_value: NetAverageOrderValue

    one_time_products: OneTimeProducts

    one_time_products_revenue: OneTimeProductsRevenue

    one_time_products_net_revenue: OneTimeProductsNetRevenue

    new_subscriptions: NewSubscriptions

    new_subscriptions_revenue: NewSubscriptionsRevenue

    new_subscriptions_net_revenue: NewSubscriptionsNetRevenue

    renewed_subscriptions: RenewedSubscriptions

    renewed_subscriptions_revenue: RenewedSubscriptionsRevenue

    renewed_subscriptions_net_revenue: RenewedSubscriptionsNetRevenue

    active_subscriptions: ActiveSubscriptions

    monthly_recurring_revenue: MonthlyRecurringRevenue

    committed_monthly_recurring_revenue: CommittedMonthlyRecurringRevenue

    checkouts: CheckoutsModel

    succeeded_checkouts: SucceededCheckouts

    checkouts_conversion: CheckoutsConversion

    canceled_subscriptions: CanceledSubscriptions

    canceled_subscriptions_customer_service: CanceledSubscriptionsCustomerService

    canceled_subscriptions_low_quality: CanceledSubscriptionsLowQuality

    canceled_subscriptions_missing_features: CanceledSubscriptionsMissingFeatures

    canceled_subscriptions_switched_service: CanceledSubscriptionsSwitchedService

    canceled_subscriptions_too_complex: CanceledSubscriptionsTooComplex

    canceled_subscriptions_too_expensive: CanceledSubscriptionsTooExpensive

    canceled_subscriptions_unused: CanceledSubscriptionsUnused

    canceled_subscriptions_other: CanceledSubscriptionsOther
