# 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 AddOnVersion(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 = {
        'recurring_charges': 'list[RecurringCharge]',
        'components': 'list[PlanComponent]',
        'features': 'list[Feature]',
        'status': 'str',
        'currency': 'AllOfAddOnVersionCurrency',
        'active_instances': 'int',
        'invoice_when': 'str',
        'billing_frequency': 'str',
        'addon_type': 'str'
    }

    attribute_map = {
        'recurring_charges': 'recurring_charges',
        'components': 'components',
        'features': 'features',
        'status': 'status',
        'currency': 'currency',
        'active_instances': 'active_instances',
        'invoice_when': 'invoice_when',
        'billing_frequency': 'billing_frequency',
        'addon_type': 'addon_type'
    }

    def __init__(self, recurring_charges=None, components=None, features=None, status=None, currency=None, active_instances=None, invoice_when=None, billing_frequency=None, addon_type=None):  # noqa: E501
        """AddOnVersion - a model defined in Swagger"""  # noqa: E501
        self._recurring_charges = None
        self._components = None
        self._features = None
        self._status = None
        self._currency = None
        self._active_instances = None
        self._invoice_when = None
        self._billing_frequency = None
        self._addon_type = None
        self.discriminator = None
        self.recurring_charges = recurring_charges
        self.components = components
        self.features = features
        self.status = status
        self.currency = currency
        self.active_instances = active_instances
        self.invoice_when = invoice_when
        self.billing_frequency = billing_frequency
        self.addon_type = addon_type

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


        :return: The recurring_charges of this AddOnVersion.  # noqa: E501
        :rtype: list[RecurringCharge]
        """
        return self._recurring_charges

    @recurring_charges.setter
    def recurring_charges(self, recurring_charges):
        """Sets the recurring_charges of this AddOnVersion.


        :param recurring_charges: The recurring_charges of this AddOnVersion.  # noqa: E501
        :type: list[RecurringCharge]
        """
        if recurring_charges is None:
            raise ValueError("Invalid value for `recurring_charges`, must not be `None`")  # noqa: E501

        self._recurring_charges = recurring_charges

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


        :return: The components of this AddOnVersion.  # noqa: E501
        :rtype: list[PlanComponent]
        """
        return self._components

    @components.setter
    def components(self, components):
        """Sets the components of this AddOnVersion.


        :param components: The components of this AddOnVersion.  # noqa: E501
        :type: list[PlanComponent]
        """
        if components is None:
            raise ValueError("Invalid value for `components`, must not be `None`")  # noqa: E501

        self._components = components

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


        :return: The features of this AddOnVersion.  # noqa: E501
        :rtype: list[Feature]
        """
        return self._features

    @features.setter
    def features(self, features):
        """Sets the features of this AddOnVersion.


        :param features: The features of this AddOnVersion.  # noqa: E501
        :type: list[Feature]
        """
        if features is None:
            raise ValueError("Invalid value for `features`, must not be `None`")  # noqa: E501

        self._features = features

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

        * `active` - Active * `retiring` - Retiring * `grandfathered` - Grandfathered * `deleted` - Deleted * `inactive` - Inactive * `not_started` - Not Started  # noqa: E501

        :return: The status of this AddOnVersion.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this AddOnVersion.

        * `active` - Active * `retiring` - Retiring * `grandfathered` - Grandfathered * `deleted` - Deleted * `inactive` - Inactive * `not_started` - Not Started  # noqa: E501

        :param status: The status of this AddOnVersion.  # noqa: E501
        :type: str
        """
        if status is None:
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501
        allowed_values = ["active", "retiring", "grandfathered", "deleted", "inactive", "not_started"]  # noqa: E501
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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

        Currency of the plan. Can only be null if the flat fee is 0 and all components are of type free.  # noqa: E501

        :return: The currency of this AddOnVersion.  # noqa: E501
        :rtype: AllOfAddOnVersionCurrency
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """Sets the currency of this AddOnVersion.

        Currency of the plan. Can only be null if the flat fee is 0 and all components are of type free.  # noqa: E501

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

        self._currency = currency

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

        The number of active instances of this version of the add-on plan.  # noqa: E501

        :return: The active_instances of this AddOnVersion.  # noqa: E501
        :rtype: int
        """
        return self._active_instances

    @active_instances.setter
    def active_instances(self, active_instances):
        """Sets the active_instances of this AddOnVersion.

        The number of active instances of this version of the add-on plan.  # noqa: E501

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

        self._active_instances = active_instances

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

        * `invoice_on_attach` - invoice_on_attach * `invoice_on_subscription_end` - invoice_on_subscription_end  # noqa: E501

        :return: The invoice_when of this AddOnVersion.  # noqa: E501
        :rtype: str
        """
        return self._invoice_when

    @invoice_when.setter
    def invoice_when(self, invoice_when):
        """Sets the invoice_when of this AddOnVersion.

        * `invoice_on_attach` - invoice_on_attach * `invoice_on_subscription_end` - invoice_on_subscription_end  # noqa: E501

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

        self._invoice_when = invoice_when

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

        * `one_time` - one_time * `recurring` - recurring  # noqa: E501

        :return: The billing_frequency of this AddOnVersion.  # noqa: E501
        :rtype: str
        """
        return self._billing_frequency

    @billing_frequency.setter
    def billing_frequency(self, billing_frequency):
        """Sets the billing_frequency of this AddOnVersion.

        * `one_time` - one_time * `recurring` - recurring  # noqa: E501

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

        self._billing_frequency = billing_frequency

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


        :return: The addon_type of this AddOnVersion.  # noqa: E501
        :rtype: str
        """
        return self._addon_type

    @addon_type.setter
    def addon_type(self, addon_type):
        """Sets the addon_type of this AddOnVersion.


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

        self._addon_type = addon_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(AddOnVersion, 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, AddOnVersion):
            return False

        return self.__dict__ == other.__dict__

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