# coding: utf-8

"""
    KubeVirt API

    This is KubeVirt API an add-on for Kubernetes.  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: kubevirt-dev@googlegroups.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from kubevirt.configuration import Configuration


class V1beta1CPUInstancetype(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 = {
        'dedicated_cpu_placement': 'bool',
        'guest': 'int',
        'isolate_emulator_thread': 'bool',
        'max_sockets': 'int',
        'model': 'str',
        'numa': 'V1NUMA',
        'realtime': 'V1Realtime'
    }

    attribute_map = {
        'dedicated_cpu_placement': 'dedicatedCPUPlacement',
        'guest': 'guest',
        'isolate_emulator_thread': 'isolateEmulatorThread',
        'max_sockets': 'maxSockets',
        'model': 'model',
        'numa': 'numa',
        'realtime': 'realtime'
    }

    def __init__(self, dedicated_cpu_placement=None, guest=0, isolate_emulator_thread=None, max_sockets=None, model=None, numa=None, realtime=None, _configuration=None):  # noqa: E501
        """V1beta1CPUInstancetype - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._dedicated_cpu_placement = None
        self._guest = None
        self._isolate_emulator_thread = None
        self._max_sockets = None
        self._model = None
        self._numa = None
        self._realtime = None
        self.discriminator = None

        if dedicated_cpu_placement is not None:
            self.dedicated_cpu_placement = dedicated_cpu_placement
        self.guest = guest
        if isolate_emulator_thread is not None:
            self.isolate_emulator_thread = isolate_emulator_thread
        if max_sockets is not None:
            self.max_sockets = max_sockets
        if model is not None:
            self.model = model
        if numa is not None:
            self.numa = numa
        if realtime is not None:
            self.realtime = realtime

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

        DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.  # noqa: E501

        :return: The dedicated_cpu_placement of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: bool
        """
        return self._dedicated_cpu_placement

    @dedicated_cpu_placement.setter
    def dedicated_cpu_placement(self, dedicated_cpu_placement):
        """Sets the dedicated_cpu_placement of this V1beta1CPUInstancetype.

        DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.  # noqa: E501

        :param dedicated_cpu_placement: The dedicated_cpu_placement of this V1beta1CPUInstancetype.  # noqa: E501
        :type: bool
        """

        self._dedicated_cpu_placement = dedicated_cpu_placement

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

        Required number of vCPUs to expose to the guest.  The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets.  # noqa: E501

        :return: The guest of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: int
        """
        return self._guest

    @guest.setter
    def guest(self, guest):
        """Sets the guest of this V1beta1CPUInstancetype.

        Required number of vCPUs to expose to the guest.  The resulting CPU topology being derived from the optional PreferredCPUTopology attribute of CPUPreferences that itself defaults to PreferSockets.  # noqa: E501

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

        self._guest = guest

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

        IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.  # noqa: E501

        :return: The isolate_emulator_thread of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: bool
        """
        return self._isolate_emulator_thread

    @isolate_emulator_thread.setter
    def isolate_emulator_thread(self, isolate_emulator_thread):
        """Sets the isolate_emulator_thread of this V1beta1CPUInstancetype.

        IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.  # noqa: E501

        :param isolate_emulator_thread: The isolate_emulator_thread of this V1beta1CPUInstancetype.  # noqa: E501
        :type: bool
        """

        self._isolate_emulator_thread = isolate_emulator_thread

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

        MaxSockets specifies the maximum amount of sockets that can be hotplugged  # noqa: E501

        :return: The max_sockets of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: int
        """
        return self._max_sockets

    @max_sockets.setter
    def max_sockets(self, max_sockets):
        """Sets the max_sockets of this V1beta1CPUInstancetype.

        MaxSockets specifies the maximum amount of sockets that can be hotplugged  # noqa: E501

        :param max_sockets: The max_sockets of this V1beta1CPUInstancetype.  # noqa: E501
        :type: int
        """

        self._max_sockets = max_sockets

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

        Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like \"host-passthrough\" to get the same CPU as the node and \"host-model\" to get CPU closest to the node one. Defaults to host-model.  # noqa: E501

        :return: The model of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: str
        """
        return self._model

    @model.setter
    def model(self, model):
        """Sets the model of this V1beta1CPUInstancetype.

        Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like \"host-passthrough\" to get the same CPU as the node and \"host-model\" to get CPU closest to the node one. Defaults to host-model.  # noqa: E501

        :param model: The model of this V1beta1CPUInstancetype.  # noqa: E501
        :type: str
        """

        self._model = model

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

        NUMA allows specifying settings for the guest NUMA topology  # noqa: E501

        :return: The numa of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: V1NUMA
        """
        return self._numa

    @numa.setter
    def numa(self, numa):
        """Sets the numa of this V1beta1CPUInstancetype.

        NUMA allows specifying settings for the guest NUMA topology  # noqa: E501

        :param numa: The numa of this V1beta1CPUInstancetype.  # noqa: E501
        :type: V1NUMA
        """

        self._numa = numa

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

        Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads  # noqa: E501

        :return: The realtime of this V1beta1CPUInstancetype.  # noqa: E501
        :rtype: V1Realtime
        """
        return self._realtime

    @realtime.setter
    def realtime(self, realtime):
        """Sets the realtime of this V1beta1CPUInstancetype.

        Realtime instructs the virt-launcher to tune the VMI for lower latency, optional for real time workloads  # noqa: E501

        :param realtime: The realtime of this V1beta1CPUInstancetype.  # noqa: E501
        :type: V1Realtime
        """

        self._realtime = realtime

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

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