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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .invoice_custom_field_placement import InvoiceCustomFieldPlacement
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class InvoiceCustomField(UncheckedBaseModel):
    """
    An additional seller-defined and customer-facing field to include on the invoice. For more information,
    see [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).

    Adding custom fields to an invoice requires an
    [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).
    """

    label: typing.Optional[str] = pydantic.Field(default=None)
    """
    The label or title of the custom field. This field is required for a custom field.
    """

    value: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text of the custom field. If omitted, only the label is rendered.
    """

    placement: typing.Optional[InvoiceCustomFieldPlacement] = pydantic.Field(default=None)
    """
    The location of the custom field on the invoice. This field is required for a custom field.
    See [InvoiceCustomFieldPlacement](#type-invoicecustomfieldplacement) for possible values
    """

    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
