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

from __future__ import annotations

import typing

from .bank_account_response import BankAccountResponse
from .card_response import CardResponse
from .check_response import CheckResponse
from .custom_payment_method_response import CustomPaymentMethodResponse
from .payment_method_base_response import PaymentMethodBaseResponse


class PaymentMethodResponse_BankAccount(BankAccountResponse):
    type: typing.Literal["bankAccount"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class PaymentMethodResponse_Card(CardResponse):
    type: typing.Literal["card"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class PaymentMethodResponse_Check(CheckResponse):
    type: typing.Literal["check"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class PaymentMethodResponse_Custom(CustomPaymentMethodResponse):
    type: typing.Literal["custom"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class PaymentMethodResponse_OffPlatform(PaymentMethodBaseResponse):
    type: typing.Literal["offPlatform"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


"""
import datetime

from mercoa import (
    BankStatus,
    BankType,
    CurrencyCode,
    PaymentMethodResponse_BankAccount,
)

PaymentMethodResponse_BankAccount(
    type="bankAccount",
    id="pm_12345",
    account_name="My Checking Account",
    bank_name="Chase",
    routing_number="12345678",
    account_number="99988767623",
    account_type=BankType.CHECKING,
    status=BankStatus.VERIFIED,
    is_default_source=True,
    is_default_destination=True,
    supported_currencies=[CurrencyCode.USD],
    created_at=datetime.datetime.fromisoformat(
        "2021-01-01 00:00:00+00:00",
    ),
    updated_at=datetime.datetime.fromisoformat(
        "2021-01-01 00:00:00+00:00",
    ),
)
"""
PaymentMethodResponse = typing.Union[
    PaymentMethodResponse_BankAccount,
    PaymentMethodResponse_Card,
    PaymentMethodResponse_Check,
    PaymentMethodResponse_Custom,
    PaymentMethodResponse_OffPlatform,
]
