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

import typing

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


class CatalogBulkErrorItem(UniversalBaseModel):
    """
    Error details for a single item in bulk operation
    """

    index: int = pydantic.Field()
    """
    Index of the failed item in the request array
    """

    reference_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unique key of the failed item (if available)
    """

    catalog_unique_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    Catalog unique key of the failed item (if available)
    """

    error: str = pydantic.Field()
    """
    Error message
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error type (e.g., 'integrity_error', 'validation_error')
    """

    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
