# coding: utf-8

"""
    Paragon Insights APIs

    API interface for PI application  # noqa: E501

    OpenAPI spec version: 4.0.0
    Contact: healthbot-feedback@juniper.net
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class RetentionPolicySchema(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 = {
        'duration': 'str',
        'replication': 'int',
        'retention_policy_name': 'str'
    }

    attribute_map = {
        'duration': 'duration',
        'replication': 'replication',
        'retention_policy_name': 'retention-policy-name'
    }

    def __init__(self, duration=None, replication=None, retention_policy_name=None):  # noqa: E501
        """RetentionPolicySchema - a model defined in Swagger"""  # noqa: E501

        self._duration = None
        self._replication = None
        self._retention_policy_name = None
        self.discriminator = None

        if duration is not None:
            self.duration = duration
        if replication is not None:
            self.replication = replication
        self.retention_policy_name = retention_policy_name

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

        Schedule duration in days or hours, Should be of pattern [1-9][0-9]*[dh]  # noqa: E501

        :return: The duration of this RetentionPolicySchema.  # noqa: E501
        :rtype: str
        """
        return self._duration

    @duration.setter
    def duration(self, duration):
        """Sets the duration of this RetentionPolicySchema.

        Schedule duration in days or hours, Should be of pattern [1-9][0-9]*[dh]  # noqa: E501

        :param duration: The duration of this RetentionPolicySchema.  # noqa: E501
        :type: str
        """
        if duration is not None and not re.search(r'^[1-9][0-9]*[dh]$', duration):  # noqa: E501
            raise ValueError(r"Invalid value for `duration`, must be a follow pattern or equal to `/^[1-9][0-9]*[dh]$/`")  # noqa: E501

        self._duration = duration

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

        Number of independent copies if stored in the cluster  # noqa: E501

        :return: The replication of this RetentionPolicySchema.  # noqa: E501
        :rtype: int
        """
        return self._replication

    @replication.setter
    def replication(self, replication):
        """Sets the replication of this RetentionPolicySchema.

        Number of independent copies if stored in the cluster  # noqa: E501

        :param replication: The replication of this RetentionPolicySchema.  # noqa: E501
        :type: int
        """

        self._replication = replication

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

        Name of the retention-policy. Should be of pattern [a-zA-Z][a-zA-Z0-9_-]*  # noqa: E501

        :return: The retention_policy_name of this RetentionPolicySchema.  # noqa: E501
        :rtype: str
        """
        return self._retention_policy_name

    @retention_policy_name.setter
    def retention_policy_name(self, retention_policy_name):
        """Sets the retention_policy_name of this RetentionPolicySchema.

        Name of the retention-policy. Should be of pattern [a-zA-Z][a-zA-Z0-9_-]*  # noqa: E501

        :param retention_policy_name: The retention_policy_name of this RetentionPolicySchema.  # noqa: E501
        :type: str
        """
        if retention_policy_name is None:
            raise ValueError("Invalid value for `retention_policy_name`, must not be `None`")  # noqa: E501
        if retention_policy_name is not None and len(retention_policy_name) > 64:
            raise ValueError("Invalid value for `retention_policy_name`, length must be less than or equal to `64`")  # noqa: E501
        if retention_policy_name is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9_-]*$', retention_policy_name):  # noqa: E501
            raise ValueError(r"Invalid value for `retention_policy_name`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9_-]*$/`")  # noqa: E501

        self._retention_policy_name = retention_policy_name

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

        return self.__dict__ == other.__dict__

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