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

from __future__ import annotations
import dataclasses
from ..shared import discount as shared_discount
from ..shared import sublineitem2 as shared_sublineitem2
from ..shared import taxamount as shared_taxamount
from billing import utils
from dataclasses_json import Undefined, dataclass_json
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class CreditNoteLineItem:
    amount: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }})
    r"""The amount of the line item, including any line item minimums and discounts"""
    discounts: list[shared_discount.Discount] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discounts') }})
    r"""Any line items discounts from the invoice's line item."""
    id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }})
    r"""The Orb id of this resource"""
    name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }})
    r"""The name of the corresponding invoice line item"""
    quantity: Optional[float] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity') }})
    r"""An optional quantity credited."""
    sub_line_items: list[shared_sublineitem2.SubLineItem2] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sub_line_items') }})
    r"""Any sub line items that may be credited."""
    subtotal: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subtotal') }})
    r"""The amount of the line item, excluding any line item minimums and discounts"""
    tax_amounts: list[shared_taxamount.TaxAmount] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tax_amounts') }})
    r"""Any tax amounts applied onto the line item."""
    

