"""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.e_wallet_13 import (
    EWallet13,
)
from visaacceptancemergedspec.models.payment_type_19 import (
    PaymentType19,
)
from visaacceptancemergedspec.models.tokenized_payment_method_2 import (
    TokenizedPaymentMethod2,
)


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

    Attributes:
        payment_type (PaymentType19): The model property of type PaymentType19.
        tokenized_payment_method (TokenizedPaymentMethod2): The model property of
            type TokenizedPaymentMethod2.
        industry_type (str): Indicates the industry type. Possible Values: - “Events”
            - "Ticketing" - "Fuel" - "GAMING" - "DIGITAL GOODS" - "TELCO" - "Token
            Service Providers" - "Gambling" - "CFDs" - "car rental" - "hotel" -
            "transportation" - "travel package" - "Cruise Line" - "P2P" - "Retail" -
            "Food" - "Groceries" - "Ride Sharing" - "Taxi" - "Remittance" - "Crypto"
            - "Marketplaces"
        e_wallet (EWallet13): The model property of type EWallet13.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payment_type": "paymentType",
        "tokenized_payment_method": "tokenizedPaymentMethod",
        "industry_type": "industryType",
        "e_wallet": "eWallet",
    }

    _optionals = [
        "payment_type",
        "tokenized_payment_method",
        "industry_type",
        "e_wallet",
    ]

    def __init__(
        self,
        payment_type=APIHelper.SKIP,
        tokenized_payment_method=APIHelper.SKIP,
        industry_type=APIHelper.SKIP,
        e_wallet=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PaymentInformation26 instance."""
        # Initialize members of the class
        if payment_type is not APIHelper.SKIP:
            self.payment_type = payment_type
        if tokenized_payment_method is not APIHelper.SKIP:
            self.tokenized_payment_method = tokenized_payment_method
        if industry_type is not APIHelper.SKIP:
            self.industry_type = industry_type
        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
        payment_type =\
            PaymentType19.from_dictionary(
                dictionary.get("paymentType"))\
                if "paymentType" in dictionary.keys()\
                else APIHelper.SKIP
        tokenized_payment_method =\
            TokenizedPaymentMethod2.from_dictionary(
                dictionary.get("tokenizedPaymentMethod"))\
                if "tokenizedPaymentMethod" in dictionary.keys()\
                else APIHelper.SKIP
        industry_type =\
            dictionary.get("industryType")\
            if dictionary.get("industryType")\
                else APIHelper.SKIP
        e_wallet =\
            EWallet13.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(payment_type,
                   tokenized_payment_method,
                   industry_type,
                   e_wallet,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _payment_type=(
            self.payment_type
            if hasattr(self, "payment_type")
            else None
        )
        _tokenized_payment_method=(
            self.tokenized_payment_method
            if hasattr(self, "tokenized_payment_method")
            else None
        )
        _industry_type=(
            self.industry_type
            if hasattr(self, "industry_type")
            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"payment_type={_payment_type!r}, "
            f"tokenized_payment_method={_tokenized_payment_method!r}, "
            f"industry_type={_industry_type!r}, "
            f"e_wallet={_e_wallet!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _payment_type=(
            self.payment_type
            if hasattr(self, "payment_type")
            else None
        )
        _tokenized_payment_method=(
            self.tokenized_payment_method
            if hasattr(self, "tokenized_payment_method")
            else None
        )
        _industry_type=(
            self.industry_type
            if hasattr(self, "industry_type")
            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"payment_type={_payment_type!s}, "
            f"tokenized_payment_method={_tokenized_payment_method!s}, "
            f"industry_type={_industry_type!s}, "
            f"e_wallet={_e_wallet!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
