"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.bank import (
    Bank,
)
from visaacceptancemergedspec.models.card import (
    Card,
)
from visaacceptancemergedspec.models.customer import (
    Customer,
)
from visaacceptancemergedspec.models.direct_debit import (
    DirectDebit,
)
from visaacceptancemergedspec.models.e_wallet import (
    EWallet,
)
from visaacceptancemergedspec.models.fluid_data import (
    FluidData,
)
from visaacceptancemergedspec.models.instrument_identifier import (
    InstrumentIdentifier,
)
from visaacceptancemergedspec.models.legacy_token import (
    LegacyToken,
)
from visaacceptancemergedspec.models.options import (
    Options,
)
from visaacceptancemergedspec.models.payment_account_reference import (
    PaymentAccountReference,
)
from visaacceptancemergedspec.models.payment_instrument import (
    PaymentInstrument,
)
from visaacceptancemergedspec.models.payment_type import (
    PaymentType,
)
from visaacceptancemergedspec.models.sepa import (
    Sepa,
)
from visaacceptancemergedspec.models.shipping_address import (
    ShippingAddress,
)
from visaacceptancemergedspec.models.tokenized_card import (
    TokenizedCard,
)
from visaacceptancemergedspec.models.tokenized_payment_method import (
    TokenizedPaymentMethod,
)


