# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from ....._models import BaseModel

__all__ = ["PaymentMethod"]


class PaymentMethod(BaseModel):
    api_type: Literal["CreditCard", "ApplePay", "GooglePay"] = FieldInfo(alias="_type")
    """
    This is base class of for all payment methods. Client should use this field to
    know what object it is.
    """

    id: Optional[int] = None
    """PaymentMethod id"""

    is_default: Optional[bool] = FieldInfo(alias="isDefault", default=None)
    """Whether this is the default payment method for the owner.

    Default payment method should be always one. Client should set default payment
    method for each new hold.

    Currently, it will be last used or added payment method.
    """

    is_expired: Optional[bool] = FieldInfo(alias="isExpired", default=None)
    """Whether the credit card is currently expired or not (based on Year-Month)."""
