# 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 V1beta1VirtualMachineInstancetypeSpec(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 = {
        'annotations': 'dict(str, str)',
        'cpu': 'V1beta1CPUInstancetype',
        'gpus': 'list[V1GPU]',
        'host_devices': 'list[V1HostDevice]',
        'io_threads': 'V1DiskIOThreads',
        'io_threads_policy': 'str',
        'launch_security': 'V1LaunchSecurity',
        'memory': 'V1beta1MemoryInstancetype',
        'node_selector': 'dict(str, str)',
        'scheduler_name': 'str'
    }

    attribute_map = {
        'annotations': 'annotations',
        'cpu': 'cpu',
        'gpus': 'gpus',
        'host_devices': 'hostDevices',
        'io_threads': 'ioThreads',
        'io_threads_policy': 'ioThreadsPolicy',
        'launch_security': 'launchSecurity',
        'memory': 'memory',
        'node_selector': 'nodeSelector',
        'scheduler_name': 'schedulerName'
    }

    def __init__(self, annotations=None, cpu=None, gpus=None, host_devices=None, io_threads=None, io_threads_policy=None, launch_security=None, memory=None, node_selector=None, scheduler_name=None, _configuration=None):  # noqa: E501
        """V1beta1VirtualMachineInstancetypeSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._annotations = None
        self._cpu = None
        self._gpus = None
        self._host_devices = None
        self._io_threads = None
        self._io_threads_policy = None
        self._launch_security = None
        self._memory = None
        self._node_selector = None
        self._scheduler_name = None
        self.discriminator = None

        if annotations is not None:
            self.annotations = annotations
        self.cpu = cpu
        if gpus is not None:
            self.gpus = gpus
        if host_devices is not None:
            self.host_devices = host_devices
        if io_threads is not None:
            self.io_threads = io_threads
        if io_threads_policy is not None:
            self.io_threads_policy = io_threads_policy
        if launch_security is not None:
            self.launch_security = launch_security
        self.memory = memory
        if node_selector is not None:
            self.node_selector = node_selector
        if scheduler_name is not None:
            self.scheduler_name = scheduler_name

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

        Optionally defines the required Annotations to be used by the instance type and applied to the VirtualMachineInstance  # noqa: E501

        :return: The annotations of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._annotations

    @annotations.setter
    def annotations(self, annotations):
        """Sets the annotations of this V1beta1VirtualMachineInstancetypeSpec.

        Optionally defines the required Annotations to be used by the instance type and applied to the VirtualMachineInstance  # noqa: E501

        :param annotations: The annotations of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: dict(str, str)
        """

        self._annotations = annotations

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

        Required CPU related attributes of the instancetype.  # noqa: E501

        :return: The cpu of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: V1beta1CPUInstancetype
        """
        return self._cpu

    @cpu.setter
    def cpu(self, cpu):
        """Sets the cpu of this V1beta1VirtualMachineInstancetypeSpec.

        Required CPU related attributes of the instancetype.  # noqa: E501

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

        self._cpu = cpu

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

        Optionally defines any GPU devices associated with the instancetype.  # noqa: E501

        :return: The gpus of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: list[V1GPU]
        """
        return self._gpus

    @gpus.setter
    def gpus(self, gpus):
        """Sets the gpus of this V1beta1VirtualMachineInstancetypeSpec.

        Optionally defines any GPU devices associated with the instancetype.  # noqa: E501

        :param gpus: The gpus of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: list[V1GPU]
        """

        self._gpus = gpus

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

        Optionally defines any HostDevices associated with the instancetype.  # noqa: E501

        :return: The host_devices of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: list[V1HostDevice]
        """
        return self._host_devices

    @host_devices.setter
    def host_devices(self, host_devices):
        """Sets the host_devices of this V1beta1VirtualMachineInstancetypeSpec.

        Optionally defines any HostDevices associated with the instancetype.  # noqa: E501

        :param host_devices: The host_devices of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: list[V1HostDevice]
        """

        self._host_devices = host_devices

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

        Optionally specifies the IOThreads options to be used by the instancetype.  # noqa: E501

        :return: The io_threads of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: V1DiskIOThreads
        """
        return self._io_threads

    @io_threads.setter
    def io_threads(self, io_threads):
        """Sets the io_threads of this V1beta1VirtualMachineInstancetypeSpec.

        Optionally specifies the IOThreads options to be used by the instancetype.  # noqa: E501

        :param io_threads: The io_threads of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: V1DiskIOThreads
        """

        self._io_threads = io_threads

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

        Optionally defines the IOThreadsPolicy to be used by the instancetype.  # noqa: E501

        :return: The io_threads_policy of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: str
        """
        return self._io_threads_policy

    @io_threads_policy.setter
    def io_threads_policy(self, io_threads_policy):
        """Sets the io_threads_policy of this V1beta1VirtualMachineInstancetypeSpec.

        Optionally defines the IOThreadsPolicy to be used by the instancetype.  # noqa: E501

        :param io_threads_policy: The io_threads_policy of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: str
        """

        self._io_threads_policy = io_threads_policy

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

        Optionally defines the LaunchSecurity to be used by the instancetype.  # noqa: E501

        :return: The launch_security of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: V1LaunchSecurity
        """
        return self._launch_security

    @launch_security.setter
    def launch_security(self, launch_security):
        """Sets the launch_security of this V1beta1VirtualMachineInstancetypeSpec.

        Optionally defines the LaunchSecurity to be used by the instancetype.  # noqa: E501

        :param launch_security: The launch_security of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: V1LaunchSecurity
        """

        self._launch_security = launch_security

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

        Required Memory related attributes of the instancetype.  # noqa: E501

        :return: The memory of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: V1beta1MemoryInstancetype
        """
        return self._memory

    @memory.setter
    def memory(self, memory):
        """Sets the memory of this V1beta1VirtualMachineInstancetypeSpec.

        Required Memory related attributes of the instancetype.  # noqa: E501

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

        self._memory = memory

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

        NodeSelector is a selector which must be true for the vmi to fit on a node. Selector which must match a node's labels for the vmi to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/  NodeSelector is the name of the custom node selector for the instancetype.  # noqa: E501

        :return: The node_selector of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._node_selector

    @node_selector.setter
    def node_selector(self, node_selector):
        """Sets the node_selector of this V1beta1VirtualMachineInstancetypeSpec.

        NodeSelector is a selector which must be true for the vmi to fit on a node. Selector which must match a node's labels for the vmi to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/  NodeSelector is the name of the custom node selector for the instancetype.  # noqa: E501

        :param node_selector: The node_selector of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: dict(str, str)
        """

        self._node_selector = node_selector

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

        If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler.  SchedulerName is the name of the custom K8s scheduler for the instancetype.  # noqa: E501

        :return: The scheduler_name of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :rtype: str
        """
        return self._scheduler_name

    @scheduler_name.setter
    def scheduler_name(self, scheduler_name):
        """Sets the scheduler_name of this V1beta1VirtualMachineInstancetypeSpec.

        If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler.  SchedulerName is the name of the custom K8s scheduler for the instancetype.  # noqa: E501

        :param scheduler_name: The scheduler_name of this V1beta1VirtualMachineInstancetypeSpec.  # noqa: E501
        :type: str
        """

        self._scheduler_name = scheduler_name

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

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