"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .customerpaymentmethodcreaterequiresactionresponse import (
    CustomerPaymentMethodCreateRequiresActionResponse,
    CustomerPaymentMethodCreateRequiresActionResponseTypedDict,
)
from .customerpaymentmethodcreatesucceededresponse import (
    CustomerPaymentMethodCreateSucceededResponse,
    CustomerPaymentMethodCreateSucceededResponseTypedDict,
)
from polar_sdk.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


CustomerPaymentMethodCreateResponseTypedDict = TypeAliasType(
    "CustomerPaymentMethodCreateResponseTypedDict",
    Union[
        CustomerPaymentMethodCreateSucceededResponseTypedDict,
        CustomerPaymentMethodCreateRequiresActionResponseTypedDict,
    ],
)


CustomerPaymentMethodCreateResponse = Annotated[
    Union[
        Annotated[
            CustomerPaymentMethodCreateRequiresActionResponse, Tag("requires_action")
        ],
        Annotated[CustomerPaymentMethodCreateSucceededResponse, Tag("succeeded")],
    ],
    Discriminator(lambda m: get_discriminator(m, "status", "status")),
]
