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

from ...core.pydantic_utilities import UniversalBaseModel
import typing
from .contract_invoice_line_item_schema import ContractInvoiceLineItemSchema
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class ContractInvoiceSchema(UniversalBaseModel):
    """
    Examples
    --------
    from mercoa.contract_types import (
        ContractInvoiceLineItemSchema,
        ContractInvoiceSchema,
    )

    ContractInvoiceSchema(
        line_items=[
            ContractInvoiceLineItemSchema(
                name="Monthly Subscription Service Fee",
                unit_price=20.0,
                currency="USD",
                quantity=1.0,
            )
        ],
    )
    """

    line_items: typing.List[ContractInvoiceLineItemSchema] = pydantic.Field(alias="lineItems")
    """
    Line items in the invoice
    """

    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
