# -*- coding: utf-8 -*-

"""
paypalserversdk

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from paypalserversdk.api_helper import APIHelper


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'):
        """Constructor for the PaymentMethod class"""

        # Initialize members of the class
        self.payee_preferred = payee_preferred 

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates 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 (f'{self.__class__.__name__}('
                f'payee_preferred={(self.payee_preferred if hasattr(self, "payee_preferred") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'payee_preferred={(self.payee_preferred if hasattr(self, "payee_preferred") else None)!s})')
