"""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.account_features import (
    AccountFeatures,
)
from visaacceptancemergedspec.models.bank_1 import (
    Bank1,
)
from visaacceptancemergedspec.models.card_1 import (
    Card1,
)
from visaacceptancemergedspec.models.customer import (
    Customer,
)
from visaacceptancemergedspec.models.e_wallet_1 import (
    EWallet1,
)
from visaacceptancemergedspec.models.instrument_identifier_2 import (
    InstrumentIdentifier2,
)
from visaacceptancemergedspec.models.payment_instrument import (
    PaymentInstrument,
)
from visaacceptancemergedspec.models.shipping_address import (
    ShippingAddress,
)
from visaacceptancemergedspec.models.tokenized_card_1 import (
    TokenizedCard1,
)
from visaacceptancemergedspec.models.tokenized_payment_method_1 import (
    TokenizedPaymentMethod1,
)


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

    Attributes:
        card (Card1): The model property of type Card1.
        tokenized_card (TokenizedCard1): The model property of type TokenizedCard1.
        tokenized_payment_method (TokenizedPaymentMethod1): The model property of
            type TokenizedPaymentMethod1.
        account_features (AccountFeatures): The model property of type
            AccountFeatures.
        bank (Bank1): The model property of type Bank1.
        customer (Customer): The model property of type Customer.
        payment_instrument (PaymentInstrument): The model property of type
            PaymentInstrument.
        instrument_identifier (InstrumentIdentifier2): The model property of type
            InstrumentIdentifier2.
        shipping_address (ShippingAddress): The model property of type
            ShippingAddress.
        scheme (str): Subtype of card account. This field can contain one of the
            following values: - Maestro International - Maestro UK Domestic -
            MasterCard Credit - MasterCard Debit - Visa Credit - Visa Debit - Visa
            Electron  **Note** Additional values may be present.
        bin (str): Credit card BIN (the first six digits of the credit card).Derived
            either from the `cc_bin` request field or from the first six characters
            of the `customer_cc_num` field.
        account_type (str): Type of payment card account. This field can refer to a
            credit card, debit card, or prepaid card account type.
        issuer (str): Name of the bank or entity that issued the card account.
        bin_country (str): Country (two-digit country code) associated with the BIN
            of the customer’s card used for the payment. Returned if the information
            is available. Use this field for additional information when reviewing
            orders. This information is also displayed in the details page of the
            Visa Acceptance Business Center.
        e_wallet (EWallet1): The model property of type EWallet1.
        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",
        "account_features": "accountFeatures",
        "bank": "bank",
        "customer": "customer",
        "payment_instrument": "paymentInstrument",
        "instrument_identifier": "instrumentIdentifier",
        "shipping_address": "shippingAddress",
        "scheme": "scheme",
        "bin": "bin",
        "account_type": "accountType",
        "issuer": "issuer",
        "bin_country": "binCountry",
        "e_wallet": "eWallet",
    }

    _optionals = [
        "card",
        "tokenized_card",
        "tokenized_payment_method",
        "account_features",
        "bank",
        "customer",
        "payment_instrument",
        "instrument_identifier",
        "shipping_address",
        "scheme",
        "bin",
        "account_type",
        "issuer",
        "bin_country",
        "e_wallet",
    ]

    def __init__(
        self,
        card=APIHelper.SKIP,
        tokenized_card=APIHelper.SKIP,
        tokenized_payment_method=APIHelper.SKIP,
        account_features=APIHelper.SKIP,
        bank=APIHelper.SKIP,
        customer=APIHelper.SKIP,
        payment_instrument=APIHelper.SKIP,
        instrument_identifier=APIHelper.SKIP,
        shipping_address=APIHelper.SKIP,
        scheme=APIHelper.SKIP,
        bin=APIHelper.SKIP,
        account_type=APIHelper.SKIP,
        issuer=APIHelper.SKIP,
        bin_country=APIHelper.SKIP,
        e_wallet=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PaymentInformation1 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 account_features is not APIHelper.SKIP:
            self.account_features = account_features
        if bank is not APIHelper.SKIP:
            self.bank = bank
        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 scheme is not APIHelper.SKIP:
            self.scheme = scheme
        if bin is not APIHelper.SKIP:
            self.bin = bin
        if account_type is not APIHelper.SKIP:
            self.account_type = account_type
        if issuer is not APIHelper.SKIP:
            self.issuer = issuer
        if bin_country is not APIHelper.SKIP:
            self.bin_country = bin_country
        if e_wallet is not APIHelper.SKIP:
            self.e_wallet = e_wallet

        # 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 =\
            Card1.from_dictionary(
                dictionary.get("card"))\
                if "card" in dictionary.keys()\
                else APIHelper.SKIP
        tokenized_card =\
            TokenizedCard1.from_dictionary(
                dictionary.get("tokenizedCard"))\
                if "tokenizedCard" in dictionary.keys()\
                else APIHelper.SKIP
        tokenized_payment_method =\
            TokenizedPaymentMethod1.from_dictionary(
                dictionary.get("tokenizedPaymentMethod"))\
                if "tokenizedPaymentMethod" in dictionary.keys()\
                else APIHelper.SKIP
        account_features =\
            AccountFeatures.from_dictionary(
                dictionary.get("accountFeatures"))\
                if "accountFeatures" in dictionary.keys()\
                else APIHelper.SKIP
        bank =\
            Bank1.from_dictionary(
                dictionary.get("bank"))\
                if "bank" 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 =\
            InstrumentIdentifier2.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
        scheme =\
            dictionary.get("scheme")\
            if dictionary.get("scheme")\
                else APIHelper.SKIP
        bin =\
            dictionary.get("bin")\
            if dictionary.get("bin")\
                else APIHelper.SKIP
        account_type =\
            dictionary.get("accountType")\
            if dictionary.get("accountType")\
                else APIHelper.SKIP
        issuer =\
            dictionary.get("issuer")\
            if dictionary.get("issuer")\
                else APIHelper.SKIP
        bin_country =\
            dictionary.get("binCountry")\
            if dictionary.get("binCountry")\
                else APIHelper.SKIP
        e_wallet =\
            EWallet1.from_dictionary(
                dictionary.get("eWallet"))\
                if "eWallet" 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,
                   account_features,
                   bank,
                   customer,
                   payment_instrument,
                   instrument_identifier,
                   shipping_address,
                   scheme,
                   bin,
                   account_type,
                   issuer,
                   bin_country,
                   e_wallet,
                   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
        )
        _account_features=(
            self.account_features
            if hasattr(self, "account_features")
            else None
        )
        _bank=(
            self.bank
            if hasattr(self, "bank")
            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
        )
        _scheme=(
            self.scheme
            if hasattr(self, "scheme")
            else None
        )
        _bin=(
            self.bin
            if hasattr(self, "bin")
            else None
        )
        _account_type=(
            self.account_type
            if hasattr(self, "account_type")
            else None
        )
        _issuer=(
            self.issuer
            if hasattr(self, "issuer")
            else None
        )
        _bin_country=(
            self.bin_country
            if hasattr(self, "bin_country")
            else None
        )
        _e_wallet=(
            self.e_wallet
            if hasattr(self, "e_wallet")
            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"account_features={_account_features!r}, "
            f"bank={_bank!r}, "
            f"customer={_customer!r}, "
            f"payment_instrument={_payment_instrument!r}, "
            f"instrument_identifier={_instrument_identifier!r}, "
            f"shipping_address={_shipping_address!r}, "
            f"scheme={_scheme!r}, "
            f"bin={_bin!r}, "
            f"account_type={_account_type!r}, "
            f"issuer={_issuer!r}, "
            f"bin_country={_bin_country!r}, "
            f"e_wallet={_e_wallet!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
        )
        _account_features=(
            self.account_features
            if hasattr(self, "account_features")
            else None
        )
        _bank=(
            self.bank
            if hasattr(self, "bank")
            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
        )
        _scheme=(
            self.scheme
            if hasattr(self, "scheme")
            else None
        )
        _bin=(
            self.bin
            if hasattr(self, "bin")
            else None
        )
        _account_type=(
            self.account_type
            if hasattr(self, "account_type")
            else None
        )
        _issuer=(
            self.issuer
            if hasattr(self, "issuer")
            else None
        )
        _bin_country=(
            self.bin_country
            if hasattr(self, "bin_country")
            else None
        )
        _e_wallet=(
            self.e_wallet
            if hasattr(self, "e_wallet")
            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"account_features={_account_features!s}, "
            f"bank={_bank!s}, "
            f"customer={_customer!s}, "
            f"payment_instrument={_payment_instrument!s}, "
            f"instrument_identifier={_instrument_identifier!s}, "
            f"shipping_address={_shipping_address!s}, "
            f"scheme={_scheme!s}, "
            f"bin={_bin!s}, "
            f"account_type={_account_type!s}, "
            f"issuer={_issuer!s}, "
            f"bin_country={_bin_country!s}, "
            f"e_wallet={_e_wallet!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
