# 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 VendorResponseStoredMethod(UniversalBaseModel):
    """
    Stored payment method information
    """

    id_pmethod: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="IdPmethod"), pydantic.Field(alias="IdPmethod")
    ] = None
    method: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="Method"), pydantic.Field(alias="Method")
    ] = None
    descriptor: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="Descriptor"), pydantic.Field(alias="Descriptor")
    ] = None
    masked_account: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="MaskedAccount"), pydantic.Field(alias="MaskedAccount")
    ] = None
    exp_date: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="ExpDate"), pydantic.Field(alias="ExpDate")
    ] = None
    holder_name: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="HolderName"), pydantic.Field(alias="HolderName")
    ] = None
    ach_sec_code: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="AchSecCode"), pydantic.Field(alias="AchSecCode")
    ] = None
    ach_holder_type: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="AchHolderType"), pydantic.Field(alias="AchHolderType")
    ] = None
    is_validated_ach: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="IsValidatedACH"), pydantic.Field(alias="IsValidatedACH")
    ] = None
    bin: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="BIN"), pydantic.Field(alias="BIN")] = (
        None
    )
    bin_data: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="binData"), pydantic.Field(alias="binData")
    ] = None
    aba: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ABA"), pydantic.Field(alias="ABA")] = (
        None
    )
    postal_code: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="PostalCode"), pydantic.Field(alias="PostalCode")
    ] = None
    method_type: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="MethodType"), pydantic.Field(alias="MethodType")
    ] = None
    last_updated: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="LastUpdated"), pydantic.Field(alias="LastUpdated")
    ] = None
    card_updated_on: typing_extensions.Annotated[
        typing.Optional[dt.datetime], FieldMetadata(alias="CardUpdatedOn"), pydantic.Field(alias="CardUpdatedOn")
    ] = 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
