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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata


class PaymentMethodResponseData(UniversalBaseModel):
    account_last_4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="account_last4")] = None
    account_name: typing.Optional[str] = None
    bank_name: typing.Optional[str] = None
    billing_email: typing.Optional[str] = None
    billing_name: typing.Optional[str] = None
    card_brand: typing.Optional[str] = None
    card_exp_month: typing.Optional[int] = None
    card_exp_year: typing.Optional[int] = None
    card_last_4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="card_last4")] = None
    company_id: typing.Optional[str] = None
    created_at: dt.datetime
    customer_external_id: str
    environment_id: str
    external_id: str
    id: str
    payment_method_type: str
    updated_at: dt.datetime

    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
