# coding: utf-8

"""
    Pure Storage FlashBlade REST 1.12 Python SDK

    Pure Storage FlashBlade REST 1.12 Python SDK. Compatible with REST API versions 1.0 - 1.12. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).

    OpenAPI spec version: 1.12
    Contact: info@purestorage.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class LifecycleRule(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

#BEGIN_CUSTOM
    # IR-51527: Prevent Pytest from attempting to collect this class based on name.
    __test__ = False
#END_CUSTOM

    """
    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 = {
        'id': 'str',
        'name': 'str',
        'bucket': 'Reference',
        'enabled': 'bool',
        'rule_id': 'str',
        'keep_previous_version_for': 'int',
        'prefix': 'str'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'bucket': 'bucket',
        'enabled': 'enabled',
        'rule_id': 'rule_id',
        'keep_previous_version_for': 'keep_previous_version_for',
        'prefix': 'prefix'
    }

    def __init__(self, id=None, name=None, bucket=None, enabled=None, rule_id=None, keep_previous_version_for=None, prefix=None):  # noqa: E501
        """LifecycleRule - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._name = None
        self._bucket = None
        self._enabled = None
        self._rule_id = None
        self._keep_previous_version_for = None
        self._prefix = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if bucket is not None:
            self.bucket = bucket
        if enabled is not None:
            self.enabled = enabled
        if rule_id is not None:
            self.rule_id = rule_id
        if keep_previous_version_for is not None:
            self.keep_previous_version_for = keep_previous_version_for
        if prefix is not None:
            self.prefix = prefix

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

        A non-modifiable, globally unique ID chosen by the system.  # noqa: E501

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

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

        A non-modifiable, globally unique ID chosen by the system.  # noqa: E501

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

        self._id = id

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

        The name of the object (e.g., a file system or snapshot).  # noqa: E501

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

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

        The name of the object (e.g., a file system or snapshot).  # noqa: E501

        :param name: The name of this LifecycleRule.  # noqa: E501
        :type: str
        """

        self._name = name

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

        The bucket which this lifecycle rule is targeting.  # noqa: E501

        :return: The bucket of this LifecycleRule.  # noqa: E501
        :rtype: Reference
        """
        return self._bucket

    @bucket.setter
    def bucket(self, bucket):
        """Sets the bucket of this LifecycleRule.

        The bucket which this lifecycle rule is targeting.  # noqa: E501

        :param bucket: The bucket of this LifecycleRule.  # noqa: E501
        :type: Reference
        """

        self._bucket = bucket

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

        If set to `true`, this rule will be enabled.  # noqa: E501

        :return: The enabled of this LifecycleRule.  # noqa: E501
        :rtype: bool
        """
        return self._enabled

    @enabled.setter
    def enabled(self, enabled):
        """Sets the enabled of this LifecycleRule.

        If set to `true`, this rule will be enabled.  # noqa: E501

        :param enabled: The enabled of this LifecycleRule.  # noqa: E501
        :type: bool
        """

        self._enabled = enabled

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

        Unique identifier for the rule. Can have a maximum length of 255 characters.  # noqa: E501

        :return: The rule_id of this LifecycleRule.  # noqa: E501
        :rtype: str
        """
        return self._rule_id

    @rule_id.setter
    def rule_id(self, rule_id):
        """Sets the rule_id of this LifecycleRule.

        Unique identifier for the rule. Can have a maximum length of 255 characters.  # noqa: E501

        :param rule_id: The rule_id of this LifecycleRule.  # noqa: E501
        :type: str
        """

        self._rule_id = rule_id

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

        Time after which previous versions will be marked expired. Measured in milliseconds. Must be a multiple of 86400000 to represent a whole number of days.  # noqa: E501

        :return: The keep_previous_version_for of this LifecycleRule.  # noqa: E501
        :rtype: int
        """
        return self._keep_previous_version_for

    @keep_previous_version_for.setter
    def keep_previous_version_for(self, keep_previous_version_for):
        """Sets the keep_previous_version_for of this LifecycleRule.

        Time after which previous versions will be marked expired. Measured in milliseconds. Must be a multiple of 86400000 to represent a whole number of days.  # noqa: E501

        :param keep_previous_version_for: The keep_previous_version_for of this LifecycleRule.  # noqa: E501
        :type: int
        """

        self._keep_previous_version_for = keep_previous_version_for

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

        Object key prefix identifying one or more objects in the bucket. Can have a maximum length of 1024 characters.  # noqa: E501

        :return: The prefix of this LifecycleRule.  # noqa: E501
        :rtype: str
        """
        return self._prefix

    @prefix.setter
    def prefix(self, prefix):
        """Sets the prefix of this LifecycleRule.

        Object key prefix identifying one or more objects in the bucket. Can have a maximum length of 1024 characters.  # noqa: E501

        :param prefix: The prefix of this LifecycleRule.  # noqa: E501
        :type: str
        """

        self._prefix = prefix

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

        return self.__dict__ == other.__dict__

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