"""visaacceptancemergedspec.

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

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)


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

    Attributes:
        account_id (str): The ID of the customer, passed in the return_url field by
            PayPal after customer approval.
        funding_source (str): Payment mode for the authorization or order
            transaction.  INSTANT_TRANSFER  MANUAL_BANK_TRANSFER  DELAYED_TRANSFER
             ECHECK  UNRESTRICTED (default)—this value is available only when
            configured by PayPal for the merchant. INSTANT
        funding_source_sale (str): Payment method for the unit purchase. Possible
            values: - `UNRESTRICTED (default)—this value is only available if
            configured by PayPal for the merchant.` - `INSTANT`
        user_name (str): The Venmo user name chosen by the user, also know as a Venmo
            handle.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "account_id": "accountId",
        "funding_source": "fundingSource",
        "funding_source_sale": "fundingSourceSale",
        "user_name": "userName",
    }

    _optionals = [
        "account_id",
        "funding_source",
        "funding_source_sale",
        "user_name",
    ]

    def __init__(
        self,
        account_id=APIHelper.SKIP,
        funding_source=APIHelper.SKIP,
        funding_source_sale=APIHelper.SKIP,
        user_name=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a EWallet8 instance."""
        # Initialize members of the class
        if account_id is not APIHelper.SKIP:
            self.account_id = account_id
        if funding_source is not APIHelper.SKIP:
            self.funding_source = funding_source
        if funding_source_sale is not APIHelper.SKIP:
            self.funding_source_sale = funding_source_sale
        if user_name is not APIHelper.SKIP:
            self.user_name = user_name

        # 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
        account_id =\
            dictionary.get("accountId")\
            if dictionary.get("accountId")\
                else APIHelper.SKIP
        funding_source =\
            dictionary.get("fundingSource")\
            if dictionary.get("fundingSource")\
                else APIHelper.SKIP
        funding_source_sale =\
            dictionary.get("fundingSourceSale")\
            if dictionary.get("fundingSourceSale")\
                else APIHelper.SKIP
        user_name =\
            dictionary.get("userName")\
            if dictionary.get("userName")\
                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(account_id,
                   funding_source,
                   funding_source_sale,
                   user_name,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _account_id=(
            self.account_id
            if hasattr(self, "account_id")
            else None
        )
        _funding_source=(
            self.funding_source
            if hasattr(self, "funding_source")
            else None
        )
        _funding_source_sale=(
            self.funding_source_sale
            if hasattr(self, "funding_source_sale")
            else None
        )
        _user_name=(
            self.user_name
            if hasattr(self, "user_name")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"account_id={_account_id!r}, "
            f"funding_source={_funding_source!r}, "
            f"funding_source_sale={_funding_source_sale!r}, "
            f"user_name={_user_name!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _account_id=(
            self.account_id
            if hasattr(self, "account_id")
            else None
        )
        _funding_source=(
            self.funding_source
            if hasattr(self, "funding_source")
            else None
        )
        _funding_source_sale=(
            self.funding_source_sale
            if hasattr(self, "funding_source_sale")
            else None
        )
        _user_name=(
            self.user_name
            if hasattr(self, "user_name")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"account_id={_account_id!s}, "
            f"funding_source={_funding_source!s}, "
            f"funding_source_sale={_funding_source_sale!s}, "
            f"user_name={_user_name!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
