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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .apple_pay_data import ApplePayData
from .cascade_job_details import CascadeJobDetails
from .created_at import CreatedAt
from .domain_name import DomainName
from .entity_id import EntityId
from .entity_type import EntityType
from .google_pay_data import GooglePayData
from .last_modified import LastModified
from .owner_entity_id import OwnerEntityId
from .owner_entity_type import OwnerEntityType
from .payment_method_domain_id import PaymentMethodDomainId


class PaymentMethodDomainApiResponse(UniversalBaseModel):
    """
    Data related to the payment method domain.
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    The record type. For payment method domains, this is always `PaymentMethodDomain`.
    """

    apple_pay: typing_extensions.Annotated[ApplePayData, FieldMetadata(alias="applePay")]
    google_pay: typing_extensions.Annotated[GooglePayData, FieldMetadata(alias="googlePay")]
    cascades: typing.Optional[typing.List[CascadeJobDetails]] = pydantic.Field(default=None)
    """
    Data about the domain's cascade status.
    """

    created_at: typing_extensions.Annotated[CreatedAt, FieldMetadata(alias="createdAt")]
    domain_name: typing_extensions.Annotated[DomainName, FieldMetadata(alias="domainName")]
    entity_id: typing_extensions.Annotated[EntityId, FieldMetadata(alias="entityId")]
    entity_type: typing_extensions.Annotated[EntityType, FieldMetadata(alias="entityType")]
    id: PaymentMethodDomainId
    owner_entity_id: typing_extensions.Annotated[OwnerEntityId, FieldMetadata(alias="ownerEntityId")]
    owner_entity_type: typing_extensions.Annotated[OwnerEntityType, FieldMetadata(alias="ownerEntityType")]
    updated_at: typing_extensions.Annotated[LastModified, FieldMetadata(alias="updatedAt")]

    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
