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

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .checkout_action import CheckoutAction
from .subscription_resource import SubscriptionResource


class Result_RequiresAction(UniversalBaseModel):
    type: typing.Literal["requires_action"] = "requires_action"
    action: CheckoutAction

    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 Result_Success(UniversalBaseModel):
    type: typing.Literal["success"] = "success"
    subscription: SubscriptionResource

    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


Result = typing.Union[Result_RequiresAction, Result_Success]
