# 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 Plan(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 = {
        'plan_id': 'str',
        'plan_name': 'str',
        'plan_duration': 'str',
        'plan_description': 'str',
        'external_links': 'list[InitialExternalPlanLink]',
        'num_versions': 'int',
        'active_version': 'int',
        'active_subscriptions': 'int',
        'tags': 'list[str]',
        'versions': 'list[PlanVersion]',
        'parent_plan': 'AllOfPlanParentPlan',
        'target_customer': 'AllOfPlanTargetCustomer',
        'display_version': 'AllOfPlanDisplayVersion',
        'status': 'str'
    }

    attribute_map = {
        'plan_id': 'plan_id',
        'plan_name': 'plan_name',
        'plan_duration': 'plan_duration',
        'plan_description': 'plan_description',
        'external_links': 'external_links',
        'num_versions': 'num_versions',
        'active_version': 'active_version',
        'active_subscriptions': 'active_subscriptions',
        'tags': 'tags',
        'versions': 'versions',
        'parent_plan': 'parent_plan',
        'target_customer': 'target_customer',
        'display_version': 'display_version',
        'status': 'status'
    }

    def __init__(self, plan_id=None, plan_name=None, plan_duration=None, plan_description=None, external_links=None, num_versions=None, active_version=None, active_subscriptions=None, tags=None, versions=None, parent_plan=None, target_customer=None, display_version=None, status=None):  # noqa: E501
        """Plan - a model defined in Swagger"""  # noqa: E501
        self._plan_id = None
        self._plan_name = None
        self._plan_duration = None
        self._plan_description = None
        self._external_links = None
        self._num_versions = None
        self._active_version = None
        self._active_subscriptions = None
        self._tags = None
        self._versions = None
        self._parent_plan = None
        self._target_customer = None
        self._display_version = None
        self._status = None
        self.discriminator = None
        self.plan_id = plan_id
        self.plan_name = plan_name
        self.plan_duration = plan_duration
        self.plan_description = plan_description
        self.external_links = external_links
        self.num_versions = num_versions
        self.active_version = active_version
        self.active_subscriptions = active_subscriptions
        self.tags = tags
        self.versions = versions
        self.parent_plan = parent_plan
        self.target_customer = target_customer
        self.display_version = display_version
        self.status = status

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


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

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


        :param plan_id: The plan_id of this Plan.  # 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 plan_name(self):
        """Gets the plan_name of this Plan.  # noqa: E501

        Name of the plan  # noqa: E501

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

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

        Name of the plan  # noqa: E501

        :param plan_name: The plan_name of this Plan.  # 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 plan_duration(self):
        """Gets the plan_duration of this Plan.  # noqa: E501

        Duration of the plan  * `monthly` - Monthly * `quarterly` - Quarterly * `yearly` - Yearly  # noqa: E501

        :return: The plan_duration of this Plan.  # noqa: E501
        :rtype: str
        """
        return self._plan_duration

    @plan_duration.setter
    def plan_duration(self, plan_duration):
        """Sets the plan_duration of this Plan.

        Duration of the plan  * `monthly` - Monthly * `quarterly` - Quarterly * `yearly` - Yearly  # noqa: E501

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

        self._plan_duration = plan_duration

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

        Description of the plan  # noqa: E501

        :return: The plan_description of this Plan.  # noqa: E501
        :rtype: str
        """
        return self._plan_description

    @plan_description.setter
    def plan_description(self, plan_description):
        """Sets the plan_description of this Plan.

        Description of the plan  # noqa: E501

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

        self._plan_description = plan_description

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

        The external links that this plan has.  # noqa: E501

        :return: The external_links of this Plan.  # noqa: E501
        :rtype: list[InitialExternalPlanLink]
        """
        return self._external_links

    @external_links.setter
    def external_links(self, external_links):
        """Sets the external_links of this Plan.

        The external links that this plan has.  # noqa: E501

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

        self._external_links = external_links

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

        The number of versions that this plan has.  # noqa: E501

        :return: The num_versions of this Plan.  # noqa: E501
        :rtype: int
        """
        return self._num_versions

    @num_versions.setter
    def num_versions(self, num_versions):
        """Sets the num_versions of this Plan.

        The number of versions that this plan has.  # noqa: E501

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

        self._num_versions = num_versions

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

        This plan's currently active version.  # noqa: E501

        :return: The active_version of this Plan.  # noqa: E501
        :rtype: int
        """
        return self._active_version

    @active_version.setter
    def active_version(self, active_version):
        """Sets the active_version of this Plan.

        This plan's currently active version.  # noqa: E501

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

        self._active_version = active_version

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

        The number of active subscriptions that this plan has across all versions.  # noqa: E501

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

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

        The number of active subscriptions that this plan has across all versions.  # noqa: E501

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

        The tags that this plan has.  # noqa: E501

        :return: The tags of this Plan.  # noqa: E501
        :rtype: list[str]
        """
        return self._tags

    @tags.setter
    def tags(self, tags):
        """Sets the tags of this Plan.

        The tags that this plan has.  # noqa: E501

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

        self._tags = tags

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

        This plan's versions.  # noqa: E501

        :return: The versions of this Plan.  # noqa: E501
        :rtype: list[PlanVersion]
        """
        return self._versions

    @versions.setter
    def versions(self, versions):
        """Sets the versions of this Plan.

        This plan's versions.  # noqa: E501

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

        self._versions = versions

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

        [DEPRECATED] The parent plan that this plan has.  # noqa: E501

        :return: The parent_plan of this Plan.  # noqa: E501
        :rtype: AllOfPlanParentPlan
        """
        return self._parent_plan

    @parent_plan.setter
    def parent_plan(self, parent_plan):
        """Sets the parent_plan of this Plan.

        [DEPRECATED] The parent plan that this plan has.  # noqa: E501

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

        self._parent_plan = parent_plan

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

        [DEPRECATED] The target customer that this plan has.  # noqa: E501

        :return: The target_customer of this Plan.  # noqa: E501
        :rtype: AllOfPlanTargetCustomer
        """
        return self._target_customer

    @target_customer.setter
    def target_customer(self, target_customer):
        """Sets the target_customer of this Plan.

        [DEPRECATED] The target customer that this plan has.  # noqa: E501

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

        self._target_customer = target_customer

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

        [DEPRECATED] Display version has been deprecated. Use 'versions' instead. We will still return this field for now with some heuristics for figuring out what the desired version is, but it will be removed in the near future.  # noqa: E501

        :return: The display_version of this Plan.  # noqa: E501
        :rtype: AllOfPlanDisplayVersion
        """
        return self._display_version

    @display_version.setter
    def display_version(self, display_version):
        """Sets the display_version of this Plan.

        [DEPRECATED] Display version has been deprecated. Use 'versions' instead. We will still return this field for now with some heuristics for figuring out what the desired version is, but it will be removed in the near future.  # noqa: E501

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

        self._display_version = display_version

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

        [DEPRECATED] The status of this plan.  # noqa: E501

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

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

        [DEPRECATED] The status of this plan.  # noqa: E501

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

        self._status = status

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

        return self.__dict__ == other.__dict__

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