# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class VoucherResult(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': 'User',
        'creation_date': 'datetime',
        'expiration_date': 'datetime',
        'redeemer': 'User',
        'redeem_date': 'datetime',
        'redeem_after_date': 'datetime',
        'redeem_on_week_days': 'list[WeekDayEnum]',
        'type': 'VoucherType'
    }

    attribute_map = {
        'buyer': 'buyer',
        'creation_date': 'creationDate',
        'expiration_date': 'expirationDate',
        'redeemer': 'redeemer',
        'redeem_date': 'redeemDate',
        'redeem_after_date': 'redeemAfterDate',
        'redeem_on_week_days': 'redeemOnWeekDays',
        'type': 'type'
    }

    def __init__(self, buyer=None, creation_date=None, expiration_date=None, redeemer=None, redeem_date=None, redeem_after_date=None, redeem_on_week_days=None, type=None, _configuration=None):  # noqa: E501
        """VoucherResult - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._buyer = None
        self._creation_date = None
        self._expiration_date = None
        self._redeemer = None
        self._redeem_date = None
        self._redeem_after_date = None
        self._redeem_on_week_days = None
        self._type = None
        self.discriminator = None

        if buyer is not None:
            self.buyer = buyer
        if creation_date is not None:
            self.creation_date = creation_date
        if expiration_date is not None:
            self.expiration_date = expiration_date
        if redeemer is not None:
            self.redeemer = redeemer
        if redeem_date is not None:
            self.redeem_date = redeem_date
        if redeem_after_date is not None:
            self.redeem_after_date = redeem_after_date
        if redeem_on_week_days is not None:
            self.redeem_on_week_days = redeem_on_week_days
        if type is not None:
            self.type = type

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

        The voucher buyer. Is not returned when the voucher was generated or when searching for bought vouchers of a user.   # noqa: E501

        :return: The buyer of this VoucherResult.  # noqa: E501
        :rtype: User
        """
        return self._buyer

    @buyer.setter
    def buyer(self, buyer):
        """Sets the buyer of this VoucherResult.

        The voucher buyer. Is not returned when the voucher was generated or when searching for bought vouchers of a user.   # noqa: E501

        :param buyer: The buyer of this VoucherResult.  # noqa: E501
        :type: User
        """

        self._buyer = buyer

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

        The date a voucher was generated or bought  # noqa: E501

        :return: The creation_date of this VoucherResult.  # noqa: E501
        :rtype: datetime
        """
        return self._creation_date

    @creation_date.setter
    def creation_date(self, creation_date):
        """Sets the creation_date of this VoucherResult.

        The date a voucher was generated or bought  # noqa: E501

        :param creation_date: The creation_date of this VoucherResult.  # noqa: E501
        :type: datetime
        """

        self._creation_date = creation_date

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

        The date a voucher expires  # noqa: E501

        :return: The expiration_date of this VoucherResult.  # noqa: E501
        :rtype: datetime
        """
        return self._expiration_date

    @expiration_date.setter
    def expiration_date(self, expiration_date):
        """Sets the expiration_date of this VoucherResult.

        The date a voucher expires  # noqa: E501

        :param expiration_date: The expiration_date of this VoucherResult.  # noqa: E501
        :type: datetime
        """

        self._expiration_date = expiration_date

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

        The voucher redeemer. Is not returned when the voucher was not yet redeemed or when searching for redeemed vouchers of a user.   # noqa: E501

        :return: The redeemer of this VoucherResult.  # noqa: E501
        :rtype: User
        """
        return self._redeemer

    @redeemer.setter
    def redeemer(self, redeemer):
        """Sets the redeemer of this VoucherResult.

        The voucher redeemer. Is not returned when the voucher was not yet redeemed or when searching for redeemed vouchers of a user.   # noqa: E501

        :param redeemer: The redeemer of this VoucherResult.  # noqa: E501
        :type: User
        """

        self._redeemer = redeemer

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

        The date a voucher was redeemed (if so)  # noqa: E501

        :return: The redeem_date of this VoucherResult.  # noqa: E501
        :rtype: datetime
        """
        return self._redeem_date

    @redeem_date.setter
    def redeem_date(self, redeem_date):
        """Sets the redeem_date of this VoucherResult.

        The date a voucher was redeemed (if so)  # noqa: E501

        :param redeem_date: The redeem_date of this VoucherResult.  # noqa: E501
        :type: datetime
        """

        self._redeem_date = redeem_date

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

        The date after which the voucher can be redeemed. Is only returned if the voucher `status` is `open`.   # noqa: E501

        :return: The redeem_after_date of this VoucherResult.  # noqa: E501
        :rtype: datetime
        """
        return self._redeem_after_date

    @redeem_after_date.setter
    def redeem_after_date(self, redeem_after_date):
        """Sets the redeem_after_date of this VoucherResult.

        The date after which the voucher can be redeemed. Is only returned if the voucher `status` is `open`.   # noqa: E501

        :param redeem_after_date: The redeem_after_date of this VoucherResult.  # noqa: E501
        :type: datetime
        """

        self._redeem_after_date = redeem_after_date

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

        The days of the week a voucher can be redeemed. Is only returned if the voucher `status` is `open`. Possibles values for each array element are: * fri: Friday * mon: Monday * sat: Saturday * sun: Sunday * thu: Thursday * tue: Tuesday * wed: Wednesday   # noqa: E501

        :return: The redeem_on_week_days of this VoucherResult.  # noqa: E501
        :rtype: list[WeekDayEnum]
        """
        return self._redeem_on_week_days

    @redeem_on_week_days.setter
    def redeem_on_week_days(self, redeem_on_week_days):
        """Sets the redeem_on_week_days of this VoucherResult.

        The days of the week a voucher can be redeemed. Is only returned if the voucher `status` is `open`. Possibles values for each array element are: * fri: Friday * mon: Monday * sat: Saturday * sun: Sunday * thu: Thursday * tue: Tuesday * wed: Wednesday   # noqa: E501

        :param redeem_on_week_days: The redeem_on_week_days of this VoucherResult.  # noqa: E501
        :type: list[WeekDayEnum]
        """

        self._redeem_on_week_days = redeem_on_week_days

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

        The voucher type  # noqa: E501

        :return: The type of this VoucherResult.  # noqa: E501
        :rtype: VoucherType
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this VoucherResult.

        The voucher type  # noqa: E501

        :param type: The type of this VoucherResult.  # noqa: E501
        :type: VoucherType
        """

        self._type = type

    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(VoucherResult, 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, VoucherResult):
            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, VoucherResult):
            return True

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