# 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 LifecycleRulePost(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 = {
        'bucket': 'Reference',
        'rule_id': 'str',
        'keep_previous_version_for': 'int',
        'prefix': 'str'
    }

    attribute_map = {
        'bucket': 'bucket',
        'rule_id': 'rule_id',
        'keep_previous_version_for': 'keep_previous_version_for',
        'prefix': 'prefix'
    }

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

        self._bucket = None
        self._rule_id = None
        self._keep_previous_version_for = None
        self._prefix = None
        self.discriminator = None

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

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

        The bucket name for lifecycle rule creation.  # noqa: E501

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

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

        The bucket name for lifecycle rule creation.  # noqa: E501

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

        self._bucket = bucket

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

        Identifier for the rule that is unique to the bucket that it applies to. Can have a maximum length of 255 characters. If not specified, an id unique to the bucket will be generated in the format `fbRuleId<number>` where number increments, starting at 1.  # noqa: E501

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

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

        Identifier for the rule that is unique to the bucket that it applies to. Can have a maximum length of 255 characters. If not specified, an id unique to the bucket will be generated in the format `fbRuleId<number>` where number increments, starting at 1.  # noqa: E501

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

        self._rule_id = rule_id

    @property
    def keep_previous_version_for(self):
        """Gets the keep_previous_version_for of this LifecycleRulePost.  # 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 LifecycleRulePost.  # 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 LifecycleRulePost.

        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 LifecycleRulePost.  # noqa: E501
        :type: int
        """
        if keep_previous_version_for is None:
            raise ValueError("Invalid value for `keep_previous_version_for`, must not be `None`")  # noqa: E501

        self._keep_previous_version_for = keep_previous_version_for

    @property
    def prefix(self):
        """Gets the prefix of this LifecycleRulePost.  # 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 LifecycleRulePost.  # noqa: E501
        :rtype: str
        """
        return self._prefix

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

        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 LifecycleRulePost.  # 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(LifecycleRulePost, 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, LifecycleRulePost):
            return False

        return self.__dict__ == other.__dict__

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