# coding: utf-8

"""
    CardPay REST API

    Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.  # noqa: E501

    OpenAPI spec version: 3.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from cardpay.model.payment_request_living_address import (
    PaymentRequestLivingAddress,
)  # noqa: F401,E501


class PaymentRequestCustomer(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 = {
        "birth_date": "datetime",
        "email": "str",
        "full_name": "str",
        "home_phone": "str",
        "id": "str",
        "living_address": "PaymentRequestLivingAddress",
        "locale": "str",
        "phone": "str",
        "work_phone": "str",
        "ip": "str",
    }

    attribute_map = {
        "birth_date": "birth_date",
        "email": "email",
        "full_name": "full_name",
        "home_phone": "home_phone",
        "id": "id",
        "living_address": "living_address",
        "locale": "locale",
        "phone": "phone",
        "work_phone": "work_phone",
        "ip": "ip",
    }

    def __init__(
        self,
        birth_date=None,
        email=None,
        full_name=None,
        home_phone=None,
        id=None,
        living_address=None,
        locale=None,
        phone=None,
        work_phone=None,
        ip=None,
    ):  # noqa: E501
        """PaymentRequestCustomer - a model defined in Swagger"""  # noqa: E501

        self._birth_date = None
        self._email = None
        self._full_name = None
        self._home_phone = None
        self._id = None
        self._living_address = None
        self._locale = None
        self._phone = None
        self._work_phone = None
        self._ip = None
        self.discriminator = None

        if birth_date is not None:
            self.birth_date = birth_date
        if email is not None:
            self.email = email
        if full_name is not None:
            self.full_name = full_name
        if home_phone is not None:
            self.home_phone = home_phone
        if id is not None:
            self.id = id
        if living_address is not None:
            self.living_address = living_address
        if locale is not None:
            self.locale = locale
        if phone is not None:
            self.phone = phone
        if work_phone is not None:
            self.work_phone = work_phone
        if ip is not None:
            self.ip = ip

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

        Customer birth date in format `YYYY-MM-DD`. For Zenith bank in DIRECTBANKINGNGA: Customer password in format date of birth. *(mandatory for DIRECTBANKINGNGA payment method only)*  # noqa: E501

        :return: The birth_date of this PaymentRequestCustomer.  # noqa: E501
        :rtype: datetime
        """
        return self._birth_date

    @birth_date.setter
    def birth_date(self, birth_date):
        """Sets the birth_date of this PaymentRequestCustomer.

        Customer birth date in format `YYYY-MM-DD`. For Zenith bank in DIRECTBANKINGNGA: Customer password in format date of birth. *(mandatory for DIRECTBANKINGNGA payment method only)*  # noqa: E501

        :param birth_date: The birth_date of this PaymentRequestCustomer.  # noqa: E501
        :type: datetime
        """

        self._birth_date = birth_date

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

        Email address of Customer *(mandatory by default for BANKCARD, PAYPAL, 'Latin America', AIRTEL, MPESA, MTN, UGANDAMOBILE, VODAFONE, TIGO, DIRECTBANKINGNGA and AQRCODE payment methods only)*. Can be defined as optional by CardPay manager.  # noqa: E501

        :return: The email of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """Sets the email of this PaymentRequestCustomer.

        Email address of Customer *(mandatory by default for BANKCARD, PAYPAL, 'Latin America', AIRTEL, MPESA, MTN, UGANDAMOBILE, VODAFONE, TIGO, DIRECTBANKINGNGA and AQRCODE payment methods only)*. Can be defined as optional by CardPay manager.  # noqa: E501

        :param email: The email of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """
        if email is not None and len(email) > 256:
            raise ValueError(
                "Invalid value for `email`, length must be less than or equal to `256`"
            )  # noqa: E501
        if email is not None and len(email) < 1:
            raise ValueError(
                "Invalid value for `email`, length must be greater than or equal to `1`"
            )  # noqa: E501

        self._email = email

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

        Customer full name *(mandatory for 'Latin America' payment methods only)*  # noqa: E501

        :return: The full_name of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._full_name

    @full_name.setter
    def full_name(self, full_name):
        """Sets the full_name of this PaymentRequestCustomer.

        Customer full name *(mandatory for 'Latin America' payment methods only)*  # noqa: E501

        :param full_name: The full_name of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """
        if full_name is not None and len(full_name) > 256:
            raise ValueError(
                "Invalid value for `full_name`, length must be less than or equal to `256`"
            )  # noqa: E501
        if full_name is not None and len(full_name) < 1:
            raise ValueError(
                "Invalid value for `full_name`, length must be greater than or equal to `1`"
            )  # noqa: E501

        self._full_name = full_name

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

        The work phone number provided by the Cardholder. Required (if available), unless market or regional mandate restricts sending this information. Characters Format: string (10-18 symbols) country code + Subscriber number. Refer to ITU-E.164 for additional information on format and length.  # noqa: E501

        :return: The home_phone of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._home_phone

    @home_phone.setter
    def home_phone(self, home_phone):
        """Sets the home_phone of this PaymentRequestCustomer.

        The work phone number provided by the Cardholder. Required (if available), unless market or regional mandate restricts sending this information. Characters Format: string (10-18 symbols) country code + Subscriber number. Refer to ITU-E.164 for additional information on format and length.  # noqa: E501

        :param home_phone: The home_phone of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """
        if home_phone is not None and len(home_phone) > 18:
            raise ValueError(
                "Invalid value for `home_phone`, length must be less than or equal to `18`"
            )  # noqa: E501
        if home_phone is not None and len(home_phone) < 8:
            raise ValueError(
                "Invalid value for `home_phone`, length must be greater than or equal to `8`"
            )  # noqa: E501

        self._home_phone = home_phone

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

        Customer ID in Merchant's system *(mandatory for WEBMONEY payment method only)*  # noqa: E501

        :return: The id of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this PaymentRequestCustomer.

        Customer ID in Merchant's system *(mandatory for WEBMONEY payment method only)*  # noqa: E501

        :param id: The id of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """
        if id is not None and len(id) > 256:
            raise ValueError(
                "Invalid value for `id`, length must be less than or equal to `256`"
            )  # noqa: E501
        if id is not None and len(id) < 0:
            raise ValueError(
                "Invalid value for `id`, length must be greater than or equal to `0`"
            )  # noqa: E501

        self._id = id

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

        Customer address *(mandatory for 'Latin America' methods only)* For 'Latin America' is required for methods where country = CO  # noqa: E501

        :return: The living_address of this PaymentRequestCustomer.  # noqa: E501
        :rtype: PaymentRequestLivingAddress
        """
        return self._living_address

    @living_address.setter
    def living_address(self, living_address):
        """Sets the living_address of this PaymentRequestCustomer.

        Customer address *(mandatory for 'Latin America' methods only)* For 'Latin America' is required for methods where country = CO  # noqa: E501

        :param living_address: The living_address of this PaymentRequestCustomer.  # noqa: E501
        :type: PaymentRequestLivingAddress
        """

        self._living_address = living_address

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

        Preferred locale for the payment page ([ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code). The default locale will be applied if the selected locale is not supported. Supported locales are: `ru`, `en`, `zh`, `ja`  # noqa: E501

        :return: The locale of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._locale

    @locale.setter
    def locale(self, locale):
        """Sets the locale of this PaymentRequestCustomer.

        Preferred locale for the payment page ([ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code). The default locale will be applied if the selected locale is not supported. Supported locales are: `ru`, `en`, `zh`, `ja`  # noqa: E501

        :param locale: The locale of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """

        self._locale = locale

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

        Customer phone number. Format: `+` sign and 10 or 11 digits, example: `+12345678901` Mandatory for DIRECTBANKINGNGA payment method. For other payment methods: optional by default, can be defined as mandatory by CardPay manager.  # noqa: E501

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

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

        Customer phone number. Format: `+` sign and 10 or 11 digits, example: `+12345678901` Mandatory for DIRECTBANKINGNGA payment method. For other payment methods: optional by default, can be defined as mandatory by CardPay manager.  # noqa: E501

        :param phone: The phone of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """
        if phone is not None and len(phone) > 18:
            raise ValueError(
                "Invalid value for `phone`, length must be less than or equal to `18`"
            )  # noqa: E501
        if phone is not None and len(phone) < 8:
            raise ValueError(
                "Invalid value for `phone`, length must be greater than or equal to `8`"
            )  # noqa: E501

        self._phone = phone

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

        The home phone number provided by the Cardholder. Required (if available) unless market or regional mandate restricts sending this information. Characters Format: string (10-18 symbols) country code + Subscriber number. Refer to ITU-E.164 for additional information on format and length.  # noqa: E501

        :return: The work_phone of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._work_phone

    @work_phone.setter
    def work_phone(self, work_phone):
        """Sets the work_phone of this PaymentRequestCustomer.

        The home phone number provided by the Cardholder. Required (if available) unless market or regional mandate restricts sending this information. Characters Format: string (10-18 symbols) country code + Subscriber number. Refer to ITU-E.164 for additional information on format and length.  # noqa: E501

        :param work_phone: The work_phone of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """
        if work_phone is not None and len(work_phone) > 18:
            raise ValueError(
                "Invalid value for `work_phone`, length must be less than or equal to `18`"
            )  # noqa: E501
        if work_phone is not None and len(work_phone) < 8:
            raise ValueError(
                "Invalid value for `work_phone`, length must be greater than or equal to `8`"
            )  # noqa: E501

        self._work_phone = work_phone

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

        IP address of Customer  # noqa: E501

        :return: The ip of this PaymentRequestCustomer.  # noqa: E501
        :rtype: str
        """
        return self._ip

    @ip.setter
    def ip(self, ip):
        """Sets the ip of this PaymentRequestCustomer.

        IP address of Customer  # noqa: E501

        :param ip: The ip of this PaymentRequestCustomer.  # noqa: E501
        :type: str
        """

        self._ip = ip

    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:
                if value is not None:
                    result[attr] = value
        if issubclass(PaymentRequestCustomer, 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, PaymentRequestCustomer):
            return False

        return self.__dict__ == other.__dict__

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