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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .invoice_meta import InvoiceMeta
from .invoice_status import InvoiceStatus
from .line_item import LineItem
from .stripe_provider_meta import StripeProviderMeta


class Invoice(UncheckedBaseModel):
    id: str
    meta: InvoiceMeta
    status: InvoiceStatus
    description: str
    line_items: typing.List[LineItem]
    created_at: dt.datetime
    paid_at: typing.Optional[dt.datetime] = None
    updated_at: dt.datetime
    provider_meta: typing.Optional[StripeProviderMeta] = None

    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