class PaymentInformation(object):
    """Implementation of the 'PaymentInformation' model.

    Attributes:
        card (Card): The model property of type Card.
        tokenized_card (TokenizedCard): The model property of type TokenizedCard.
        tokenized_payment_method (TokenizedPaymentMethod): The model property of type
            TokenizedPaymentMethod.
        direct_debit (DirectDebit): The model property of type DirectDebit.
        fluid_data (FluidData): The model property of type FluidData.
        customer (Customer): The model property of type Customer.
        payment_instrument (PaymentInstrument): The model property of type
            PaymentInstrument.
        instrument_identifier (InstrumentIdentifier): The model property of type
            InstrumentIdentifier.
        shipping_address (ShippingAddress): The model property of type
            ShippingAddress.
        legacy_token (LegacyToken): The model property of type LegacyToken.
        bank (Bank): The model property of type Bank.
        options (Options): The model property of type Options.
        payment_type (PaymentType): The model property of type PaymentType.
        initiation_channel (str): Mastercard-defined code that indicates how the
            account information was obtained.  - `00`: Card - `01`: Mobile Network
            Operator (MNO) controlled removable secure element (SIM or UICC)
            personalized for use with a mobile phone or smartphone - `02`: Key fob -
            `03`: Watch using a contactless chip or a fixed (non-removable) secure
            element not controlled by the MNO - `04`: Mobile tag - `05`: Wristband -
            `06`: Mobile phone case or sleeve - `07`: Mobile phone or smartphone with
            a fixed (non-removable) secure element controlled by the MNO,for example,
            code division multiple access (CDMA) - `08`: Removable secure element not
            controlled by the MNO, for example, memory card personalized forused with
            a mobile phone or smartphone - `09`: Mobile Phone or smartphone with a
            fixed (non-removable) secure element not controlled by the MNO - `10`:
            MNO controlled removable secure element (SIM or UICC) personalized for
            use with a tablet or e-book - `11`: Tablet or e-book with a fixed
            (non-removable) secure element controlled by the MNO - `12`: Removable
            secure element not controlled by the MNO, for example, memory card
            personalized foruse with a tablet or e-book - `13`: Tablet or e-book with
            fixed (non-removable) secure element not controlled by the MNO - `14`:
            Mobile phone or smartphone with a payment application running in a host
            processor - `15`: Tablet or e-book with a payment application running in
            a host processor - `16`: Mobile phone or smartphone with a payment
            application running in the Trusted ExecutionEnvironment (TEE) of a host
            processor - `17`: Tablet or e-book with a payment application running in
            the TEE of a host processor - `18`: Watch with a payment application
            running in the TEE of a host processor - `19`: Watch with a payment
            application running in a host processor  Values from 20–99 exclusively
            indicate the form factor only without also indicating the storage
            technology  - `20`: Card - `21`: Phone e.g. Mobile Phone - `22`:
            Tablet/e-reader - `23`: Watch/Wristband e.g. Watch or wristband,
            including a fitness band, smart strap, disposable band, watch add-on, and
            security/ID band - `24`: Sticker - `25`: PC - `26`: Device Peripheral
            e.g. mobile phone case or sleeve - `27`: Tag e.g. key fob or mobile tag -
            `28`: Jewelry e.g. ring, bracelet, necklace and cuff links - `29`:
            Fashion Accessory e.g. handbag, bag charm and glasses - `30`: Garment
            e.g. dress - `31`: Domestic Appliance e.g refrigerator, washing machine -
            `32`: Vehicle e.g. vehicle, including vehicle attached devices - `33`:
            Media/Gaming Device e.g. media or gaming device, including a set top box,
            media player and television  34–99 are reserved for future form factors.
            Any value in this range may occur within form factor and transaction data
            without prior notice.  This field is supported only for Mastercard on
            Visa Acceptance through VisaNet. When initiation channel is not provided
            via this API field, the value is extracted from EMV tag 9F6E for
            Mastercard transactions. To enable this feature please call support.
            #### Used by **Authorization** Optional field.
        sepa (Sepa): The model property of type Sepa.
        e_wallet (EWallet): The model property of type EWallet.
        payment_account_reference (PaymentAccountReference): The model property of
            type PaymentAccountReference.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "card": "card",
        "tokenized_card": "tokenizedCard",
        "tokenized_payment_method": "tokenizedPaymentMethod",
        "direct_debit": "directDebit",
        "fluid_data": "fluidData",
        "customer": "customer",
        "payment_instrument": "paymentInstrument",
        "instrument_identifier": "instrumentIdentifier",
        "shipping_address": "shippingAddress",
        "legacy_token": "legacyToken",
        "bank": "bank",
        "options": "options",
        "payment_type": "paymentType",
        "initiation_channel": "initiationChannel",
        "sepa": "sepa",
        "e_wallet": "eWallet",
        "payment_account_reference": "paymentAccountReference",
    }

    _optionals = [
        "card",
        "tokenized_card",
        "tokenized_payment_method",
        "direct_debit",
        "fluid_data",
        "customer",
        "payment_instrument",
        "instrument_identifier",
        "shipping_address",
        "legacy_token",
        "bank",
        "options",
        "payment_type",
        "initiation_channel",
        "sepa",
        "e_wallet",
        "payment_account_reference",
    ]

    def __init__(
        self,
        card=APIHelper.SKIP,
        tokenized_card=APIHelper.SKIP,
        tokenized_payment_method=APIHelper.SKIP,
        direct_debit=APIHelper.SKIP,
        fluid_data=APIHelper.SKIP,
        customer=APIHelper.SKIP,
        payment_instrument=APIHelper.SKIP,
        instrument_identifier=APIHelper.SKIP,
        shipping_address=APIHelper.SKIP,
        legacy_token=APIHelper.SKIP,
        bank=APIHelper.SKIP,
        options=APIHelper.SKIP,
        payment_type=APIHelper.SKIP,
        initiation_channel=APIHelper.SKIP,
        sepa=APIHelper.SKIP,
        e_wallet=APIHelper.SKIP,
        payment_account_reference=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PaymentInformation instance."""
        # Initialize members of the class
        if card is not APIHelper.SKIP:
            self.card = card
        if tokenized_card is not APIHelper.SKIP:
            self.tokenized_card = tokenized_card
        if tokenized_payment_method is not APIHelper.SKIP:
            self.tokenized_payment_method = tokenized_payment_method
        if direct_debit is not APIHelper.SKIP:
            self.direct_debit = direct_debit
        if fluid_data is not APIHelper.SKIP:
            self.fluid_data = fluid_data
        if customer is not APIHelper.SKIP:
            self.customer = customer
        if payment_instrument is not APIHelper.SKIP:
            self.payment_instrument = payment_instrument
        if instrument_identifier is not APIHelper.SKIP:
            self.instrument_identifier = instrument_identifier
        if shipping_address is not APIHelper.SKIP:
            self.shipping_address = shipping_address
        if legacy_token is not APIHelper.SKIP:
            self.legacy_token = legacy_token
        if bank is not APIHelper.SKIP:
            self.bank = bank
        if options is not APIHelper.SKIP:
            self.options = options
        if payment_type is not APIHelper.SKIP:
            self.payment_type = payment_type
        if initiation_channel is not APIHelper.SKIP:
            self.initiation_channel = initiation_channel
        if sepa is not APIHelper.SKIP:
            self.sepa = sepa
        if e_wallet is not APIHelper.SKIP:
            self.e_wallet = e_wallet
        if payment_account_reference is not APIHelper.SKIP:
            self.payment_account_reference = payment_account_reference

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        card =\
            Card.from_dictionary(
                dictionary.get("card"))\
                if "card" in dictionary.keys()\
                else APIHelper.SKIP
        tokenized_card =\
            TokenizedCard.from_dictionary(
                dictionary.get("tokenizedCard"))\
                if "tokenizedCard" in dictionary.keys()\
                else APIHelper.SKIP
        tokenized_payment_method =\
            TokenizedPaymentMethod.from_dictionary(
                dictionary.get("tokenizedPaymentMethod"))\
                if "tokenizedPaymentMethod" in dictionary.keys()\
                else APIHelper.SKIP
        direct_debit =\
            DirectDebit.from_dictionary(
                dictionary.get("directDebit"))\
                if "directDebit" in dictionary.keys()\
                else APIHelper.SKIP
        fluid_data =\
            FluidData.from_dictionary(
                dictionary.get("fluidData"))\
                if "fluidData" in dictionary.keys()\
                else APIHelper.SKIP
        customer =\
            Customer.from_dictionary(
                dictionary.get("customer"))\
                if "customer" in dictionary.keys()\
                else APIHelper.SKIP
        payment_instrument =\
            PaymentInstrument.from_dictionary(
                dictionary.get("paymentInstrument"))\
                if "paymentInstrument" in dictionary.keys()\
                else APIHelper.SKIP
        instrument_identifier =\
            InstrumentIdentifier.from_dictionary(
                dictionary.get("instrumentIdentifier"))\
                if "instrumentIdentifier" in dictionary.keys()\
                else APIHelper.SKIP
        shipping_address =\
            ShippingAddress.from_dictionary(
                dictionary.get("shippingAddress"))\
                if "shippingAddress" in dictionary.keys()\
                else APIHelper.SKIP
        legacy_token =\
            LegacyToken.from_dictionary(
                dictionary.get("legacyToken"))\
                if "legacyToken" in dictionary.keys()\
                else APIHelper.SKIP
        bank =\
            Bank.from_dictionary(
                dictionary.get("bank"))\
                if "bank" in dictionary.keys()\
                else APIHelper.SKIP
        options =\
            Options.from_dictionary(
                dictionary.get("options"))\
                if "options" in dictionary.keys()\
                else APIHelper.SKIP
        payment_type =\
            PaymentType.from_dictionary(
                dictionary.get("paymentType"))\
                if "paymentType" in dictionary.keys()\
                else APIHelper.SKIP
        initiation_channel =\
            dictionary.get("initiationChannel")\
            if dictionary.get("initiationChannel")\
                else APIHelper.SKIP
        sepa =\
            Sepa.from_dictionary(
                dictionary.get("sepa"))\
                if "sepa" in dictionary.keys()\
                else APIHelper.SKIP
        e_wallet =\
            EWallet.from_dictionary(
                dictionary.get("eWallet"))\
                if "eWallet" in dictionary.keys()\
                else APIHelper.SKIP
        payment_account_reference =\
            PaymentAccountReference.from_dictionary(
                dictionary.get("paymentAccountReference"))\
                if "paymentAccountReference" in dictionary.keys()\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(card,
                   tokenized_card,
                   tokenized_payment_method,
                   direct_debit,
                   fluid_data,
                   customer,
                   payment_instrument,
                   instrument_identifier,
                   shipping_address,
                   legacy_token,
                   bank,
                   options,
                   payment_type,
                   initiation_channel,
                   sepa,
                   e_wallet,
                   payment_account_reference,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _card=(
            self.card
            if hasattr(self, "card")
            else None
        )
        _tokenized_card=(
            self.tokenized_card
            if hasattr(self, "tokenized_card")
            else None
        )
        _tokenized_payment_method=(
            self.tokenized_payment_method
            if hasattr(self, "tokenized_payment_method")
            else None
        )
        _direct_debit=(
            self.direct_debit
            if hasattr(self, "direct_debit")
            else None
        )
        _fluid_data=(
            self.fluid_data
            if hasattr(self, "fluid_data")
            else None
        )
        _customer=(
            self.customer
            if hasattr(self, "customer")
            else None
        )
        _payment_instrument=(
            self.payment_instrument
            if hasattr(self, "payment_instrument")
            else None
        )
        _instrument_identifier=(
            self.instrument_identifier
            if hasattr(self, "instrument_identifier")
            else None
        )
        _shipping_address=(
            self.shipping_address
            if hasattr(self, "shipping_address")
            else None
        )
        _legacy_token=(
            self.legacy_token
            if hasattr(self, "legacy_token")
            else None
        )
        _bank=(
            self.bank
            if hasattr(self, "bank")
            else None
        )
        _options=(
            self.options
            if hasattr(self, "options")
            else None
        )
        _payment_type=(
            self.payment_type
            if hasattr(self, "payment_type")
            else None
        )
        _initiation_channel=(
            self.initiation_channel
            if hasattr(self, "initiation_channel")
            else None
        )
        _sepa=(
            self.sepa
            if hasattr(self, "sepa")
            else None
        )
        _e_wallet=(
            self.e_wallet
            if hasattr(self, "e_wallet")
            else None
        )
        _payment_account_reference=(
            self.payment_account_reference
            if hasattr(self, "payment_account_reference")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"card={_card!r}, "
            f"tokenized_card={_tokenized_card!r}, "
            f"tokenized_payment_method={_tokenized_payment_method!r}, "
            f"direct_debit={_direct_debit!r}, "
            f"fluid_data={_fluid_data!r}, "
            f"customer={_customer!r}, "
            f"payment_instrument={_payment_instrument!r}, "
            f"instrument_identifier={_instrument_identifier!r}, "
            f"shipping_address={_shipping_address!r}, "
            f"legacy_token={_legacy_token!r}, "
            f"bank={_bank!r}, "
            f"options={_options!r}, "
            f"payment_type={_payment_type!r}, "
            f"initiation_channel={_initiation_channel!r}, "
            f"sepa={_sepa!r}, "
            f"e_wallet={_e_wallet!r}, "
            f"payment_account_reference={_payment_account_reference!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _card=(
            self.card
            if hasattr(self, "card")
            else None
        )
        _tokenized_card=(
            self.tokenized_card
            if hasattr(self, "tokenized_card")
            else None
        )
        _tokenized_payment_method=(
            self.tokenized_payment_method
            if hasattr(self, "tokenized_payment_method")
            else None
        )
        _direct_debit=(
            self.direct_debit
            if hasattr(self, "direct_debit")
            else None
        )
        _fluid_data=(
            self.fluid_data
            if hasattr(self, "fluid_data")
            else None
        )
        _customer=(
            self.customer
            if hasattr(self, "customer")
            else None
        )
        _payment_instrument=(
            self.payment_instrument
            if hasattr(self, "payment_instrument")
            else None
        )
        _instrument_identifier=(
            self.instrument_identifier
            if hasattr(self, "instrument_identifier")
            else None
        )
        _shipping_address=(
            self.shipping_address
            if hasattr(self, "shipping_address")
            else None
        )
        _legacy_token=(
            self.legacy_token
            if hasattr(self, "legacy_token")
            else None
        )
        _bank=(
            self.bank
            if hasattr(self, "bank")
            else None
        )
        _options=(
            self.options
            if hasattr(self, "options")
            else None
        )
        _payment_type=(
            self.payment_type
            if hasattr(self, "payment_type")
            else None
        )
        _initiation_channel=(
            self.initiation_channel
            if hasattr(self, "initiation_channel")
            else None
        )
        _sepa=(
            self.sepa
            if hasattr(self, "sepa")
            else None
        )
        _e_wallet=(
            self.e_wallet
            if hasattr(self, "e_wallet")
            else None
        )
        _payment_account_reference=(
            self.payment_account_reference
            if hasattr(self, "payment_account_reference")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"card={_card!s}, "
            f"tokenized_card={_tokenized_card!s}, "
            f"tokenized_payment_method={_tokenized_payment_method!s}, "
            f"direct_debit={_direct_debit!s}, "
            f"fluid_data={_fluid_data!s}, "
            f"customer={_customer!s}, "
            f"payment_instrument={_payment_instrument!s}, "
            f"instrument_identifier={_instrument_identifier!s}, "
            f"shipping_address={_shipping_address!s}, "
            f"legacy_token={_legacy_token!s}, "
            f"bank={_bank!s}, "
            f"options={_options!s}, "
            f"payment_type={_payment_type!s}, "
            f"initiation_channel={_initiation_channel!s}, "
            f"sepa={_sepa!s}, "
            f"e_wallet={_e_wallet!s}, "
            f"payment_account_reference={_payment_account_reference!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
