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

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from ...payment_method_types.types.currency_code import CurrencyCode
from ...core.pydantic_utilities import IS_PYDANTIC_V2


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

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

    name: str = pydantic.Field()
    """
    Name of the line item
    """

    unit_price: typing.Optional[float] = pydantic.Field(alias="unitPrice", default=None)
    """
    Unit price of the line item
    """

    currency: typing.Optional[CurrencyCode] = pydantic.Field(default=None)
    """
    ISO 4217 currency code
    """

    quantity: typing.Optional[float] = pydantic.Field(default=None)
    """
    Quantity of the line item
    """

    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
