"""visaacceptancemergedspec.

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

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


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

    Attributes:
        points_before_redemption (str): Loyalty points total balance before
            redemption. For Example: Points, such as 100
        points_value_before_redemption (str): The total value of loyalty points
            before redemption in the default currency. Max characters is 12 excluding
            the "." symbol For Example: Points, such as 20.00
        points_redeemed (str): Number of loyalty points that were redeemed. For
            Example: Points, such as 100
        points_value_redeemed (str): The value of the loyalty points that were
            redeemed in the default currency. Max characters is 12 excluding the "."
            symbol For Example: Points, such as 100.00
        points_after_redemption (str): Loyalty Points remaining total balance after
            redemption. For Example: Points, such as 20.00
        points_value_after_redemption (str): The value of the remaining loyalty
            points after redumption in the default currency. Max characters is 12
            excluding the "." symbol For Example: Points, such as 20.00
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "points_before_redemption": "pointsBeforeRedemption",
        "points_value_before_redemption": "pointsValueBeforeRedemption",
        "points_redeemed": "pointsRedeemed",
        "points_value_redeemed": "pointsValueRedeemed",
        "points_after_redemption": "pointsAfterRedemption",
        "points_value_after_redemption": "pointsValueAfterRedemption",
    }

    _optionals = [
        "points_before_redemption",
        "points_value_before_redemption",
        "points_redeemed",
        "points_value_redeemed",
        "points_after_redemption",
        "points_value_after_redemption",
    ]

    def __init__(
        self,
        points_before_redemption=APIHelper.SKIP,
        points_value_before_redemption=APIHelper.SKIP,
        points_redeemed=APIHelper.SKIP,
        points_value_redeemed=APIHelper.SKIP,
        points_after_redemption=APIHelper.SKIP,
        points_value_after_redemption=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a RewardPointsDetails instance."""
        # Initialize members of the class
        if points_before_redemption is not APIHelper.SKIP:
            self.points_before_redemption = points_before_redemption
        if points_value_before_redemption is not APIHelper.SKIP:
            self.points_value_before_redemption = points_value_before_redemption
        if points_redeemed is not APIHelper.SKIP:
            self.points_redeemed = points_redeemed
        if points_value_redeemed is not APIHelper.SKIP:
            self.points_value_redeemed = points_value_redeemed
        if points_after_redemption is not APIHelper.SKIP:
            self.points_after_redemption = points_after_redemption
        if points_value_after_redemption is not APIHelper.SKIP:
            self.points_value_after_redemption = points_value_after_redemption

        # 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
        points_before_redemption =\
            dictionary.get("pointsBeforeRedemption")\
            if dictionary.get("pointsBeforeRedemption")\
                else APIHelper.SKIP
        points_value_before_redemption =\
            dictionary.get("pointsValueBeforeRedemption")\
            if dictionary.get("pointsValueBeforeRedemption")\
                else APIHelper.SKIP
        points_redeemed =\
            dictionary.get("pointsRedeemed")\
            if dictionary.get("pointsRedeemed")\
                else APIHelper.SKIP
        points_value_redeemed =\
            dictionary.get("pointsValueRedeemed")\
            if dictionary.get("pointsValueRedeemed")\
                else APIHelper.SKIP
        points_after_redemption =\
            dictionary.get("pointsAfterRedemption")\
            if dictionary.get("pointsAfterRedemption")\
                else APIHelper.SKIP
        points_value_after_redemption =\
            dictionary.get("pointsValueAfterRedemption")\
            if dictionary.get("pointsValueAfterRedemption")\
                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(points_before_redemption,
                   points_value_before_redemption,
                   points_redeemed,
                   points_value_redeemed,
                   points_after_redemption,
                   points_value_after_redemption,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _points_before_redemption=(
            self.points_before_redemption
            if hasattr(self, "points_before_redemption")
            else None
        )
        _points_value_before_redemption=(
            self.points_value_before_redemption
            if hasattr(self, "points_value_before_redemption")
            else None
        )
        _points_redeemed=(
            self.points_redeemed
            if hasattr(self, "points_redeemed")
            else None
        )
        _points_value_redeemed=(
            self.points_value_redeemed
            if hasattr(self, "points_value_redeemed")
            else None
        )
        _points_after_redemption=(
            self.points_after_redemption
            if hasattr(self, "points_after_redemption")
            else None
        )
        _points_value_after_redemption=(
            self.points_value_after_redemption
            if hasattr(self, "points_value_after_redemption")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"points_before_redemption={_points_before_redemption!r}, "
            f"points_value_before_redemption={_points_value_before_redemption!r}, "
            f"points_redeemed={_points_redeemed!r}, "
            f"points_value_redeemed={_points_value_redeemed!r}, "
            f"points_after_redemption={_points_after_redemption!r}, "
            f"points_value_after_redemption={_points_value_after_redemption!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _points_before_redemption=(
            self.points_before_redemption
            if hasattr(self, "points_before_redemption")
            else None
        )
        _points_value_before_redemption=(
            self.points_value_before_redemption
            if hasattr(self, "points_value_before_redemption")
            else None
        )
        _points_redeemed=(
            self.points_redeemed
            if hasattr(self, "points_redeemed")
            else None
        )
        _points_value_redeemed=(
            self.points_value_redeemed
            if hasattr(self, "points_value_redeemed")
            else None
        )
        _points_after_redemption=(
            self.points_after_redemption
            if hasattr(self, "points_after_redemption")
            else None
        )
        _points_value_after_redemption=(
            self.points_value_after_redemption
            if hasattr(self, "points_value_after_redemption")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"points_before_redemption={_points_before_redemption!s}, "
            f"points_value_before_redemption={_points_value_before_redemption!s}, "
            f"points_redeemed={_points_redeemed!s}, "
            f"points_value_redeemed={_points_value_redeemed!s}, "
            f"points_after_redemption={_points_after_redemption!s}, "
            f"points_value_after_redemption={_points_value_after_redemption!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
