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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .post_invoices_root_response_items import PostInvoicesRootResponseItems


class PostInvoicesRootResponse(UniversalBaseModel):
    version: typing.Optional[str] = pydantic.Field(default=None)
    """
    The API version of the response.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the created invoice.
    """

    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    The status of the created invoice (e.g., 'incomplete', 'processing').
    """

    conflicting_invoice_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of a conflicting invoice, if one was detected.
    """

    items: typing.Optional[PostInvoicesRootResponseItems] = pydantic.Field(default=None)
    """
    The status of the line item ingestion process.
    """

    errors: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    A list of validation errors or warnings related to the invoice creation.
    """

    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
