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

from __future__ import annotations
import dataclasses
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from sdk import utils
from typing import Optional

class AppliedCouponInputAppliedCouponFrequencyEnum(str, Enum):
    r"""Frequency type"""
    ONCE = 'once'
    RECURRING = 'recurring'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class AppliedCouponInputAppliedCoupon:
    
    coupon_code: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('coupon_code') }})  
    external_customer_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('external_customer_id') }})  
    amount_cents: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount_cents'), 'exclude': lambda f: f is None }})  
    amount_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount_currency'), 'exclude': lambda f: f is None }})  
    frequency: Optional[AppliedCouponInputAppliedCouponFrequencyEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('frequency'), 'exclude': lambda f: f is None }})
    r"""Frequency type"""  
    frequency_duration: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('frequency_duration'), 'exclude': lambda f: f is None }})  
    percentage_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('percentage_rate'), 'exclude': lambda f: f is None }})  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class AppliedCouponInput:
    r"""Apply coupon payload"""
    
    applied_coupon: AppliedCouponInputAppliedCoupon = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('applied_coupon') }})  
    