# coding: utf-8


"""
IGNORE:
    Nutanix Storage Versioned APIs

    Manages volume groups and storage containers in Nutanix cluster.  # noqa: E501

    OpenAPI spec version: 4.0.2-alpha-3
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
IGNORE
"""
import pprint
import json
import ast
import re  # noqa: F401

import six
from ntnx_storage_py_client.Ntnx.common.v1.response.ApiLink import ApiLink  # noqa: F401,E501
from ntnx_storage_py_client.Ntnx.common.v1.response.ExternalizableAbstractModel import ExternalizableAbstractModel  # noqa: F401,E501

"""
IGNORE:
NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
IGNORE
"""


class DataStore(ExternalizableAbstractModel):
    """DataStore - a model defined in Swagger"""
    """
    IGNORE:
    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.
    IGNORE
    """ # noqa: E501
    swagger_types = {
        'datastore_name': 'str',
        'container_id': 'str',
        'container_ext_id': 'str',
        'container_name': 'str',
        'host_id': 'str',
        'host_ext_id': 'str',
        'host_ip_address': 'str',
        'capacity': 'int',
        'free_space': 'int',
        'vm_names': 'list[str]',
        'ext_id': 'str',
        'links': 'list[common.v1.response.ApiLink]',
        'tenant_id': 'str',
        '_reserved': 'dict(str, object)',
        '_object_type': 'str',
        '_unknown_fields': 'dict(str, object)',
    }

    attribute_map = {
        'datastore_name': 'datastoreName',
        'container_id': 'containerId',
        'container_ext_id': 'containerExtId',
        'container_name': 'containerName',
        'host_id': 'hostId',
        'host_ext_id': 'hostExtId',
        'host_ip_address': 'hostIpAddress',
        'capacity': 'capacity',
        'free_space': 'freeSpace',
        'vm_names': 'vmNames',
        'ext_id': 'extId',
        'links': 'links',
        'tenant_id': 'tenantId',
        '_reserved': '$reserved',
        '_object_type': '$objectType',
        '_unknown_fields': '$unknownFields',
    }



    def __init__(self, datastore_name=None, container_id=None, container_ext_id=None, container_name=None, host_id=None, host_ext_id=None, host_ip_address=None, capacity=None, free_space=None, vm_names=None, ext_id=None, links=None, tenant_id=None, *args, **kwargs):  # noqa: E501
        """DataStore - a model defined in Swagger
            
        """
        ExternalizableAbstractModel.__init__(self, ext_id, links, tenant_id, *args, **kwargs)
        self.__datastore_name = None
        self.__container_id = None
        self.__container_ext_id = None
        self.__container_name = None
        self.__host_id = None
        self.__host_ext_id = None
        self.__host_ip_address = None
        self.__capacity = None
        self.__free_space = None
        self.__vm_names = None
        self.discriminator = None
        if datastore_name is not None:
            self.__datastore_name = datastore_name
        if container_id is not None:
            self.__container_id = container_id
        if container_ext_id is not None:
            self.__container_ext_id = container_ext_id
        self.__container_name = container_name
        if host_id is not None:
            self.__host_id = host_id
        if host_ext_id is not None:
            self.__host_ext_id = host_ext_id
        if host_ip_address is not None:
            self.__host_ip_address = host_ip_address
        if capacity is not None:
            self.__capacity = capacity
        if free_space is not None:
            self.__free_space = free_space
        if vm_names is not None:
            self.__vm_names = vm_names

    def _initialize_object_type(self):
        return 'storage.v4.config.DataStore'

    def _initialize_fq_object_type(self):
        return 'storage.v4.r0.a3.config.DataStore'


    @property
    def datastore_name(self):
        """`{ str }`
            \nName of the datastore.
        """ # noqa: E501
        return self.__datastore_name

    @datastore_name.setter
    def datastore_name(self, datastore_name):
        if datastore_name is not None and len(datastore_name) > 255:
            raise ValueError("Invalid value for `datastore_name`, length must be less than or equal to `255`")  # noqa: E501

        self.__datastore_name = datastore_name

    @property
    def container_id(self):
        """`{ str }`
            \nId of the storage container instance.
        """ # noqa: E501
        return self.__container_id

    @container_id.setter
    def container_id(self, container_id):

        self.__container_id = container_id

    @property
    def container_ext_id(self):
        """`{ str }`
            \nUuid of the storage container.
        """ # noqa: E501
        return self.__container_ext_id

    @container_ext_id.setter
    def container_ext_id(self, container_ext_id):
        if container_ext_id is not None and not re.search('^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$', container_ext_id):  # noqa: E501
            raise ValueError(r"Invalid value for `container_ext_id`, must be a follow pattern or equal to `/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/`")  # noqa: E501

        self.__container_ext_id = container_ext_id

    @property
    def container_name(self):
        """`{ str }`
            \nName of the storage container.
        """ # noqa: E501
        return self.__container_name

    @container_name.setter
    def container_name(self, container_name):
        if container_name is None:
            raise ValueError("Invalid value for `container_name`, must not be `None`")  # noqa: E501
        if container_name is not None and len(container_name) > 255:
            raise ValueError("Invalid value for `container_name`, length must be less than or equal to `255`")  # noqa: E501

        self.__container_name = container_name

    @property
    def host_id(self):
        """`{ str }`
            \nUuid of the host for datastore.
        """ # noqa: E501
        return self.__host_id

    @host_id.setter
    def host_id(self, host_id):

        self.__host_id = host_id

    @property
    def host_ext_id(self):
        """`{ str }`
            \nUuid of the host for datastore.
        """ # noqa: E501
        return self.__host_ext_id

    @host_ext_id.setter
    def host_ext_id(self, host_ext_id):
        if host_ext_id is not None and not re.search('^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$', host_ext_id):  # noqa: E501
            raise ValueError(r"Invalid value for `host_ext_id`, must be a follow pattern or equal to `/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/`")  # noqa: E501

        self.__host_ext_id = host_ext_id

    @property
    def host_ip_address(self):
        """`{ str }`
            \nIp of the host for datastore.
        """ # noqa: E501
        return self.__host_ip_address

    @host_ip_address.setter
    def host_ip_address(self, host_ip_address):
        if host_ip_address is not None and not re.search('#\/components\/schemas\/common.v1.r0.a3.config.IPAddressOrFQDN', host_ip_address):  # noqa: E501
            raise ValueError(r"Invalid value for `host_ip_address`, must be a follow pattern or equal to `/#\/components\/schemas\/common.v1.r0.a3.config.IPAddressOrFQDN/`")  # noqa: E501

        self.__host_ip_address = host_ip_address

    @property
    def capacity(self):
        """`{ int }`
            \nMaximum capacity of the storage container.
        """ # noqa: E501
        return self.__capacity

    @capacity.setter
    def capacity(self, capacity):

        self.__capacity = capacity

    @property
    def free_space(self):
        """`{ int }`
            \nfreeSpace in the datastore.
        """ # noqa: E501
        return self.__free_space

    @free_space.setter
    def free_space(self, free_space):

        self.__free_space = free_space

    @property
    def vm_names(self):
        """`{ list[str] }`
            \nList of VMs name in the datastore.
        """ # noqa: E501
        return self.__vm_names

    @vm_names.setter
    def vm_names(self, vm_names):

        self.__vm_names = vm_names

    def _to_dict(self, sanitize):
        """
        Returns the model properties as a dict. Omits None properties based on the provided "sanitize" parameter.
        :param bool sanitize
        """

        result = {}

        for attr, attr_type in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x._to_dict(sanitize) if hasattr(x, "_to_dict") else x,
                    value
                ))
            elif hasattr(value, "_to_dict"):
                result[attr] = value._to_dict(sanitize)
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1]._to_dict(sanitize))
                    if hasattr(item[1], "_to_dict") else item,
                    six.iteritems(value)
                ))
            else:
                if sanitize:
                    if value is not None:
                        result[attr] = value
                else:
                    result[attr] = value
        if issubclass(DataStore, dict):
            for key, value in six.iteritems(self):
                result[key] = value

        return result

    def to_dict(self):
        """Returns the model properties as a dict"""
        return self._to_dict(False)

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

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

        return self.__dict__ == other.__dict__

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

