# 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 RollupsummarizationSchemaDatarolluporder(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 = {
        'instance_id': 'str',
        'interval': 'str',
        'retention_policy': 'str'
    }

    attribute_map = {
        'instance_id': 'instance-id',
        'interval': 'interval',
        'retention_policy': 'retention-policy'
    }

    def __init__(self, instance_id=None, interval=None, retention_policy=None):  # noqa: E501
        """RollupsummarizationSchemaDatarolluporder - a model defined in Swagger"""  # noqa: E501

        self._instance_id = None
        self._interval = None
        self._retention_policy = None
        self.discriminator = None

        self.instance_id = instance_id
        self.interval = interval
        if retention_policy is not None:
            self.retention_policy = retention_policy

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

        Instance-id/aggregation-id of data rollup summarization instance. Should be of pattern [a-zA-Z][a-zA-Z0-9_-]*  # noqa: E501

        :return: The instance_id of this RollupsummarizationSchemaDatarolluporder.  # noqa: E501
        :rtype: str
        """
        return self._instance_id

    @instance_id.setter
    def instance_id(self, instance_id):
        """Sets the instance_id of this RollupsummarizationSchemaDatarolluporder.

        Instance-id/aggregation-id of data rollup summarization instance. Should be of pattern [a-zA-Z][a-zA-Z0-9_-]*  # noqa: E501

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

        self._instance_id = instance_id

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

        Time interval for the data roll up to occur( m/h/d/w representing minutes/hours/days/weeks. Min value: 30m, Max value: 52w )   # noqa: E501

        :return: The interval of this RollupsummarizationSchemaDatarolluporder.  # noqa: E501
        :rtype: str
        """
        return self._interval

    @interval.setter
    def interval(self, interval):
        """Sets the interval of this RollupsummarizationSchemaDatarolluporder.

        Time interval for the data roll up to occur( m/h/d/w representing minutes/hours/days/weeks. Min value: 30m, Max value: 52w )   # noqa: E501

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

        self._interval = interval

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

        Retention policy for the data-rollup instance. If not configured, default retention policy will be considered  # noqa: E501

        :return: The retention_policy of this RollupsummarizationSchemaDatarolluporder.  # noqa: E501
        :rtype: str
        """
        return self._retention_policy

    @retention_policy.setter
    def retention_policy(self, retention_policy):
        """Sets the retention_policy of this RollupsummarizationSchemaDatarolluporder.

        Retention policy for the data-rollup instance. If not configured, default retention policy will be considered  # noqa: E501

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

        self._retention_policy = retention_policy

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

        return self.__dict__ == other.__dict__

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