# 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 .invoice_detail_object_items_processing_result_status import InvoiceDetailObjectItemsProcessingResultStatus


class InvoiceDetailObjectItemsProcessingResult(UniversalBaseModel):
    """
    Result of items processing (only present in PATCH response when items were included in request)
    """

    success: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Map of request array index to created/updated item ID
    """

    failure: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Map of request array index to error message
    """

    status: typing.Optional[InvoiceDetailObjectItemsProcessingResultStatus] = pydantic.Field(default=None)
    """
    Overall processing status: success (all items processed), partial_success (some failed), failure (all failed)
    """

    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
