# coding: utf-8

"""
    fluid

    client for fluid  # noqa: E501

    The version of the OpenAPI document: v0.1
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from fluid.configuration import Configuration


class CleanCachePolicy(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'grace_period_seconds': 'int',
        'max_retry_attempts': 'int'
    }

    attribute_map = {
        'grace_period_seconds': 'gracePeriodSeconds',
        'max_retry_attempts': 'maxRetryAttempts'
    }

    def __init__(self, grace_period_seconds=None, max_retry_attempts=None, local_vars_configuration=None):  # noqa: E501
        """CleanCachePolicy - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._grace_period_seconds = None
        self._max_retry_attempts = None
        self.discriminator = None

        if grace_period_seconds is not None:
            self.grace_period_seconds = grace_period_seconds
        if max_retry_attempts is not None:
            self.max_retry_attempts = max_retry_attempts

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

        Optional duration in seconds the cache needs to clean gracefully. May be decreased in delete runtime request. Value must be non-negative integer. The value zero indicates clean immediately via the timeout command (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with timeout command. Set this value longer than the expected cleanup time for your process.  # noqa: E501

        :return: The grace_period_seconds of this CleanCachePolicy.  # noqa: E501
        :rtype: int
        """
        return self._grace_period_seconds

    @grace_period_seconds.setter
    def grace_period_seconds(self, grace_period_seconds):
        """Sets the grace_period_seconds of this CleanCachePolicy.

        Optional duration in seconds the cache needs to clean gracefully. May be decreased in delete runtime request. Value must be non-negative integer. The value zero indicates clean immediately via the timeout command (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with timeout command. Set this value longer than the expected cleanup time for your process.  # noqa: E501

        :param grace_period_seconds: The grace_period_seconds of this CleanCachePolicy.  # noqa: E501
        :type: int
        """

        self._grace_period_seconds = grace_period_seconds

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

        Optional max retry Attempts when cleanCache function returns an error after execution, runtime attempts to run it three more times by default. With Maximum Retry Attempts, you can customize the maximum number of retries. This gives you the option to continue processing retries.  # noqa: E501

        :return: The max_retry_attempts of this CleanCachePolicy.  # noqa: E501
        :rtype: int
        """
        return self._max_retry_attempts

    @max_retry_attempts.setter
    def max_retry_attempts(self, max_retry_attempts):
        """Sets the max_retry_attempts of this CleanCachePolicy.

        Optional max retry Attempts when cleanCache function returns an error after execution, runtime attempts to run it three more times by default. With Maximum Retry Attempts, you can customize the maximum number of retries. This gives you the option to continue processing retries.  # noqa: E501

        :param max_retry_attempts: The max_retry_attempts of this CleanCachePolicy.  # noqa: E501
        :type: int
        """

        self._max_retry_attempts = max_retry_attempts

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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

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

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
