"""paypalserversdk.

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

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

    The customer and merchant payment preferences.

    Attributes:
        payee_preferred (PayeePaymentMethodPreference): The merchant-preferred
            payment methods.

    """

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

    _optionals = [
        "payee_preferred",
    ]

    def __init__(
        self,
        payee_preferred="UNRESTRICTED"):
        """Initialize a PaymentMethod instance."""
        # Initialize members of the class
        self.payee_preferred = payee_preferred

    @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
        payee_preferred =\
            dictionary.get("payee_preferred")\
            if dictionary.get("payee_preferred")\
                else "UNRESTRICTED"

        # Return an object of this model
        return cls(payee_preferred)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _payee_preferred=(
            self.payee_preferred
            if hasattr(self, "payee_preferred")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"payee_preferred={_payee_preferred!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _payee_preferred=(
            self.payee_preferred
            if hasattr(self, "payee_preferred")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"payee_preferred={_payee_preferred!s}, "
            f")"
        )
