# 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 PlanVersionDetail(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 = {
        'created_on': 'datetime',
        'localized_name': 'str',
        'plan_name': 'str',
        'replace_with': 'LightweightPlanVersion',
        'version': 'OneOfPlanVersionDetailVersion',
        'alerts': 'list[UsageAlert]',
        'transition_to': 'LightweightPlan',
        'features': 'list[Feature]',
        'active_subscriptions': 'int',
        'components': 'list[PlanComponent]',
        'status': 'str',
        'active_from': 'datetime',
        'active_to': 'datetime',
        'version_id': 'str',
        'price_adjustment': 'AllOfPlanVersionDetailPriceAdjustment',
        'target_customers': 'list[LightweightCustomer]',
        'plan_id': 'str',
        'recurring_charges': 'list[RecurringCharge]',
        'currency': 'PricingUnit'
    }

    attribute_map = {
        'created_on': 'created_on',
        'localized_name': 'localized_name',
        'plan_name': 'plan_name',
        'replace_with': 'replace_with',
        'version': 'version',
        'alerts': 'alerts',
        'transition_to': 'transition_to',
        'features': 'features',
        'active_subscriptions': 'active_subscriptions',
        'components': 'components',
        'status': 'status',
        'active_from': 'active_from',
        'active_to': 'active_to',
        'version_id': 'version_id',
        'price_adjustment': 'price_adjustment',
        'target_customers': 'target_customers',
        'plan_id': 'plan_id',
        'recurring_charges': 'recurring_charges',
        'currency': 'currency'
    }

    def __init__(self, created_on=None, localized_name=None, plan_name=None, replace_with=None, version=None, alerts=None, transition_to=None, features=None, active_subscriptions=None, components=None, status=None, active_from=None, active_to=None, version_id=None, price_adjustment=None, target_customers=None, plan_id=None, recurring_charges=None, currency=None):  # noqa: E501
        """PlanVersionDetail - a model defined in Swagger"""  # noqa: E501
        self._created_on = None
        self._localized_name = None
        self._plan_name = None
        self._replace_with = None
        self._version = None
        self._alerts = None
        self._transition_to = None
        self._features = None
        self._active_subscriptions = None
        self._components = None
        self._status = None
        self._active_from = None
        self._active_to = None
        self._version_id = None
        self._price_adjustment = None
        self._target_customers = None
        self._plan_id = None
        self._recurring_charges = None
        self._currency = None
        self.discriminator = None
        self.created_on = created_on
        self.localized_name = localized_name
        self.plan_name = plan_name
        self.replace_with = replace_with
        self.version = version
        self.alerts = alerts
        self.transition_to = transition_to
        self.features = features
        self.active_subscriptions = active_subscriptions
        self.components = components
        self.status = status
        self.active_from = active_from
        self.active_to = active_to
        self.version_id = version_id
        self.price_adjustment = price_adjustment
        self.target_customers = target_customers
        self.plan_id = plan_id
        self.recurring_charges = recurring_charges
        self.currency = currency

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


        :return: The created_on of this PlanVersionDetail.  # noqa: E501
        :rtype: datetime
        """
        return self._created_on

    @created_on.setter
    def created_on(self, created_on):
        """Sets the created_on of this PlanVersionDetail.


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

        self._created_on = created_on

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


        :return: The localized_name of this PlanVersionDetail.  # noqa: E501
        :rtype: str
        """
        return self._localized_name

    @localized_name.setter
    def localized_name(self, localized_name):
        """Sets the localized_name of this PlanVersionDetail.


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

        self._localized_name = localized_name

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


        :return: The plan_name of this PlanVersionDetail.  # noqa: E501
        :rtype: str
        """
        return self._plan_name

    @plan_name.setter
    def plan_name(self, plan_name):
        """Sets the plan_name of this PlanVersionDetail.


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

        self._plan_name = plan_name

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


        :return: The replace_with of this PlanVersionDetail.  # noqa: E501
        :rtype: LightweightPlanVersion
        """
        return self._replace_with

    @replace_with.setter
    def replace_with(self, replace_with):
        """Sets the replace_with of this PlanVersionDetail.


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

        self._replace_with = replace_with

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


        :return: The version of this PlanVersionDetail.  # noqa: E501
        :rtype: OneOfPlanVersionDetailVersion
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this PlanVersionDetail.


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

        self._version = version

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


        :return: The alerts of this PlanVersionDetail.  # noqa: E501
        :rtype: list[UsageAlert]
        """
        return self._alerts

    @alerts.setter
    def alerts(self, alerts):
        """Sets the alerts of this PlanVersionDetail.


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

        self._alerts = alerts

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


        :return: The transition_to of this PlanVersionDetail.  # noqa: E501
        :rtype: LightweightPlan
        """
        return self._transition_to

    @transition_to.setter
    def transition_to(self, transition_to):
        """Sets the transition_to of this PlanVersionDetail.


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

        self._transition_to = transition_to

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


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

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


        :param features: The features of this PlanVersionDetail.  # 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 active_subscriptions(self):
        """Gets the active_subscriptions of this PlanVersionDetail.  # noqa: E501


        :return: The active_subscriptions of this PlanVersionDetail.  # noqa: E501
        :rtype: int
        """
        return self._active_subscriptions

    @active_subscriptions.setter
    def active_subscriptions(self, active_subscriptions):
        """Sets the active_subscriptions of this PlanVersionDetail.


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

        self._active_subscriptions = active_subscriptions

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


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

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


        :param components: The components of this PlanVersionDetail.  # 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 status(self):
        """Gets the status of this PlanVersionDetail.  # noqa: E501

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

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

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

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

        :param status: The status of this PlanVersionDetail.  # 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 active_from(self):
        """Gets the active_from of this PlanVersionDetail.  # noqa: E501


        :return: The active_from of this PlanVersionDetail.  # noqa: E501
        :rtype: datetime
        """
        return self._active_from

    @active_from.setter
    def active_from(self, active_from):
        """Sets the active_from of this PlanVersionDetail.


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

        self._active_from = active_from

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


        :return: The active_to of this PlanVersionDetail.  # noqa: E501
        :rtype: datetime
        """
        return self._active_to

    @active_to.setter
    def active_to(self, active_to):
        """Sets the active_to of this PlanVersionDetail.


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

        self._active_to = active_to

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


        :return: The version_id of this PlanVersionDetail.  # noqa: E501
        :rtype: str
        """
        return self._version_id

    @version_id.setter
    def version_id(self, version_id):
        """Sets the version_id of this PlanVersionDetail.


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

        self._version_id = version_id

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


        :return: The price_adjustment of this PlanVersionDetail.  # noqa: E501
        :rtype: AllOfPlanVersionDetailPriceAdjustment
        """
        return self._price_adjustment

    @price_adjustment.setter
    def price_adjustment(self, price_adjustment):
        """Sets the price_adjustment of this PlanVersionDetail.


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

        self._price_adjustment = price_adjustment

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


        :return: The target_customers of this PlanVersionDetail.  # noqa: E501
        :rtype: list[LightweightCustomer]
        """
        return self._target_customers

    @target_customers.setter
    def target_customers(self, target_customers):
        """Sets the target_customers of this PlanVersionDetail.


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

        self._target_customers = target_customers

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


        :return: The plan_id of this PlanVersionDetail.  # noqa: E501
        :rtype: str
        """
        return self._plan_id

    @plan_id.setter
    def plan_id(self, plan_id):
        """Sets the plan_id of this PlanVersionDetail.


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

        self._plan_id = plan_id

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


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

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


        :param recurring_charges: The recurring_charges of this PlanVersionDetail.  # 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 currency(self):
        """Gets the currency of this PlanVersionDetail.  # noqa: E501


        :return: The currency of this PlanVersionDetail.  # noqa: E501
        :rtype: PricingUnit
        """
        return self._currency

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


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

        self._currency = currency

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

        return self.__dict__ == other.__dict__

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