"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
import dateutil.parser
from ..shared import discount as shared_discount
from ..shared import overridebpsprice as shared_overridebpsprice
from ..shared import overridebulkbpsprice as shared_overridebulkbpsprice
from ..shared import overridebulkprice as shared_overridebulkprice
from ..shared import overridefivetranexampleprice as shared_overridefivetranexampleprice
from ..shared import overridematrixprice as shared_overridematrixprice
from ..shared import overridepackageprice as shared_overridepackageprice
from ..shared import overridepackagewithallocationprice as shared_overridepackagewithallocationprice
from ..shared import overridetestratingfunctionprice as shared_overridetestratingfunctionprice
from ..shared import overridethresholdtotalamountprice as shared_overridethresholdtotalamountprice
from ..shared import overridetieredbpsprice as shared_overridetieredbpsprice
from ..shared import overridetieredpackageprice as shared_overridetieredpackageprice
from ..shared import overridetieredprice as shared_overridetieredprice
from ..shared import overridetieredwithminimumprice as shared_overridetieredwithminimumprice
from ..shared import overrideunitprice as shared_overrideunitprice
from ..shared import phaseoverride as shared_phaseoverride
from dataclasses_json import Undefined, dataclass_json
from datetime import datetime
from enum import Enum
from orb import utils
from typing import Optional, Union



@dataclasses.dataclass
class NewSubscriptionCreditsOverageRate:
    pass

class NewSubscriptionExternalMarketplace(str, Enum):
    GOOGLE = 'google'
    AWS = 'aws'
    AZURE = 'azure'



@dataclasses.dataclass
class NewSubscriptionMetadata:
    pass



@dataclasses.dataclass
class NewSubscriptionPriceOverrides:
    pass


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class NewSubscription:
    align_billing_with_subscription_start_date: Optional[bool] = dataclasses.field(default=False, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('align_billing_with_subscription_start_date'), 'exclude': lambda f: f is None }})
    auto_collection: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('auto_collection') }})
    aws_region: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('aws_region') }})
    coupon_redemption_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('coupon_redemption_code') }})
    credits_overage_rate: Optional[Union[float, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('credits_overage_rate') }})
    customer_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customer_id') }})
    default_invoice_memo: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('default_invoice_memo') }})
    discount: Optional[shared_discount.Discount] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discount') }})
    r"""The subscription's override discount for the plan."""
    end_date: Optional[datetime] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('end_date'), 'encoder': utils.datetimeisoformat(True), 'decoder': dateutil.parser.isoparse }})
    external_customer_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_customer_id') }})
    external_marketplace: Optional[NewSubscriptionExternalMarketplace] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_marketplace') }})
    external_marketplace_reporting_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_marketplace_reporting_id') }})
    external_plan_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_plan_id') }})
    r"""The external_plan_id of the plan that the given subscription should be switched to. Note that either this property or `plan_id` must be specified."""
    initial_phase_order: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('initial_phase_order') }})
    invoicing_threshold: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('invoicing_threshold') }})
    maximum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('maximum_amount') }})
    r"""The subscription's override maximum amount for the plan."""
    metadata: Optional[NewSubscriptionMetadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata') }})
    minimum_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('minimum_amount') }})
    r"""The subscription's override minimum amount for the plan."""
    net_terms: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('net_terms') }})
    per_credit_overage_amount: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('per_credit_overage_amount') }})
    phase_overrides: Optional[list[shared_phaseoverride.PhaseOverride]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phase_overrides') }})
    plan_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('plan_id') }})
    r"""The plan that the given subscription should be switched to. Note that either this property or `external_plan_id` must be specified."""
    price_overrides: Optional[list[Union[shared_overrideunitprice.OverrideUnitPrice, shared_overridepackageprice.OverridePackagePrice, shared_overridematrixprice.OverrideMatrixPrice, shared_overridetieredprice.OverrideTieredPrice, shared_overridetieredbpsprice.OverrideTieredBpsPrice, shared_overridebpsprice.OverrideBpsPrice, shared_overridebulkbpsprice.OverrideBulkBpsPrice, shared_overridebulkprice.OverrideBulkPrice, shared_overridetestratingfunctionprice.OverrideTestRatingFunctionPrice, shared_overridefivetranexampleprice.OverrideFivetranExamplePrice, shared_overridethresholdtotalamountprice.OverrideThresholdTotalAmountPrice, shared_overridetieredpackageprice.OverrideTieredPackagePrice, shared_overridetieredwithminimumprice.OverrideTieredWithMinimumPrice, shared_overridepackagewithallocationprice.OverridePackageWithAllocationPrice]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('price_overrides') }})
    r"""Optionally provide a list of overrides for prices on the plan"""
    start_date: Optional[datetime] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('start_date'), 'encoder': utils.datetimeisoformat(True), 'decoder': dateutil.parser.isoparse }})
    

