"""visaacceptancemergedspec.

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

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


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

    Attributes:
        balance_amount (str): Remaining balance on the account.  Returned by
            authorization service.  #### PIN debit Remaining balance on the prepaid
            card.  Returned by PIN debit purchase.
        previous_balance_amount (str): Remaining balance on the account.  Returned by
            authorization service.  #### PIN debit Remaining balance on the prepaid
            card.  Returned by PIN debit purchase.
        currency (str): Currency of the remaining balance on the account. For the
            possible values, see the [ISO Standard Currency Codes.](  Returned by
            authorization service.  #### PIN debit Currency of the remaining balance
            on the prepaid card.  Returned by PIN debit purchase.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "balance_amount": "balanceAmount",
        "previous_balance_amount": "previousBalanceAmount",
        "currency": "currency",
    }

    _optionals = [
        "balance_amount",
        "previous_balance_amount",
        "currency",
    ]

    def __init__(
        self,
        balance_amount=APIHelper.SKIP,
        previous_balance_amount=APIHelper.SKIP,
        currency=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a AccountFeatures2 instance."""
        # Initialize members of the class
        if balance_amount is not APIHelper.SKIP:
            self.balance_amount = balance_amount
        if previous_balance_amount is not APIHelper.SKIP:
            self.previous_balance_amount = previous_balance_amount
        if currency is not APIHelper.SKIP:
            self.currency = currency

        # 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
        balance_amount =\
            dictionary.get("balanceAmount")\
            if dictionary.get("balanceAmount")\
                else APIHelper.SKIP
        previous_balance_amount =\
            dictionary.get("previousBalanceAmount")\
            if dictionary.get("previousBalanceAmount")\
                else APIHelper.SKIP
        currency =\
            dictionary.get("currency")\
            if dictionary.get("currency")\
                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(balance_amount,
                   previous_balance_amount,
                   currency,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _balance_amount=(
            self.balance_amount
            if hasattr(self, "balance_amount")
            else None
        )
        _previous_balance_amount=(
            self.previous_balance_amount
            if hasattr(self, "previous_balance_amount")
            else None
        )
        _currency=(
            self.currency
            if hasattr(self, "currency")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"balance_amount={_balance_amount!r}, "
            f"previous_balance_amount={_previous_balance_amount!r}, "
            f"currency={_currency!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _balance_amount=(
            self.balance_amount
            if hasattr(self, "balance_amount")
            else None
        )
        _previous_balance_amount=(
            self.previous_balance_amount
            if hasattr(self, "previous_balance_amount")
            else None
        )
        _currency=(
            self.currency
            if hasattr(self, "currency")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"balance_amount={_balance_amount!s}, "
            f"previous_balance_amount={_previous_balance_amount!s}, "
            f"currency={_currency!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
