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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .destination_details_card_refund_details import DestinationDetailsCardRefundDetails
import pydantic
from .destination_details_cash_refund_details import DestinationDetailsCashRefundDetails
from .destination_details_external_refund_details import DestinationDetailsExternalRefundDetails
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class DestinationDetails(UncheckedBaseModel):
    """
    Details about a refund's destination.
    """

    card_details: typing.Optional[DestinationDetailsCardRefundDetails] = pydantic.Field(default=None)
    """
    Details about a card refund. Only populated if the destination_type is `CARD`.
    """

    cash_details: typing.Optional[DestinationDetailsCashRefundDetails] = pydantic.Field(default=None)
    """
    Details about a cash refund. Only populated if the destination_type is `CASH`.
    """

    external_details: typing.Optional[DestinationDetailsExternalRefundDetails] = pydantic.Field(default=None)
    """
    Details about an external refund. Only populated if the destination_type is `EXTERNAL`.
    """

    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
