# coding: utf-8

"""
VolumeCache.py

 The Clear BSD License

 Copyright (c) – 2016, NetApp, Inc. All rights reserved.

 Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

 * Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

 NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

from pprint import pformat
from six import iteritems


class VolumeCache(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        VolumeCache - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'cwob': 'bool',  # (required parameter)
            'enterprise_cache_dump': 'bool',  # (required parameter)
            'mirror_active': 'bool',  # (required parameter)
            'mirror_enable': 'bool',  # (required parameter)
            'read_cache_active': 'bool',  # (required parameter)
            'read_cache_enable': 'bool',  # (required parameter)
            'write_cache_active': 'bool',  # (required parameter)
            'write_cache_enable': 'bool',  # (required parameter)
            'cache_flush_modifier': 'str',  # (required parameter)
            'read_ahead_multiplier': 'int'
        }

        self.attribute_map = {
            'cwob': 'cwob',  # (required parameter)
            'enterprise_cache_dump': 'enterpriseCacheDump',  # (required parameter)
            'mirror_active': 'mirrorActive',  # (required parameter)
            'mirror_enable': 'mirrorEnable',  # (required parameter)
            'read_cache_active': 'readCacheActive',  # (required parameter)
            'read_cache_enable': 'readCacheEnable',  # (required parameter)
            'write_cache_active': 'writeCacheActive',  # (required parameter)
            'write_cache_enable': 'writeCacheEnable',  # (required parameter)
            'cache_flush_modifier': 'cacheFlushModifier',  # (required parameter)
            'read_ahead_multiplier': 'readAheadMultiplier'
        }

        self._cwob = None
        self._enterprise_cache_dump = None
        self._mirror_active = None
        self._mirror_enable = None
        self._read_cache_active = None
        self._read_cache_enable = None
        self._write_cache_active = None
        self._write_cache_enable = None
        self._cache_flush_modifier = None
        self._read_ahead_multiplier = None

    @property
    def cwob(self):
        """
        Gets the cwob of this VolumeCache.
        A true value means that the controller is allowed to use write-back caching of dirty data even when the cache memory's battery-backup protection is not available or not operational. A false value means that any problems with the battery-backup protection of the write cache will cause the controller to suspend all write-back caching operations for the volume.

        :return: The cwob of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._cwob

    @cwob.setter
    def cwob(self, cwob):
        """
        Sets the cwob of this VolumeCache.
        A true value means that the controller is allowed to use write-back caching of dirty data even when the cache memory's battery-backup protection is not available or not operational. A false value means that any problems with the battery-backup protection of the write cache will cause the controller to suspend all write-back caching operations for the volume.

        :param cwob: The cwob of this VolumeCache.
        :type: bool
        """
        self._cwob = cwob

    @property
    def enterprise_cache_dump(self):
        """
        Gets the enterprise_cache_dump of this VolumeCache.
        A true value means that all dirty data in the write cache will be flushed immediately and further write-back caching will be disabled if the controller detects that a UPS unit has switched from standard power to battery backup. A false value means that write-back caching is not impacted by the state of the UPS.

        :return: The enterprise_cache_dump of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._enterprise_cache_dump

    @enterprise_cache_dump.setter
    def enterprise_cache_dump(self, enterprise_cache_dump):
        """
        Sets the enterprise_cache_dump of this VolumeCache.
        A true value means that all dirty data in the write cache will be flushed immediately and further write-back caching will be disabled if the controller detects that a UPS unit has switched from standard power to battery backup. A false value means that write-back caching is not impacted by the state of the UPS.

        :param enterprise_cache_dump: The enterprise_cache_dump of this VolumeCache.
        :type: bool
        """
        self._enterprise_cache_dump = enterprise_cache_dump

    @property
    def mirror_active(self):
        """
        Gets the mirror_active of this VolumeCache.
        An indication of whether the cache mirroring option is active for the volume's data.

        :return: The mirror_active of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._mirror_active

    @mirror_active.setter
    def mirror_active(self, mirror_active):
        """
        Sets the mirror_active of this VolumeCache.
        An indication of whether the cache mirroring option is active for the volume's data.

        :param mirror_active: The mirror_active of this VolumeCache.
        :type: bool
        """
        self._mirror_active = mirror_active

    @property
    def mirror_enable(self):
        """
        Gets the mirror_enable of this VolumeCache.
        An indication of whether the cache mirroring feature is currently enabled for this volume. It is possible that the mirrorEnable and mirrorActive values differ; this may occur, for example, if the alternate controller is removed or failed.

        :return: The mirror_enable of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._mirror_enable

    @mirror_enable.setter
    def mirror_enable(self, mirror_enable):
        """
        Sets the mirror_enable of this VolumeCache.
        An indication of whether the cache mirroring feature is currently enabled for this volume. It is possible that the mirrorEnable and mirrorActive values differ; this may occur, for example, if the alternate controller is removed or failed.

        :param mirror_enable: The mirror_enable of this VolumeCache.
        :type: bool
        """
        self._mirror_enable = mirror_enable

    @property
    def read_cache_active(self):
        """
        Gets the read_cache_active of this VolumeCache.
        An indication of whether read caching is active for the volume.

        :return: The read_cache_active of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._read_cache_active

    @read_cache_active.setter
    def read_cache_active(self, read_cache_active):
        """
        Sets the read_cache_active of this VolumeCache.
        An indication of whether read caching is active for the volume.

        :param read_cache_active: The read_cache_active of this VolumeCache.
        :type: bool
        """
        self._read_cache_active = read_cache_active

    @property
    def read_cache_enable(self):
        """
        Gets the read_cache_enable of this VolumeCache.
        An indication of whether read caching is enabled for the volume. Note that this value may not match the readCacheActive setting in cases where problems with the controller cache or its battery back-up have been detected.

        :return: The read_cache_enable of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._read_cache_enable

    @read_cache_enable.setter
    def read_cache_enable(self, read_cache_enable):
        """
        Sets the read_cache_enable of this VolumeCache.
        An indication of whether read caching is enabled for the volume. Note that this value may not match the readCacheActive setting in cases where problems with the controller cache or its battery back-up have been detected.

        :param read_cache_enable: The read_cache_enable of this VolumeCache.
        :type: bool
        """
        self._read_cache_enable = read_cache_enable

    @property
    def write_cache_active(self):
        """
        Gets the write_cache_active of this VolumeCache.
        An indication of whether write-back caching is active for the volume.

        :return: The write_cache_active of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._write_cache_active

    @write_cache_active.setter
    def write_cache_active(self, write_cache_active):
        """
        Sets the write_cache_active of this VolumeCache.
        An indication of whether write-back caching is active for the volume.

        :param write_cache_active: The write_cache_active of this VolumeCache.
        :type: bool
        """
        self._write_cache_active = write_cache_active

    @property
    def write_cache_enable(self):
        """
        Gets the write_cache_enable of this VolumeCache.
        An indication of whether write-back caching is enabled for the volume. Note that this value may not match the writeCacheActive setting in cases where problems with the controller cache or its battery back-up have been detected.

        :return: The write_cache_enable of this VolumeCache.
        :rtype: bool
        :required/optional: required
        """
        return self._write_cache_enable

    @write_cache_enable.setter
    def write_cache_enable(self, write_cache_enable):
        """
        Sets the write_cache_enable of this VolumeCache.
        An indication of whether write-back caching is enabled for the volume. Note that this value may not match the writeCacheActive setting in cases where problems with the controller cache or its battery back-up have been detected.

        :param write_cache_enable: The write_cache_enable of this VolumeCache.
        :type: bool
        """
        self._write_cache_enable = write_cache_enable

    @property
    def cache_flush_modifier(self):
        """
        Gets the cache_flush_modifier of this VolumeCache.
        The cache flush modifier value, which is used to specify the maximum amount of time that dirty data for this volume may be retained in the controller's write cache prior to being flushed to disk.

        :return: The cache_flush_modifier of this VolumeCache.
        :rtype: str
        :required/optional: required
        """
        return self._cache_flush_modifier

    @cache_flush_modifier.setter
    def cache_flush_modifier(self, cache_flush_modifier):
        """
        Sets the cache_flush_modifier of this VolumeCache.
        The cache flush modifier value, which is used to specify the maximum amount of time that dirty data for this volume may be retained in the controller's write cache prior to being flushed to disk.

        :param cache_flush_modifier: The cache_flush_modifier of this VolumeCache.
        :type: str
        """
        allowed_values = ["flushImmediate", "flush250Msec", "flush500Msec", "flush750Msec", "flush1Sec", "flush1500Msec", "flush2Sec", "flush5Sec", "flush10Sec", "flush20Sec", "flush60Sec", "flush120Sec", "flush300Sec", "flush1200Sec", "flush3600Sec", "flushInfinite", "__UNDEFINED"]
        if cache_flush_modifier not in allowed_values:
            raise ValueError(
                "Invalid value for `cache_flush_modifier`, must be one of {0}"
                .format(allowed_values)
            )
        self._cache_flush_modifier = cache_flush_modifier

    @property
    def read_ahead_multiplier(self):
        """
        Gets the read_ahead_multiplier of this VolumeCache.
        A true (non-zero) / false (zero) indicator of whether or not automatic cache read-ahead is enabled.

        :return: The read_ahead_multiplier of this VolumeCache.
        :rtype: int
        :required/optional: required
        """
        return self._read_ahead_multiplier

    @read_ahead_multiplier.setter
    def read_ahead_multiplier(self, read_ahead_multiplier):
        """
        Sets the read_ahead_multiplier of this VolumeCache.
        A true (non-zero) / false (zero) indicator of whether or not automatic cache read-ahead is enabled.

        :param read_ahead_multiplier: The read_ahead_multiplier of this VolumeCache.
        :type: int
        """
        self._read_ahead_multiplier = read_ahead_multiplier

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        if self is None:
           return None
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if self is None or other is None:
            return None
        return self.__dict__ == other.__dict__

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

