# 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 .bulk_create_entity_response_entities_item import BulkCreateEntityResponseEntitiesItem
from .bulk_create_entity_response_errors_item import BulkCreateEntityResponseErrorsItem


class BulkCreateEntityResponse(UniversalBaseModel):
    """
    An object that represents the response from a bulk entity creation operation. This response summarizes the outcome, including the number of entities successfully created and any errors encountered during the process.
    """

    success_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of entities that were successfully created.
    """

    failed_count: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of entities that failed to be created due to errors, such as missing assets.
    """

    entities: typing.Optional[typing.List[BulkCreateEntityResponseEntitiesItem]] = pydantic.Field(default=None)
    """
    An array of objects representing the entities that were successfully created. Each object includes the unique identifier, name, and current status.
    """

    errors: typing.Optional[typing.List[BulkCreateEntityResponseErrorsItem]] = pydantic.Field(default=None)
    """
    An array of error objects for entities that failed to be created. Each error object provides details about the failure, including the index of the entity in the original request, the entity's name, and the reason for the failure.
    """

    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
