# 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.accountexp import Accountexp
from ...types.accountid import Accountid
from ...types.accounttype import Accounttype
from ...types.bin_data import BinData
from ...types.holdername import Holdername
from ...types.initiator import Initiator
from ...types.maskedaccount import Maskedaccount
from ...types.orderdescription import Orderdescription
from ...types.sequence import Sequence
from ...types.signaturedata import Signaturedata
from ...types.stored_method_usage_type import StoredMethodUsageType
from ...types.storedmethodid import Storedmethodid
from .transaction_detail_payment_details import TransactionDetailPaymentDetails


class TransactionDetailPaymentData(UniversalBaseModel):
    """
    Payment method and transaction details
    """

    masked_account: typing_extensions.Annotated[
        Maskedaccount, FieldMetadata(alias="maskedAccount"), pydantic.Field(alias="maskedAccount")
    ]
    account_type: typing_extensions.Annotated[
        Accounttype, FieldMetadata(alias="accountType"), pydantic.Field(alias="accountType")
    ]
    account_exp: typing_extensions.Annotated[
        typing.Optional[Accountexp], FieldMetadata(alias="accountExp"), pydantic.Field(alias="accountExp")
    ] = None
    holder_name: typing_extensions.Annotated[
        Holdername, FieldMetadata(alias="holderName"), pydantic.Field(alias="holderName")
    ]
    stored_id: typing_extensions.Annotated[
        typing.Optional[Storedmethodid], FieldMetadata(alias="storedId"), pydantic.Field(alias="storedId")
    ] = None
    initiator: typing.Optional[Initiator] = None
    stored_method_usage_type: typing_extensions.Annotated[
        typing.Optional[StoredMethodUsageType],
        FieldMetadata(alias="storedMethodUsageType"),
        pydantic.Field(alias="storedMethodUsageType"),
    ] = None
    sequence: typing.Optional[Sequence] = None
    order_description: typing_extensions.Annotated[
        Orderdescription, FieldMetadata(alias="orderDescription"), pydantic.Field(alias="orderDescription")
    ]
    account_id: typing_extensions.Annotated[
        typing.Optional[Accountid], FieldMetadata(alias="accountId"), pydantic.Field(alias="accountId")
    ] = None
    signature_data: typing_extensions.Annotated[
        typing.Optional[Signaturedata], FieldMetadata(alias="signatureData"), pydantic.Field(alias="signatureData")
    ] = None
    bin_data: typing_extensions.Annotated[
        typing.Optional[BinData], FieldMetadata(alias="binData"), pydantic.Field(alias="binData")
    ] = None
    payment_details: typing_extensions.Annotated[
        TransactionDetailPaymentDetails, FieldMetadata(alias="paymentDetails"), pydantic.Field(alias="paymentDetails")
    ]

    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
