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

from __future__ import annotations

import typing

import typing_extensions

from .bank_account_request import BankAccountRequest
from .card_request import CardRequest
from .check_request import CheckRequest
from .custom_payment_method_request import CustomPaymentMethodRequest
from .payment_method_base_request import PaymentMethodBaseRequest


class PaymentMethodRequest_BankAccount(BankAccountRequest):
    type: typing_extensions.Literal["bankAccount"]

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


class PaymentMethodRequest_Card(CardRequest):
    type: typing_extensions.Literal["card"]

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


class PaymentMethodRequest_Check(CheckRequest):
    type: typing_extensions.Literal["check"]

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


class PaymentMethodRequest_Custom(CustomPaymentMethodRequest):
    type: typing_extensions.Literal["custom"]

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


class PaymentMethodRequest_OffPlatform(PaymentMethodBaseRequest):
    type: typing_extensions.Literal["offPlatform"]

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


PaymentMethodRequest = typing.Union[
    PaymentMethodRequest_BankAccount,
    PaymentMethodRequest_Card,
    PaymentMethodRequest_Check,
    PaymentMethodRequest_Custom,
    PaymentMethodRequest_OffPlatform,
]
