"""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


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CreditNoteInputCreditNoteItems:
    
    amount_cents: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount_cents') }})  
    fee_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fee_id') }})  
    
class CreditNoteInputCreditNoteReasonEnum(str, Enum):
    r"""Reason"""
    DUPLICATED_CHARGE = 'duplicated_charge'
    PRODUCT_UNSATISFACTORY = 'product_unsatisfactory'
    ORDER_CHANGE = 'order_change'
    ORDER_CANCELLATION = 'order_cancellation'
    FRAUDULENT_CHARGE = 'fraudulent_charge'
    OTHER = 'other'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CreditNoteInputCreditNote:
    
    credit_amount_cents: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('credit_amount_cents') }})  
    invoice_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('invoice_id') }})  
    items: list[CreditNoteInputCreditNoteItems] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('items') }})  
    reason: CreditNoteInputCreditNoteReasonEnum = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reason') }})
    r"""Reason"""  
    refund_amount_cents: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('refund_amount_cents') }})  
    description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }})  
    

@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CreditNoteInput:
    r"""Credit note payload"""
    
    credit_note: CreditNoteInputCreditNote = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('credit_note') }})  
    