# coding: utf-8

"""
    Lotus API

    Lotus is an open-core pricing and billing engine. We enable API companies to automate and optimize their custom usage-based pricing for any metric.  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class RecurringCharge(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 = {
        'name': 'str',
        'charge_timing': 'str',
        'charge_behavior': 'str',
        'amount': 'float',
        'pricing_unit': 'PricingUnit',
        'invoicing_interval_unit': 'str',
        'invoicing_interval_count': 'int',
        'reset_interval_unit': 'str',
        'reset_interval_count': 'int'
    }

    attribute_map = {
        'name': 'name',
        'charge_timing': 'charge_timing',
        'charge_behavior': 'charge_behavior',
        'amount': 'amount',
        'pricing_unit': 'pricing_unit',
        'invoicing_interval_unit': 'invoicing_interval_unit',
        'invoicing_interval_count': 'invoicing_interval_count',
        'reset_interval_unit': 'reset_interval_unit',
        'reset_interval_count': 'reset_interval_count'
    }

    def __init__(self, name=None, charge_timing=None, charge_behavior=None, amount=None, pricing_unit=None, invoicing_interval_unit=None, invoicing_interval_count=None, reset_interval_unit=None, reset_interval_count=None):  # noqa: E501
        """RecurringCharge - a model defined in Swagger"""  # noqa: E501
        self._name = None
        self._charge_timing = None
        self._charge_behavior = None
        self._amount = None
        self._pricing_unit = None
        self._invoicing_interval_unit = None
        self._invoicing_interval_count = None
        self._reset_interval_unit = None
        self._reset_interval_count = None
        self.discriminator = None
        self.name = name
        self.charge_timing = charge_timing
        self.charge_behavior = charge_behavior
        self.amount = amount
        self.pricing_unit = pricing_unit
        self.invoicing_interval_unit = invoicing_interval_unit
        self.invoicing_interval_count = invoicing_interval_count
        self.reset_interval_unit = reset_interval_unit
        self.reset_interval_count = reset_interval_count

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


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

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


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

        self._name = name

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

        * `in_advance` - in_advance * `in_arrears` - in_arrears  # noqa: E501

        :return: The charge_timing of this RecurringCharge.  # noqa: E501
        :rtype: str
        """
        return self._charge_timing

    @charge_timing.setter
    def charge_timing(self, charge_timing):
        """Sets the charge_timing of this RecurringCharge.

        * `in_advance` - in_advance * `in_arrears` - in_arrears  # noqa: E501

        :param charge_timing: The charge_timing of this RecurringCharge.  # noqa: E501
        :type: str
        """
        if charge_timing is None:
            raise ValueError("Invalid value for `charge_timing`, must not be `None`")  # noqa: E501
        allowed_values = ["in_advance", "in_arrears"]  # noqa: E501
        if charge_timing not in allowed_values:
            raise ValueError(
                "Invalid value for `charge_timing` ({0}), must be one of {1}"  # noqa: E501
                .format(charge_timing, allowed_values)
            )

        self._charge_timing = charge_timing

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

        * `prorate` - prorate * `full` - full  # noqa: E501

        :return: The charge_behavior of this RecurringCharge.  # noqa: E501
        :rtype: str
        """
        return self._charge_behavior

    @charge_behavior.setter
    def charge_behavior(self, charge_behavior):
        """Sets the charge_behavior of this RecurringCharge.

        * `prorate` - prorate * `full` - full  # noqa: E501

        :param charge_behavior: The charge_behavior of this RecurringCharge.  # noqa: E501
        :type: str
        """
        if charge_behavior is None:
            raise ValueError("Invalid value for `charge_behavior`, must not be `None`")  # noqa: E501
        allowed_values = ["prorate", "full"]  # noqa: E501
        if charge_behavior not in allowed_values:
            raise ValueError(
                "Invalid value for `charge_behavior` ({0}), must be one of {1}"  # noqa: E501
                .format(charge_behavior, allowed_values)
            )

        self._charge_behavior = charge_behavior

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


        :return: The amount of this RecurringCharge.  # noqa: E501
        :rtype: float
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this RecurringCharge.


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

        self._amount = amount

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


        :return: The pricing_unit of this RecurringCharge.  # noqa: E501
        :rtype: PricingUnit
        """
        return self._pricing_unit

    @pricing_unit.setter
    def pricing_unit(self, pricing_unit):
        """Sets the pricing_unit of this RecurringCharge.


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

        self._pricing_unit = pricing_unit

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

        * `day` - day * `week` - week * `month` - month * `year` - year  # noqa: E501

        :return: The invoicing_interval_unit of this RecurringCharge.  # noqa: E501
        :rtype: str
        """
        return self._invoicing_interval_unit

    @invoicing_interval_unit.setter
    def invoicing_interval_unit(self, invoicing_interval_unit):
        """Sets the invoicing_interval_unit of this RecurringCharge.

        * `day` - day * `week` - week * `month` - month * `year` - year  # noqa: E501

        :param invoicing_interval_unit: The invoicing_interval_unit of this RecurringCharge.  # noqa: E501
        :type: str
        """
        if invoicing_interval_unit is None:
            raise ValueError("Invalid value for `invoicing_interval_unit`, must not be `None`")  # noqa: E501
        allowed_values = ["day", "week", "month", "year", ""]  # noqa: E501
        if invoicing_interval_unit not in allowed_values:
            raise ValueError(
                "Invalid value for `invoicing_interval_unit` ({0}), must be one of {1}"  # noqa: E501
                .format(invoicing_interval_unit, allowed_values)
            )

        self._invoicing_interval_unit = invoicing_interval_unit

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


        :return: The invoicing_interval_count of this RecurringCharge.  # noqa: E501
        :rtype: int
        """
        return self._invoicing_interval_count

    @invoicing_interval_count.setter
    def invoicing_interval_count(self, invoicing_interval_count):
        """Sets the invoicing_interval_count of this RecurringCharge.


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

        self._invoicing_interval_count = invoicing_interval_count

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

        * `day` - day * `week` - week * `month` - month * `year` - year  # noqa: E501

        :return: The reset_interval_unit of this RecurringCharge.  # noqa: E501
        :rtype: str
        """
        return self._reset_interval_unit

    @reset_interval_unit.setter
    def reset_interval_unit(self, reset_interval_unit):
        """Sets the reset_interval_unit of this RecurringCharge.

        * `day` - day * `week` - week * `month` - month * `year` - year  # noqa: E501

        :param reset_interval_unit: The reset_interval_unit of this RecurringCharge.  # noqa: E501
        :type: str
        """
        if reset_interval_unit is None:
            raise ValueError("Invalid value for `reset_interval_unit`, must not be `None`")  # noqa: E501
        allowed_values = ["day", "week", "month", "year", ""]  # noqa: E501
        if reset_interval_unit not in allowed_values:
            raise ValueError(
                "Invalid value for `reset_interval_unit` ({0}), must be one of {1}"  # noqa: E501
                .format(reset_interval_unit, allowed_values)
            )

        self._reset_interval_unit = reset_interval_unit

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


        :return: The reset_interval_count of this RecurringCharge.  # noqa: E501
        :rtype: int
        """
        return self._reset_interval_count

    @reset_interval_count.setter
    def reset_interval_count(self, reset_interval_count):
        """Sets the reset_interval_count of this RecurringCharge.


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

        self._reset_interval_count = reset_interval_count

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

        return self.__dict__ == other.__dict__

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