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

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from ...types.cardcvv import Cardcvv
from ...types.cardexp import Cardexp
from ...types.cardholder import Cardholder
from ...types.cardnumber import Cardnumber
from ...types.cardzip import Cardzip


class TokenizeCard(UniversalBaseModel):
    method: str = pydantic.Field()
    """
    The type of payment method to tokenize. For cards, this is always `card`.
    """

    cardcvv: typing.Optional[Cardcvv] = None
    cardexp: Cardexp
    card_holder: typing_extensions.Annotated[Cardholder, FieldMetadata(alias="cardHolder")]
    cardnumber: Cardnumber
    cardzip: typing.Optional[Cardzip] = None

    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
