# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all clients.  # noqa: E501

    The version of the OpenAPI document: 1.104
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class Discount(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'id': 'str',
        'object': 'str',
        'coupon': 'Coupon',
        'customer': 'str',
        'end': 'int',
        'start': 'int',
        'subscription': 'str'
    }

    attribute_map = {
        'id': 'id',
        'object': 'object',
        'coupon': 'coupon',
        'customer': 'customer',
        'end': 'end',
        'start': 'start',
        'subscription': 'subscription'
    }

    def __init__(self, id=None, object=None, coupon=None, customer=None, end=None, start=None, subscription=None):  # noqa: E501
        """Discount - a model defined in OpenAPI"""  # noqa: E501

        self._id = None
        self._object = None
        self._coupon = None
        self._customer = None
        self._end = None
        self._start = None
        self._subscription = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if object is not None:
            self.object = object
        if coupon is not None:
            self.coupon = coupon
        if customer is not None:
            self.customer = customer
        if end is not None:
            self.end = end
        if start is not None:
            self.start = start
        if subscription is not None:
            self.subscription = subscription

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


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

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


        :param id: The id of this Discount.  # noqa: E501
        :type: str
        """

        self._id = id

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


        :return: The object of this Discount.  # noqa: E501
        :rtype: str
        """
        return self._object

    @object.setter
    def object(self, object):
        """Sets the object of this Discount.


        :param object: The object of this Discount.  # noqa: E501
        :type: str
        """

        self._object = object

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


        :return: The coupon of this Discount.  # noqa: E501
        :rtype: Coupon
        """
        return self._coupon

    @coupon.setter
    def coupon(self, coupon):
        """Sets the coupon of this Discount.


        :param coupon: The coupon of this Discount.  # noqa: E501
        :type: Coupon
        """

        self._coupon = coupon

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


        :return: The customer of this Discount.  # noqa: E501
        :rtype: str
        """
        return self._customer

    @customer.setter
    def customer(self, customer):
        """Sets the customer of this Discount.


        :param customer: The customer of this Discount.  # noqa: E501
        :type: str
        """

        self._customer = customer

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


        :return: The end of this Discount.  # noqa: E501
        :rtype: int
        """
        return self._end

    @end.setter
    def end(self, end):
        """Sets the end of this Discount.


        :param end: The end of this Discount.  # noqa: E501
        :type: int
        """

        self._end = end

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


        :return: The start of this Discount.  # noqa: E501
        :rtype: int
        """
        return self._start

    @start.setter
    def start(self, start):
        """Sets the start of this Discount.


        :param start: The start of this Discount.  # noqa: E501
        :type: int
        """

        self._start = start

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


        :return: The subscription of this Discount.  # noqa: E501
        :rtype: str
        """
        return self._subscription

    @subscription.setter
    def subscription(self, subscription):
        """Sets the subscription of this Discount.


        :param subscription: The subscription of this Discount.  # noqa: E501
        :type: str
        """

        self._subscription = subscription

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

        for attr, _ in six.iteritems(self.openapi_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

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

        return self.__dict__ == other.__dict__

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