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

"""
paypalrestapis

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


class PayeeBase(object):

    """Implementation of the 'Payee Base' model.

    The details for the merchant who receives the funds and fulfills the
    order. The merchant is also known as the payee.

    Attributes:
        email_address (str): The internationalized email
            address.<blockquote><strong>Note:</strong> Up to 64 characters are
            allowed before and 255 characters are allowed after the
            <code>@</code> sign. However, the generally accepted maximum
            length for an email address is 254 characters. The pattern
            verifies that an unquoted <code>@</code> sign exists.</blockquote>
        merchant_id (str): The account identifier for a PayPal account.

    """

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

    _optionals = [
        'email_address',
        'merchant_id',
    ]

    def __init__(self,
                 email_address=APIHelper.SKIP,
                 merchant_id=APIHelper.SKIP):
        """Constructor for the PayeeBase class"""

        # Initialize members of the class
        if email_address is not APIHelper.SKIP:
            self.email_address = email_address 
        if merchant_id is not APIHelper.SKIP:
            self.merchant_id = merchant_id 

    @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
        email_address = dictionary.get("email_address") if dictionary.get("email_address") else APIHelper.SKIP
        merchant_id = dictionary.get("merchant_id") if dictionary.get("merchant_id") else APIHelper.SKIP
        # Return an object of this model
        return cls(email_address,
                   merchant_id)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'email_address={(self.email_address if hasattr(self, "email_address") else None)!r}, '
                f'merchant_id={(self.merchant_id if hasattr(self, "merchant_id") else None)!r})')

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