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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .custom_attribute_event_data import CustomAttributeEventData
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CustomerCustomAttributeUpdatedEvent(UncheckedBaseModel):
    """
    Published when a customer [custom attribute](entity:CustomAttribute) owned by the
    subscribing application is created or updated. Custom attributes are owned by the application that created
    the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose
    `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.

    This event is replaced by
    [customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated).
    """

    merchant_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the seller associated with the event that triggered the event notification.
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    The type of this event. The value is `"customer.custom_attribute.updated"`.
    """

    event_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A unique ID for the event notification.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp that indicates when the event notification was created, in RFC 3339 format.
    """

    data: typing.Optional[CustomAttributeEventData] = pydantic.Field(default=None)
    """
    The data associated with the event that triggered the event notification.
    """

    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
