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

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


class BulkInvoiceCreationFromObjectResponse(UniversalBaseModel):
    """
    Examples
    --------
    from mercoa.invoice_types import BulkInvoiceCreationFromObjectResponse

    BulkInvoiceCreationFromObjectResponse(
        id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
        foreign_id="YOUR-INVOICE-ID",
    )
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the invoice that was created. If the invoice was not created, this will be undefined
    """

    foreign_id: typing.Optional[str] = pydantic.Field(alias="foreignId", default=None)
    """
    If provided, this is the foreign ID of the invoice that was created.
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    The error message if the invoice was not created
    """

    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
