# coding: utf-8

"""
    Selling Partner API for Services

    With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class Buyer(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'buyer_id': 'str',
        'name': 'str',
        'phone': 'str',
        'is_prime_member': 'bool',
    }

    attribute_map = {
        'buyer_id': 'buyerId',
        'name': 'name',
        'phone': 'phone',
        'is_prime_member': 'isPrimeMember',
    }

    def __init__(self, buyer_id=None, name=None, phone=None, is_prime_member=None, _configuration=None):  # noqa: E501
        """Buyer - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._buyer_id = None
        self._name = None
        self._phone = None
        self._is_prime_member = None
        self.discriminator = None

        if buyer_id is not None:
            self.buyer_id = buyer_id
        if name is not None:
            self.name = name
        if phone is not None:
            self.phone = phone
        if is_prime_member is not None:
            self.is_prime_member = is_prime_member

    @property
    def buyer_id(self):
        """Gets the buyer_id of this Buyer.  # noqa: E501

        The identifier of the buyer.  # noqa: E501

        :return: The buyer_id of this Buyer.  # noqa: E501
        :rtype: str
        """
        return self._buyer_id

    @buyer_id.setter
    def buyer_id(self, buyer_id):
        """Sets the buyer_id of this Buyer.

        The identifier of the buyer.  # noqa: E501

        :param buyer_id: The buyer_id of this Buyer.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                buyer_id is not None and not re.search(r'^[A-Z0-9]*$', buyer_id)):  # noqa: E501
            raise ValueError(r"Invalid value for `buyer_id`, must be a follow pattern or equal to `/^[A-Z0-9]*$/`")  # noqa: E501

        self._buyer_id = buyer_id

    @property
    def name(self):
        """Gets the name of this Buyer.  # noqa: E501

        The name of the buyer.  # noqa: E501

        :return: The name of this Buyer.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Buyer.

        The name of the buyer.  # noqa: E501

        :param name: The name of this Buyer.  # noqa: E501
        :type: str
        """

        self._name = name

    @property
    def phone(self):
        """Gets the phone of this Buyer.  # noqa: E501

        The phone number of the buyer.  # noqa: E501

        :return: The phone of this Buyer.  # noqa: E501
        :rtype: str
        """
        return self._phone

    @phone.setter
    def phone(self, phone):
        """Sets the phone of this Buyer.

        The phone number of the buyer.  # noqa: E501

        :param phone: The phone of this Buyer.  # noqa: E501
        :type: str
        """

        self._phone = phone

    @property
    def is_prime_member(self):
        """Gets the is_prime_member of this Buyer.  # noqa: E501

        When true, the service is for an Amazon Prime buyer.  # noqa: E501

        :return: The is_prime_member of this Buyer.  # noqa: E501
        :rtype: bool
        """
        return self._is_prime_member

    @is_prime_member.setter
    def is_prime_member(self, is_prime_member):
        """Sets the is_prime_member of this Buyer.

        When true, the service is for an Amazon Prime buyer.  # noqa: E501

        :param is_prime_member: The is_prime_member of this Buyer.  # noqa: E501
        :type: bool
        """

        self._is_prime_member = is_prime_member

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(Buyer, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, Buyer):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, Buyer):
            return True

        return self.to_dict() != other.to_dict()
