# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .discount_response_model import DiscountResponseModel
from .invoice_response_model_payment_intent_status import InvoiceResponseModelPaymentIntentStatus
from .invoice_response_model_payment_intent_statusses_item import InvoiceResponseModelPaymentIntentStatussesItem


class InvoiceResponse(UncheckedBaseModel):
    amount_due_cents: int = pydantic.Field()
    """
    The amount due in cents.
    """

    subtotal_cents: typing.Optional[int] = pydantic.Field(default=None)
    """
    The subtotal amount in cents before tax (exclusive of tax and discounts).
    """

    tax_cents: typing.Optional[int] = pydantic.Field(default=None)
    """
    The tax amount in cents.
    """

    discount_percent_off: typing.Optional[float] = pydantic.Field(default=None)
    """
    Deprecated. Use [discounts] instead. The discount applied to the invoice. E.g. [20.0f] for 20% off.
    """

    discount_amount_off: typing.Optional[float] = pydantic.Field(default=None)
    """
    Deprecated. Use [discounts] instead. The discount applied to the invoice. E.g. [20.0f] for 20 cents off.
    """

    discounts: typing.List[DiscountResponseModel] = pydantic.Field()
    """
    The discounts applied to the invoice.
    """

    next_payment_attempt_unix: int = pydantic.Field()
    """
    The Unix timestamp of the next payment attempt. -1 when there is no next payment attempt.
    """

    payment_intent_status: typing.Optional[InvoiceResponseModelPaymentIntentStatus] = pydantic.Field(default=None)
    """
    Deprecated. Use [payment_intent_statusses] instead. The status of this invoice's first payment intent. None when there is no payment intent.
    """

    payment_intent_statusses: typing.List[InvoiceResponseModelPaymentIntentStatussesItem] = pydantic.Field()
    """
    The statuses of this invoice's payment intents. Empty list when there are no payment intents.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
