# 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_payment_intent_status import InvoiceResponsePaymentIntentStatus
from .invoice_response_payment_intent_statusses_item import InvoiceResponsePaymentIntentStatussesItem


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[InvoiceResponsePaymentIntentStatus] = 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[InvoiceResponsePaymentIntentStatussesItem] = 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
