# 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 V1DomainSpec(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 = {
        'chassis': 'V1Chassis',
        'clock': 'V1Clock',
        'cpu': 'V1CPU',
        'devices': 'V1Devices',
        'features': 'V1Features',
        'firmware': 'V1Firmware',
        'io_threads': 'V1DiskIOThreads',
        'io_threads_policy': 'str',
        'launch_security': 'V1LaunchSecurity',
        'machine': 'V1Machine',
        'memory': 'V1Memory',
        'resources': 'V1ResourceRequirements'
    }

    attribute_map = {
        'chassis': 'chassis',
        'clock': 'clock',
        'cpu': 'cpu',
        'devices': 'devices',
        'features': 'features',
        'firmware': 'firmware',
        'io_threads': 'ioThreads',
        'io_threads_policy': 'ioThreadsPolicy',
        'launch_security': 'launchSecurity',
        'machine': 'machine',
        'memory': 'memory',
        'resources': 'resources'
    }

    def __init__(self, chassis=None, clock=None, cpu=None, devices=None, features=None, firmware=None, io_threads=None, io_threads_policy=None, launch_security=None, machine=None, memory=None, resources=None, _configuration=None):  # noqa: E501
        """V1DomainSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._chassis = None
        self._clock = None
        self._cpu = None
        self._devices = None
        self._features = None
        self._firmware = None
        self._io_threads = None
        self._io_threads_policy = None
        self._launch_security = None
        self._machine = None
        self._memory = None
        self._resources = None
        self.discriminator = None

        if chassis is not None:
            self.chassis = chassis
        if clock is not None:
            self.clock = clock
        if cpu is not None:
            self.cpu = cpu
        self.devices = devices
        if features is not None:
            self.features = features
        if firmware is not None:
            self.firmware = firmware
        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
        if machine is not None:
            self.machine = machine
        if memory is not None:
            self.memory = memory
        if resources is not None:
            self.resources = resources

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

        Chassis specifies the chassis info passed to the domain.  # noqa: E501

        :return: The chassis of this V1DomainSpec.  # noqa: E501
        :rtype: V1Chassis
        """
        return self._chassis

    @chassis.setter
    def chassis(self, chassis):
        """Sets the chassis of this V1DomainSpec.

        Chassis specifies the chassis info passed to the domain.  # noqa: E501

        :param chassis: The chassis of this V1DomainSpec.  # noqa: E501
        :type: V1Chassis
        """

        self._chassis = chassis

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

        Clock sets the clock and timers of the vmi.  # noqa: E501

        :return: The clock of this V1DomainSpec.  # noqa: E501
        :rtype: V1Clock
        """
        return self._clock

    @clock.setter
    def clock(self, clock):
        """Sets the clock of this V1DomainSpec.

        Clock sets the clock and timers of the vmi.  # noqa: E501

        :param clock: The clock of this V1DomainSpec.  # noqa: E501
        :type: V1Clock
        """

        self._clock = clock

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

        CPU allow specified the detailed CPU topology inside the vmi.  # noqa: E501

        :return: The cpu of this V1DomainSpec.  # noqa: E501
        :rtype: V1CPU
        """
        return self._cpu

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

        CPU allow specified the detailed CPU topology inside the vmi.  # noqa: E501

        :param cpu: The cpu of this V1DomainSpec.  # noqa: E501
        :type: V1CPU
        """

        self._cpu = cpu

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

        Devices allows adding disks, network interfaces, and others  # noqa: E501

        :return: The devices of this V1DomainSpec.  # noqa: E501
        :rtype: V1Devices
        """
        return self._devices

    @devices.setter
    def devices(self, devices):
        """Sets the devices of this V1DomainSpec.

        Devices allows adding disks, network interfaces, and others  # noqa: E501

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

        self._devices = devices

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

        Features like acpi, apic, hyperv, smm.  # noqa: E501

        :return: The features of this V1DomainSpec.  # noqa: E501
        :rtype: V1Features
        """
        return self._features

    @features.setter
    def features(self, features):
        """Sets the features of this V1DomainSpec.

        Features like acpi, apic, hyperv, smm.  # noqa: E501

        :param features: The features of this V1DomainSpec.  # noqa: E501
        :type: V1Features
        """

        self._features = features

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

        Firmware.  # noqa: E501

        :return: The firmware of this V1DomainSpec.  # noqa: E501
        :rtype: V1Firmware
        """
        return self._firmware

    @firmware.setter
    def firmware(self, firmware):
        """Sets the firmware of this V1DomainSpec.

        Firmware.  # noqa: E501

        :param firmware: The firmware of this V1DomainSpec.  # noqa: E501
        :type: V1Firmware
        """

        self._firmware = firmware

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

        IOThreads specifies the IOThreads options.  # noqa: E501

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

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

        IOThreads specifies the IOThreads options.  # noqa: E501

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

        self._io_threads = io_threads

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

        Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto, supplementalPool  # noqa: E501

        :return: The io_threads_policy of this V1DomainSpec.  # 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 V1DomainSpec.

        Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto, supplementalPool  # noqa: E501

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

        self._io_threads_policy = io_threads_policy

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

        Launch Security setting of the vmi.  # noqa: E501

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

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

        Launch Security setting of the vmi.  # noqa: E501

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

        self._launch_security = launch_security

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

        Machine type.  # noqa: E501

        :return: The machine of this V1DomainSpec.  # noqa: E501
        :rtype: V1Machine
        """
        return self._machine

    @machine.setter
    def machine(self, machine):
        """Sets the machine of this V1DomainSpec.

        Machine type.  # noqa: E501

        :param machine: The machine of this V1DomainSpec.  # noqa: E501
        :type: V1Machine
        """

        self._machine = machine

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

        Memory allow specifying the VMI memory features.  # noqa: E501

        :return: The memory of this V1DomainSpec.  # noqa: E501
        :rtype: V1Memory
        """
        return self._memory

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

        Memory allow specifying the VMI memory features.  # noqa: E501

        :param memory: The memory of this V1DomainSpec.  # noqa: E501
        :type: V1Memory
        """

        self._memory = memory

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

        Resources describes the Compute Resources required by this vmi.  # noqa: E501

        :return: The resources of this V1DomainSpec.  # noqa: E501
        :rtype: V1ResourceRequirements
        """
        return self._resources

    @resources.setter
    def resources(self, resources):
        """Sets the resources of this V1DomainSpec.

        Resources describes the Compute Resources required by this vmi.  # noqa: E501

        :param resources: The resources of this V1DomainSpec.  # noqa: E501
        :type: V1ResourceRequirements
        """

        self._resources = resources

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

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