# generated by datamodel-codegen:
#   filename:  discriminator_force_optional.yaml
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from typing import Annotated, Literal

from pydantic import Field
from pydantic.dataclasses import dataclass
from typing_extensions import TypeAliasType


@dataclass
class CardPayment:
    kind: Literal['card'] = 'card'
    card_number: int | None = None


@dataclass
class CashPayment:
    kind: Literal['cash'] = 'cash'
    received_amount: int | None = None


Payment = TypeAliasType(
    "Payment",
    Annotated[
        CardPayment | CashPayment | None, Field(None, discriminator='kind')
    ],
)
