# coding: utf-8


"""
IGNORE:
    Nutanix Dataprotection Versioned APIs

    Business Continuity with full spectrum of Disaster Recovery and Backup solution. Spanning across Single PC, Cross AZ, MultiSite. Configuration of Recovery points, Protection policies, Recovery Plans. Execution and monitoring of back up and recovery orchestrations on OnPrem as well as Cloud.  # noqa: E501

    OpenAPI spec version: 4.0.1-alpha-4
    
    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_dataprotection_py_client.models.dataprotection.v4.config.HardwareArchitecture import HardwareArchitecture  # noqa: F401,E501
from ntnx_dataprotection_py_client.models.dataprotection.v4.config.HypervisorType import HypervisorType  # noqa: F401,E501
from ntnx_dataprotection_py_client.models.dataprotection.v4.config.PowerState import PowerState  # noqa: F401,E501

class Vm(object):

    """The configuration of the VM captured by the Recovery point.

    :param vm_ext_id: (:attr:`vm_ext_id`) VM external identifier which is captured as part of this Recovery point.
    :type vm_ext_id: 
    :param name: (:attr:`name`) The name of the VM that is captured as part of this Recovery point.
    :type name: 
    :param num_vcpus: (:attr:`num_vcpus`) Number of vCPUs.
    :type num_vcpus: 
    :param cores_per_vcpu: (:attr:`cores_per_vcpu`) Number of cores per vCPU.
    :type cores_per_vcpu: 
    :param vm_num_threads_per_core: (:attr:`vm_num_threads_per_core`) Docref(vmNumThreadsPerCoreDesc)
    :type vm_num_threads_per_core: 
    :param memory_size_bytes: (:attr:`memory_size_bytes`) Memory size in bytes.
    :type memory_size_bytes: 
    :param hypervisor_type: (:attr:`hypervisor_type`) 
    :type hypervisor_type: 
    :param power_state: (:attr:`power_state`) 
    :type power_state: 
    :param hardware_architecture: (:attr:`hardware_architecture`) 
    :type hardware_architecture: 

    """
    """
    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 = {
        'vm_ext_id': 'str',
        'name': 'str',
        'num_vcpus': 'int',
        'cores_per_vcpu': 'int',
        'vm_num_threads_per_core': 'int',
        'memory_size_bytes': 'int',
        'hypervisor_type': 'dataprotection.v4.config.HypervisorType',
        'power_state': 'dataprotection.v4.config.PowerState',
        'hardware_architecture': 'dataprotection.v4.config.HardwareArchitecture',
        '_reserved': 'dict(str, object)',
        '_object_type': 'str',
        '_unknown_fields': 'dict(str, object)',
    }

    attribute_map = {
        'vm_ext_id': 'vmExtId',
        'name': 'name',
        'num_vcpus': 'numVcpus',
        'cores_per_vcpu': 'coresPerVcpu',
        'vm_num_threads_per_core': 'vmNumThreadsPerCore',
        'memory_size_bytes': 'memorySizeBytes',
        'hypervisor_type': 'hypervisorType',
        'power_state': 'powerState',
        'hardware_architecture': 'hardwareArchitecture',
        '_reserved': '$reserved',
        '_object_type': '$objectType',
        '_unknown_fields': '$unknownFields',
    }



    def __init__(self, vm_ext_id=None, name=None, num_vcpus=None, cores_per_vcpu=None, vm_num_threads_per_core=None, memory_size_bytes=None, hypervisor_type=None, power_state=None, hardware_architecture=None, *args, **kwargs):  # noqa: E501
        self.__vm_ext_id = None
        self.__name = None
        self.__num_vcpus = None
        self.__cores_per_vcpu = None
        self.__vm_num_threads_per_core = None
        self.__memory_size_bytes = None
        self.__hypervisor_type = None
        self.__power_state = None
        self.__hardware_architecture = None
        self.discriminator = None
        if vm_ext_id is not None:
            self.__vm_ext_id = vm_ext_id
        if name is not None:
            self.__name = name
        if num_vcpus is not None:
            self.__num_vcpus = num_vcpus
        if cores_per_vcpu is not None:
            self.__cores_per_vcpu = cores_per_vcpu
        if vm_num_threads_per_core is not None:
            self.__vm_num_threads_per_core = vm_num_threads_per_core
        if memory_size_bytes is not None:
            self.__memory_size_bytes = memory_size_bytes
        if hypervisor_type is not None:
            self.__hypervisor_type = hypervisor_type
        if power_state is not None:
            self.__power_state = power_state
        if hardware_architecture is not None:
            self.__hardware_architecture = hardware_architecture
        # populate hidden vars if not empty
        self._populate_hidden_vars(kwargs)

    def _initialize_object_type(self):
        return 'dataprotection.v4.config.Vm'

    def _initialize_fq_object_type(self):
        return 'dataprotection.v4.r0.a4.config.Vm'

    def _populate_hidden_vars(self, kwargs):
        if "_reserved" in kwargs and kwargs["_reserved"] is not None:
            self.__dollar_reserved = kwargs["_reserved"]
        elif "_reserved" in self.attribute_map and self.attribute_map["_reserved"] in kwargs and kwargs[self.attribute_map["_reserved"]] is not None:
            self.__dollar_reserved = kwargs[self.attribute_map["_reserved"]]
        else :
            self.__dollar_reserved = {"$fqObjectType": self._initialize_fq_object_type()}
        if "_unknown_fields" in kwargs and kwargs["_unknown_fields"] is not None:
            self.__dollar_unknown_fields = kwargs["_unknown_fields"]
        elif "_unknown_fields" in self.attribute_map and self.attribute_map["_unknown_fields"] in kwargs and kwargs[self.attribute_map["_unknown_fields"]] is not None:
            self.__dollar_unknown_fields = kwargs[self.attribute_map["_unknown_fields"]]
        else :
            self.__dollar_unknown_fields = {}
        if "_object_type" in kwargs and kwargs["_object_type"] is not None:
            self.__dollar_object_type = kwargs["_object_type"]
        elif "_object_type" in self.attribute_map and self.attribute_map["_object_type"] in kwargs and kwargs[self.attribute_map["_object_type"]] is not None:
            self.__dollar_object_type = kwargs[self.attribute_map["_object_type"]]
        else:
            self.__dollar_object_type = self._initialize_object_type()

    def get_object_type(self):
        return self.__dollar_object_type

    def get_reserved(self):
        return self.__dollar_reserved

    def get_unknown_fields(self):
        return self.__dollar_unknown_fields

    @property
    def vm_ext_id(self):
        """
        VM external identifier which is captured as part of this Recovery point.

        :type:

                :class:`~str`
        """  # noqa: E501
        return self.__vm_ext_id

    @vm_ext_id.setter
    def vm_ext_id(self, vm_ext_id):
        if vm_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}$', vm_ext_id):  # noqa: E501
            raise ValueError(r"Invalid value for `vm_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.__vm_ext_id = vm_ext_id

    @property
    def name(self):
        """
        The name of the VM that is captured as part of this Recovery point.

        :type:

                :class:`~str`
        """  # noqa: E501
        return self.__name

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

        self.__name = name

    @property
    def num_vcpus(self):
        """
        Number of vCPUs.

        :type:

                :class:`~int`
        """  # noqa: E501
        return self.__num_vcpus

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

        self.__num_vcpus = num_vcpus

    @property
    def cores_per_vcpu(self):
        """
        Number of cores per vCPU.

        :type:

                :class:`~int`
        """  # noqa: E501
        return self.__cores_per_vcpu

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

        self.__cores_per_vcpu = cores_per_vcpu

    @property
    def vm_num_threads_per_core(self):
        """
        Docref(vmNumThreadsPerCoreDesc)

        :type:

                :class:`~int`
        """  # noqa: E501
        return self.__vm_num_threads_per_core

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

        self.__vm_num_threads_per_core = vm_num_threads_per_core

    @property
    def memory_size_bytes(self):
        """
        Memory size in bytes.

        :type:

                :class:`~int`
        """  # noqa: E501
        return self.__memory_size_bytes

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

        self.__memory_size_bytes = memory_size_bytes

    @property
    def hypervisor_type(self):
        """
        

        :type:
            :class:`~ntnx_dataprotection_py_client.models.dataprotection.v4.config.HypervisorType`
        """  # noqa: E501
        return self.__hypervisor_type

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

        self.__hypervisor_type = hypervisor_type

    @property
    def power_state(self):
        """
        

        :type:
            :class:`~ntnx_dataprotection_py_client.models.dataprotection.v4.config.PowerState`
        """  # noqa: E501
        return self.__power_state

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

        self.__power_state = power_state

    @property
    def hardware_architecture(self):
        """
        

        :type:
            :class:`~ntnx_dataprotection_py_client.models.dataprotection.v4.config.HardwareArchitecture`
        """  # noqa: E501
        return self.__hardware_architecture

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

        self.__hardware_architecture = hardware_architecture

    @property
    def _reserved(self):
        """
        

        :type:
            dict(str, :class:`~object`)
        """  # noqa: E501
        return self.__dollar_reserved

    @property
    def _object_type(self):
        """
        

        :type:

                :class:`~str`
        """  # noqa: E501
        return self.__dollar_object_type

    @property
    def _unknown_fields(self):
        """
        

        :type:
            dict(str, :class:`~object`)
        """  # noqa: E501
        return self.__dollar_unknown_fields

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

        :param sanitize: A flag to omit None properties if set to True
        :type sanitize: bool
        """

        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(Vm, dict):
            for key, value in six.iteritems(self):
                result[key] = value

        return result

    def to_dict(self):
        """Returns the model properties as a dictionary"""
        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, Vm):
            return False

        return self.__dict__ == other.__dict__

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

