# coding: utf-8

"""
    CloudEndure API documentation

    © 2017 CloudEndure All rights reserved  # General Request authentication in CloudEndure's API is done using session cookies. A session cookie is returned upon successful execution of the \"login\" method. This value must then be provided within the request headers of all subsequent API requests.  ## Errors Some errors are not specifically written in every method since they may always return. Those are: 1) 401 (Unauthorized) - for unauthenticated requests. 2) 405 (Method Not Allowed) - for using a method that is not supported (POST instead of GET). 3) 403 (Forbidden) - request is authenticated, but the user is not allowed to access. 4) 422 (Unprocessable Entity) - for invalid input.  ## Formats All strings with date-time format are according to RFC3339.  All strings with \"duration\" format are according to ISO8601. For example, a full day duration can be specified with \"PNNNND\".   # noqa: E501

    OpenAPI spec version: 5
    Contact: https://bit.ly/2T54hSc
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

from cloudendure.cloudendure_api.models.cloud_endure_license_features import (  # noqa: F401,E501
    CloudEndureLicenseFeatures,
)


class CloudEndureLicense:
    """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 = {
        "count": "int",
        "duration_from_start_of_use": "str",
        "used": "int",
        "features": "CloudEndureLicenseFeatures",
        "expiration_date_time": "datetime",
        "ce_admin_properties": "object",
        "type": "str",
        "id": "str",
    }

    attribute_map = {
        "count": "count",
        "duration_from_start_of_use": "durationFromStartOfUse",
        "used": "used",
        "features": "features",
        "expiration_date_time": "expirationDateTime",
        "ce_admin_properties": "ceAdminProperties",
        "type": "type",
        "id": "id",
    }

    def __init__(
        self,
        count=None,
        duration_from_start_of_use=None,
        used=None,
        features=None,
        expiration_date_time=None,
        ce_admin_properties=None,
        type=None,
        id=None,
    ):  # noqa: E501
        """CloudEndureLicense - a model defined in Swagger"""  # noqa: E501
        self._count = None
        self._duration_from_start_of_use = None
        self._used = None
        self._features = None
        self._expiration_date_time = None
        self._ce_admin_properties = None
        self._type = None
        self._id = None
        self.discriminator = None
        if count is not None:
            self.count = count
        if duration_from_start_of_use is not None:
            self.duration_from_start_of_use = duration_from_start_of_use
        if used is not None:
            self.used = used
        if features is not None:
            self.features = features
        if expiration_date_time is not None:
            self.expiration_date_time = expiration_date_time
        if ce_admin_properties is not None:
            self.ce_admin_properties = ce_admin_properties
        if type is not None:
            self.type = type
        if id is not None:
            self.id = id

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

        The total number of licenses.  # noqa: E501

        :return: The count of this CloudEndureLicense.  # noqa: E501
        :rtype: int
        """
        return self._count

    @count.setter
    def count(self, count):
        """Sets the count of this CloudEndureLicense.

        The total number of licenses.  # noqa: E501

        :param count: The count of this CloudEndureLicense.  # noqa: E501
        :type: int
        """

        self._count = count

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

        Validity period for a a single license from the time of agent installation.  # noqa: E501

        :return: The duration_from_start_of_use of this CloudEndureLicense.  # noqa: E501
        :rtype: str
        """
        return self._duration_from_start_of_use

    @duration_from_start_of_use.setter
    def duration_from_start_of_use(self, duration_from_start_of_use):
        """Sets the duration_from_start_of_use of this CloudEndureLicense.

        Validity period for a a single license from the time of agent installation.  # noqa: E501

        :param duration_from_start_of_use: The duration_from_start_of_use of this CloudEndureLicense.  # noqa: E501
        :type: str
        """

        self._duration_from_start_of_use = duration_from_start_of_use

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

        How many licenses have already been consumed.  # noqa: E501

        :return: The used of this CloudEndureLicense.  # noqa: E501
        :rtype: int
        """
        return self._used

    @used.setter
    def used(self, used):
        """Sets the used of this CloudEndureLicense.

        How many licenses have already been consumed.  # noqa: E501

        :param used: The used of this CloudEndureLicense.  # noqa: E501
        :type: int
        """

        self._used = used

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


        :return: The features of this CloudEndureLicense.  # noqa: E501
        :rtype: CloudEndureLicenseFeatures
        """
        return self._features

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


        :param features: The features of this CloudEndureLicense.  # noqa: E501
        :type: CloudEndureLicenseFeatures
        """

        self._features = features

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


        :return: The expiration_date_time of this CloudEndureLicense.  # noqa: E501
        :rtype: datetime
        """
        return self._expiration_date_time

    @expiration_date_time.setter
    def expiration_date_time(self, expiration_date_time):
        """Sets the expiration_date_time of this CloudEndureLicense.


        :param expiration_date_time: The expiration_date_time of this CloudEndureLicense.  # noqa: E501
        :type: datetime
        """

        self._expiration_date_time = expiration_date_time

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

        For internal use.  # noqa: E501

        :return: The ce_admin_properties of this CloudEndureLicense.  # noqa: E501
        :rtype: object
        """
        return self._ce_admin_properties

    @ce_admin_properties.setter
    def ce_admin_properties(self, ce_admin_properties):
        """Sets the ce_admin_properties of this CloudEndureLicense.

        For internal use.  # noqa: E501

        :param ce_admin_properties: The ce_admin_properties of this CloudEndureLicense.  # noqa: E501
        :type: object
        """

        self._ce_admin_properties = ce_admin_properties

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

        License type. DR licenses can be moved from one machine to another. Migration licenses are consumed upon installation.  # noqa: E501

        :return: The type of this CloudEndureLicense.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this CloudEndureLicense.

        License type. DR licenses can be moved from one machine to another. Migration licenses are consumed upon installation.  # noqa: E501

        :param type: The type of this CloudEndureLicense.  # noqa: E501
        :type: str
        """
        allowed_values = ["MIGRATION", "DR", "BACKUP", "DR_TRIAL"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}".format(  # noqa: E501
                    type, allowed_values
                )
            )

        self._type = type

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


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

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


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

        self._id = id

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

        return self.__dict__ == other.__dict__

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