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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response import (
    BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse,
)
import pydantic
from .error import Error
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class BulkUpsertMerchantCustomAttributesResponse(UncheckedBaseModel):
    """
    Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response,
    which contains a map of responses that each corresponds to an individual upsert request.
    """

    values: typing.Optional[
        typing.Dict[str, BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse]
    ] = pydantic.Field(default=None)
    """
    A map of responses that correspond to individual upsert requests. Each response has the
    same ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or an `errors` field.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    Any errors that occurred during the request.
    """

    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
