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

from __future__ import annotations
from .paymentmethodcarddata import PaymentMethodCardData, PaymentMethodCardDataTypedDict
from datetime import datetime
from polar_sdk.types import BaseModel
from polar_sdk.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal
from typing_extensions import Annotated, TypedDict


class PaymentMethodCardTypedDict(TypedDict):
    id: str
    created_at: datetime
    default: bool
    card: PaymentMethodCardDataTypedDict
    type: Literal["card"]


class PaymentMethodCard(BaseModel):
    id: str

    created_at: datetime

    default: bool

    card: PaymentMethodCardData

    TYPE: Annotated[
        Annotated[Literal["card"], AfterValidator(validate_const("card"))],
        pydantic.Field(alias="type"),
    ] = "card"
