"""mindbodypublicapi.

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

# ruff: noqa: E501
class CheckoutAlternativePaymentInfo(object):
    """Implementation of the 'CheckoutAlternativePaymentInfo' model.

    Request object to capture Alternative Payment information.

    Attributes:
        payment_method_id (int): The type of alternative payment. Possible values
            are:  * 997 - Indicates that this payment item is iDEAL.  * 801 -
            Indicates that this payment item is Apple Pay.
        amount (float): The amount to be paid

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payment_method_id": "PaymentMethodId",
        "amount": "Amount",
    }

    def __init__(
        self,
        payment_method_id=None,
        amount=None):
        """Initialize a CheckoutAlternativePaymentInfo instance."""
        # Initialize members of the class
        self.payment_method_id = payment_method_id
        self.amount = amount

    @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_method_id =\
            dictionary.get("PaymentMethodId")\
            if dictionary.get("PaymentMethodId")\
                else None
        amount =\
            dictionary.get("Amount")\
            if dictionary.get("Amount")\
                else None

        # Return an object of this model
        return cls(payment_method_id,
                   amount)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _payment_method_id=self.payment_method_id
        _amount=self.amount
        return (
            f"{self.__class__.__name__}("
            f"payment_method_id={_payment_method_id!r}, "
            f"amount={_amount!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _payment_method_id=self.payment_method_id
        _amount=self.amount
        return (
            f"{self.__class__.__name__}("
            f"payment_method_id={_payment_method_id!s}, "
            f"amount={_amount!s}, "
            f")"
        )
