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

from __future__ import annotations
from ...core.pydantic_utilities import UniversalBaseModel
import typing
from ...invoice_types.types.bank_delivery_method import BankDeliveryMethod
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...invoice_types.types.check_delivery_method import CheckDeliveryMethod


class PaymentRailResponse_BankAccount(UniversalBaseModel):
    type: typing.Literal["bankAccount"] = "bankAccount"
    available_delivery_methods: typing.List[BankDeliveryMethod] = pydantic.Field(alias="availableDeliveryMethods")
    default_delivery_method: BankDeliveryMethod = pydantic.Field(alias="defaultDeliveryMethod")
    name: str
    active: bool

    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


class PaymentRailResponse_Card(UniversalBaseModel):
    type: typing.Literal["card"] = "card"
    name: str
    active: bool

    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


class PaymentRailResponse_VirtualCard(UniversalBaseModel):
    type: typing.Literal["virtualCard"] = "virtualCard"
    name: str
    active: bool

    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


class PaymentRailResponse_Check(UniversalBaseModel):
    type: typing.Literal["check"] = "check"
    available_delivery_methods: typing.List[CheckDeliveryMethod] = pydantic.Field(alias="availableDeliveryMethods")
    default_delivery_method: CheckDeliveryMethod = pydantic.Field(alias="defaultDeliveryMethod")
    print_description: bool = pydantic.Field(alias="printDescription")
    name: str
    active: bool

    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


class PaymentRailResponse_Custom(UniversalBaseModel):
    type: typing.Literal["custom"] = "custom"
    schema_id: str = pydantic.Field(alias="schemaId")
    name: str
    active: bool

    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


class PaymentRailResponse_Bnpl(UniversalBaseModel):
    type: typing.Literal["bnpl"] = "bnpl"
    name: str
    active: bool

    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


class PaymentRailResponse_OffPlatform(UniversalBaseModel):
    type: typing.Literal["offPlatform"] = "offPlatform"
    name: str
    active: bool

    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


class PaymentRailResponse_Utility(UniversalBaseModel):
    type: typing.Literal["utility"] = "utility"
    name: str
    active: bool

    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


class PaymentRailResponse_Na(UniversalBaseModel):
    type: typing.Literal["na"] = "na"
    name: str
    active: bool

    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


PaymentRailResponse = typing.Union[
    PaymentRailResponse_BankAccount,
    PaymentRailResponse_Card,
    PaymentRailResponse_VirtualCard,
    PaymentRailResponse_Check,
    PaymentRailResponse_Custom,
    PaymentRailResponse_Bnpl,
    PaymentRailResponse_OffPlatform,
    PaymentRailResponse_Utility,
    PaymentRailResponse_Na,
]
