"""visaacceptancemergedspec.

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

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


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

    Attributes:
        amount_type (str): Total amount that has been spent on healthcare in a
            transaction. Valid Values for **Visa**: - `healthcare` - Total Amount
            Healthcare - `healthcare-transit` - Amount Transit - `vision` - Amount
            Vision/Optical - `prescription` - Amount Prescription/RX - `clinic` -
            Amount Clinic/Other Qualified Medical - `dental` - Amount Dental
            `Note:` -  Prescription, Clinic and dental amounts must be preceded with
            the total healthcare amount and cannot occur individually.  Vision and
            Transit must be sent individually and cannot be combined with total
            healthcare amount or any other amounts. Total Healthcare amount can be
            sent individually.  Valid Values for **MasterCard**: - `prescription` -
            Amount Prescription/RX - `eligible-total` - Total Amount Healthcare
            `Note:` -  Prescription must be preceded with the total healthcare amount
            and cannot occur individually. Total Healthcare amount can be sent
            individually.
        amount (str): Total Amount that has been spent on the corresponding
            amountType. This is 13 byte field including sign. If the amount is
            positive, then it is a debit for the customer. If the amount is negative,
            then it is a credit for the customer.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "amount_type": "amountType",
        "amount": "amount",
    }

    _optionals = [
        "amount_type",
        "amount",
    ]

    def __init__(
        self,
        amount_type=APIHelper.SKIP,
        amount=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a AmountDetails1 instance."""
        # Initialize members of the class
        if amount_type is not APIHelper.SKIP:
            self.amount_type = amount_type
        if amount is not APIHelper.SKIP:
            self.amount = amount

        # 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
        amount_type =\
            dictionary.get("amountType")\
            if dictionary.get("amountType")\
                else APIHelper.SKIP
        amount =\
            dictionary.get("amount")\
            if dictionary.get("amount")\
                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(amount_type,
                   amount,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _amount_type=(
            self.amount_type
            if hasattr(self, "amount_type")
            else None
        )
        _amount=(
            self.amount
            if hasattr(self, "amount")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"amount_type={_amount_type!r}, "
            f"amount={_amount!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _amount_type=(
            self.amount_type
            if hasattr(self, "amount_type")
            else None
        )
        _amount=(
            self.amount
            if hasattr(self, "amount")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"amount_type={_amount_type!s}, "
            f"amount={_amount!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
