# coding: utf-8

"""
    Zadara VPSA Storage Array REST API

     # Overview  This document outlines the methods available for administrating your Zadara Storage VPSA&#8482;. The Zadara Storage Array REST API   supports form-encoded, JSON, and XML requests, and can return either JSON or XML responses.  ## Usage  The majority of the APIs available require authentication which requires an API token to use. You can retrieve this token through the   Users section of your VPSA, or through the API using the \"Return a user's access key\" API in the Users Section below.  ## Authentication Methods  The authentication token can be passed either through the access_key parameter inside of the body of the REST API request, or   through the X-Access-Key header.  ## Timeouts  By default, all operations that don't complete within five seconds will return a message informing you that the action may take some  time to complete. When using the API, this can cause some actions, such as large volume creation, to be undesirably asynchronous.  You can specify your own timeout with the timeout parameter, in seconds, and a timeout value of -1 specifies an infinite timeout.  ## Specific Fields For Product  Some of the fields/actions used in the API should be used only for a specific product. The following tags are used to mark which   product responds to the fields/actions  VPSA Flash Array  VPSA Storage Array - Hybrid VPSA  ## Questions  If you have any questions or need support involving the REST API, please contact for assistance.   # noqa: E501

    OpenAPI spec version: 23.03-sp1
    Contact: support@zadarastorage.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from Vpsa.configuration import Configuration


class CreatePool(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 = {
        'display_name': 'str',
        'capacity': 'str',
        'cache': 'str',
        'cowcache': 'bool',
        'mode': 'str',
        'raid_groups': 'str',
        'pooltype': 'str'
    }

    attribute_map = {
        'display_name': 'display_name',
        'capacity': 'capacity',
        'cache': 'cache',
        'cowcache': 'cowcache',
        'mode': 'mode',
        'raid_groups': 'raid_groups',
        'pooltype': 'pooltype'
    }

    def __init__(self, display_name=None, capacity=None, cache='NO', cowcache=True, mode='simple', raid_groups=None, pooltype=None, _configuration=None):  # noqa: E501
        """CreatePool - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._display_name = None
        self._capacity = None
        self._cache = None
        self._cowcache = None
        self._mode = None
        self._raid_groups = None
        self._pooltype = None
        self.discriminator = None

        self.display_name = display_name
        self.capacity = capacity
        if cache is not None:
            self.cache = cache
        if cowcache is not None:
            self.cowcache = cowcache
        if mode is not None:
            self.mode = mode
        self.raid_groups = raid_groups
        if pooltype is not None:
            self.pooltype = pooltype

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

        The new pool display name  # noqa: E501

        :return: The display_name of this CreatePool.  # noqa: E501
        :rtype: str
        """
        return self._display_name

    @display_name.setter
    def display_name(self, display_name):
        """Sets the display_name of this CreatePool.

        The new pool display name  # noqa: E501

        :param display_name: The display_name of this CreatePool.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and display_name is None:
            raise ValueError("Invalid value for `display_name`, must not be `None`")  # noqa: E501

        self._display_name = display_name

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

        The new pool capacity followed by the letter G  # noqa: E501

        :return: The capacity of this CreatePool.  # noqa: E501
        :rtype: str
        """
        return self._capacity

    @capacity.setter
    def capacity(self, capacity):
        """Sets the capacity of this CreatePool.

        The new pool capacity followed by the letter G  # noqa: E501

        :param capacity: The capacity of this CreatePool.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and capacity is None:
            raise ValueError("Invalid value for `capacity`, must not be `None`")  # noqa: E501

        self._capacity = capacity

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

        Indicate whether the Pool will utilize the VPSA SSD cache. All Pools marked YES share the same cache capacity.  # noqa: E501

        :return: The cache of this CreatePool.  # noqa: E501
        :rtype: str
        """
        return self._cache

    @cache.setter
    def cache(self, cache):
        """Sets the cache of this CreatePool.

        Indicate whether the Pool will utilize the VPSA SSD cache. All Pools marked YES share the same cache capacity.  # noqa: E501

        :param cache: The cache of this CreatePool.  # noqa: E501
        :type: str
        """
        allowed_values = ["YES", "NO"]  # noqa: E501
        if (self._configuration.client_side_validation and
                cache not in allowed_values):
            raise ValueError(
                "Invalid value for `cache` ({0}), must be one of {1}"  # noqa: E501
                .format(cache, allowed_values)
            )

        self._cache = cache

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

        Indicate whether snapshot Copy-On-Write operations are Cached. Default: YES  # noqa: E501

        :return: The cowcache of this CreatePool.  # noqa: E501
        :rtype: bool
        """
        return self._cowcache

    @cowcache.setter
    def cowcache(self, cowcache):
        """Sets the cowcache of this CreatePool.

        Indicate whether snapshot Copy-On-Write operations are Cached. Default: YES  # noqa: E501

        :param cowcache: The cowcache of this CreatePool.  # noqa: E501
        :type: bool
        """

        self._cowcache = cowcache

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

        Indicate whether RAID groups are concatinated or striped inside the Pool.  # noqa: E501

        :return: The mode of this CreatePool.  # noqa: E501
        :rtype: str
        """
        return self._mode

    @mode.setter
    def mode(self, mode):
        """Sets the mode of this CreatePool.

        Indicate whether RAID groups are concatinated or striped inside the Pool.  # noqa: E501

        :param mode: The mode of this CreatePool.  # noqa: E501
        :type: str
        """
        allowed_values = ["stripe", "simple"]  # noqa: E501
        if (self._configuration.client_side_validation and
                mode not in allowed_values):
            raise ValueError(
                "Invalid value for `mode` ({0}), must be one of {1}"  # noqa: E501
                .format(mode, allowed_values)
            )

        self._mode = mode

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

        Comma separated list of RAID Group IDs.  # noqa: E501

        :return: The raid_groups of this CreatePool.  # noqa: E501
        :rtype: str
        """
        return self._raid_groups

    @raid_groups.setter
    def raid_groups(self, raid_groups):
        """Sets the raid_groups of this CreatePool.

        Comma separated list of RAID Group IDs.  # noqa: E501

        :param raid_groups: The raid_groups of this CreatePool.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and raid_groups is None:
            raise ValueError("Invalid value for `raid_groups`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                raid_groups is not None and not re.search(r'(?:RaidGroup-[0-9]+[,]?)+', raid_groups)):  # noqa: E501
            raise ValueError(r"Invalid value for `raid_groups`, must be a follow pattern or equal to `/(?:RaidGroup-[0-9]+[,]?)+/`")  # noqa: E501

        self._raid_groups = raid_groups

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

        The new pool type. VPSA Storage Array: Repository Storage, Transactional Workloads, Archival Storage, Depot Storage. VPSA Flash Array: IOPs-Optimized, Balanced, Throughput-Optimized.  # noqa: E501

        :return: The pooltype of this CreatePool.  # noqa: E501
        :rtype: str
        """
        return self._pooltype

    @pooltype.setter
    def pooltype(self, pooltype):
        """Sets the pooltype of this CreatePool.

        The new pool type. VPSA Storage Array: Repository Storage, Transactional Workloads, Archival Storage, Depot Storage. VPSA Flash Array: IOPs-Optimized, Balanced, Throughput-Optimized.  # noqa: E501

        :param pooltype: The pooltype of this CreatePool.  # noqa: E501
        :type: str
        """
        allowed_values = ["Transactional Workloads", "Repository Storage", "Archival Storage", "IOPs-Optimized", "Balanced", "Throughput-Optimized", "Depot", "Depot Storage"]  # noqa: E501
        if (self._configuration.client_side_validation and
                pooltype not in allowed_values):
            raise ValueError(
                "Invalid value for `pooltype` ({0}), must be one of {1}"  # noqa: E501
                .format(pooltype, allowed_values)
            )

        self._pooltype = pooltype

    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(CreatePool, 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, CreatePool):
            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, CreatePool):
            return True

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