# coding: utf-8

"""
    Spotii Billing API

    API for Billing  # noqa: E501

    OpenAPI spec version: v1.0
    Contact: hello@nuclearo.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class CardDetails(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 = {
        'number': 'str',
        'expiration_month': 'str',
        'expiration_year': 'str',
        'cvv': 'str',
        'holder': 'str'
    }

    attribute_map = {
        'number': 'number',
        'expiration_month': 'expiration_month',
        'expiration_year': 'expiration_year',
        'cvv': 'cvv',
        'holder': 'holder'
    }

    def __init__(self, number=None, expiration_month=None, expiration_year=None, cvv=None, holder=None):  # noqa: E501
        """CardDetails - a model defined in Swagger"""  # noqa: E501
        self._number = None
        self._expiration_month = None
        self._expiration_year = None
        self._cvv = None
        self._holder = None
        self.discriminator = None
        self.number = number
        self.expiration_month = expiration_month
        self.expiration_year = expiration_year
        if cvv is not None:
            self.cvv = cvv
        if holder is not None:
            self.holder = holder

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


        :return: The number of this CardDetails.  # noqa: E501
        :rtype: str
        """
        return self._number

    @number.setter
    def number(self, number):
        """Sets the number of this CardDetails.


        :param number: The number of this CardDetails.  # noqa: E501
        :type: str
        """
        if number is None:
            raise ValueError("Invalid value for `number`, must not be `None`")  # noqa: E501

        self._number = number

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


        :return: The expiration_month of this CardDetails.  # noqa: E501
        :rtype: str
        """
        return self._expiration_month

    @expiration_month.setter
    def expiration_month(self, expiration_month):
        """Sets the expiration_month of this CardDetails.


        :param expiration_month: The expiration_month of this CardDetails.  # noqa: E501
        :type: str
        """
        if expiration_month is None:
            raise ValueError("Invalid value for `expiration_month`, must not be `None`")  # noqa: E501
        allowed_values = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]  # noqa: E501
        if expiration_month not in allowed_values:
            raise ValueError(
                "Invalid value for `expiration_month` ({0}), must be one of {1}"  # noqa: E501
                .format(expiration_month, allowed_values)
            )

        self._expiration_month = expiration_month

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


        :return: The expiration_year of this CardDetails.  # noqa: E501
        :rtype: str
        """
        return self._expiration_year

    @expiration_year.setter
    def expiration_year(self, expiration_year):
        """Sets the expiration_year of this CardDetails.


        :param expiration_year: The expiration_year of this CardDetails.  # noqa: E501
        :type: str
        """
        if expiration_year is None:
            raise ValueError("Invalid value for `expiration_year`, must not be `None`")  # noqa: E501
        allowed_values = ["2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029"]  # noqa: E501
        if expiration_year not in allowed_values:
            raise ValueError(
                "Invalid value for `expiration_year` ({0}), must be one of {1}"  # noqa: E501
                .format(expiration_year, allowed_values)
            )

        self._expiration_year = expiration_year

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


        :return: The cvv of this CardDetails.  # noqa: E501
        :rtype: str
        """
        return self._cvv

    @cvv.setter
    def cvv(self, cvv):
        """Sets the cvv of this CardDetails.


        :param cvv: The cvv of this CardDetails.  # noqa: E501
        :type: str
        """

        self._cvv = cvv

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


        :return: The holder of this CardDetails.  # noqa: E501
        :rtype: str
        """
        return self._holder

    @holder.setter
    def holder(self, holder):
        """Sets the holder of this CardDetails.


        :param holder: The holder of this CardDetails.  # noqa: E501
        :type: str
        """

        self._holder = holder

    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(CardDetails, 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, CardDetails):
            return False

        return self.__dict__ == other.__dict__

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