# 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 V1beta1VirtualMachinePreferenceSpec(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)',
        'clock': 'V1beta1ClockPreferences',
        'cpu': 'V1beta1CPUPreferences',
        'devices': 'V1beta1DevicePreferences',
        'features': 'V1beta1FeaturePreferences',
        'firmware': 'V1beta1FirmwarePreferences',
        'machine': 'V1beta1MachinePreferences',
        'prefer_spread_socket_to_core_ratio': 'int',
        'preferred_architecture': 'str',
        'preferred_subdomain': 'str',
        'preferred_termination_grace_period_seconds': 'int',
        'requirements': 'V1beta1PreferenceRequirements',
        'volumes': 'V1beta1VolumePreferences'
    }

    attribute_map = {
        'annotations': 'annotations',
        'clock': 'clock',
        'cpu': 'cpu',
        'devices': 'devices',
        'features': 'features',
        'firmware': 'firmware',
        'machine': 'machine',
        'prefer_spread_socket_to_core_ratio': 'preferSpreadSocketToCoreRatio',
        'preferred_architecture': 'preferredArchitecture',
        'preferred_subdomain': 'preferredSubdomain',
        'preferred_termination_grace_period_seconds': 'preferredTerminationGracePeriodSeconds',
        'requirements': 'requirements',
        'volumes': 'volumes'
    }

    def __init__(self, annotations=None, clock=None, cpu=None, devices=None, features=None, firmware=None, machine=None, prefer_spread_socket_to_core_ratio=None, preferred_architecture=None, preferred_subdomain=None, preferred_termination_grace_period_seconds=None, requirements=None, volumes=None, _configuration=None):  # noqa: E501
        """V1beta1VirtualMachinePreferenceSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._annotations = None
        self._clock = None
        self._cpu = None
        self._devices = None
        self._features = None
        self._firmware = None
        self._machine = None
        self._prefer_spread_socket_to_core_ratio = None
        self._preferred_architecture = None
        self._preferred_subdomain = None
        self._preferred_termination_grace_period_seconds = None
        self._requirements = None
        self._volumes = None
        self.discriminator = None

        if annotations is not None:
            self.annotations = annotations
        if clock is not None:
            self.clock = clock
        if cpu is not None:
            self.cpu = cpu
        if devices is not None:
            self.devices = devices
        if features is not None:
            self.features = features
        if firmware is not None:
            self.firmware = firmware
        if machine is not None:
            self.machine = machine
        if prefer_spread_socket_to_core_ratio is not None:
            self.prefer_spread_socket_to_core_ratio = prefer_spread_socket_to_core_ratio
        if preferred_architecture is not None:
            self.preferred_architecture = preferred_architecture
        if preferred_subdomain is not None:
            self.preferred_subdomain = preferred_subdomain
        if preferred_termination_grace_period_seconds is not None:
            self.preferred_termination_grace_period_seconds = preferred_termination_grace_period_seconds
        if requirements is not None:
            self.requirements = requirements
        if volumes is not None:
            self.volumes = volumes

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

        Optionally defines preferred Annotations to be applied to the VirtualMachineInstance  # noqa: E501

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

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

        Optionally defines preferred Annotations to be applied to the VirtualMachineInstance  # noqa: E501

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

        self._annotations = annotations

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

        Clock optionally defines preferences associated with the Clock attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :return: The clock of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1ClockPreferences
        """
        return self._clock

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

        Clock optionally defines preferences associated with the Clock attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :param clock: The clock of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1ClockPreferences
        """

        self._clock = clock

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

        CPU optionally defines preferences associated with the CPU attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :return: The cpu of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1CPUPreferences
        """
        return self._cpu

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

        CPU optionally defines preferences associated with the CPU attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :param cpu: The cpu of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1CPUPreferences
        """

        self._cpu = cpu

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

        Devices optionally defines preferences associated with the Devices attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :return: The devices of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1DevicePreferences
        """
        return self._devices

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

        Devices optionally defines preferences associated with the Devices attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :param devices: The devices of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1DevicePreferences
        """

        self._devices = devices

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

        Features optionally defines preferences associated with the Features attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :return: The features of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1FeaturePreferences
        """
        return self._features

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

        Features optionally defines preferences associated with the Features attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :param features: The features of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1FeaturePreferences
        """

        self._features = features

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

        Firmware optionally defines preferences associated with the Firmware attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :return: The firmware of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1FirmwarePreferences
        """
        return self._firmware

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

        Firmware optionally defines preferences associated with the Firmware attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :param firmware: The firmware of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1FirmwarePreferences
        """

        self._firmware = firmware

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

        Machine optionally defines preferences associated with the Machine attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :return: The machine of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1MachinePreferences
        """
        return self._machine

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

        Machine optionally defines preferences associated with the Machine attribute of a VirtualMachineInstance DomainSpec  # noqa: E501

        :param machine: The machine of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1MachinePreferences
        """

        self._machine = machine

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

        PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between cores and sockets, it defaults to 2.  # noqa: E501

        :return: The prefer_spread_socket_to_core_ratio of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: int
        """
        return self._prefer_spread_socket_to_core_ratio

    @prefer_spread_socket_to_core_ratio.setter
    def prefer_spread_socket_to_core_ratio(self, prefer_spread_socket_to_core_ratio):
        """Sets the prefer_spread_socket_to_core_ratio of this V1beta1VirtualMachinePreferenceSpec.

        PreferSpreadSocketToCoreRatio defines the ratio to spread vCPUs between cores and sockets, it defaults to 2.  # noqa: E501

        :param prefer_spread_socket_to_core_ratio: The prefer_spread_socket_to_core_ratio of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: int
        """

        self._prefer_spread_socket_to_core_ratio = prefer_spread_socket_to_core_ratio

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

        PreferredArchitecture defines a prefeerred architecture for the VirtualMachine  # noqa: E501

        :return: The preferred_architecture of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: str
        """
        return self._preferred_architecture

    @preferred_architecture.setter
    def preferred_architecture(self, preferred_architecture):
        """Sets the preferred_architecture of this V1beta1VirtualMachinePreferenceSpec.

        PreferredArchitecture defines a prefeerred architecture for the VirtualMachine  # noqa: E501

        :param preferred_architecture: The preferred_architecture of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: str
        """

        self._preferred_architecture = preferred_architecture

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

        Subdomain of the VirtualMachineInstance  # noqa: E501

        :return: The preferred_subdomain of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: str
        """
        return self._preferred_subdomain

    @preferred_subdomain.setter
    def preferred_subdomain(self, preferred_subdomain):
        """Sets the preferred_subdomain of this V1beta1VirtualMachinePreferenceSpec.

        Subdomain of the VirtualMachineInstance  # noqa: E501

        :param preferred_subdomain: The preferred_subdomain of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: str
        """

        self._preferred_subdomain = preferred_subdomain

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

        Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.  # noqa: E501

        :return: The preferred_termination_grace_period_seconds of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: int
        """
        return self._preferred_termination_grace_period_seconds

    @preferred_termination_grace_period_seconds.setter
    def preferred_termination_grace_period_seconds(self, preferred_termination_grace_period_seconds):
        """Sets the preferred_termination_grace_period_seconds of this V1beta1VirtualMachinePreferenceSpec.

        Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.  # noqa: E501

        :param preferred_termination_grace_period_seconds: The preferred_termination_grace_period_seconds of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: int
        """

        self._preferred_termination_grace_period_seconds = preferred_termination_grace_period_seconds

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

        Requirements defines the minium amount of instance type defined resources required by a set of preferences  # noqa: E501

        :return: The requirements of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1PreferenceRequirements
        """
        return self._requirements

    @requirements.setter
    def requirements(self, requirements):
        """Sets the requirements of this V1beta1VirtualMachinePreferenceSpec.

        Requirements defines the minium amount of instance type defined resources required by a set of preferences  # noqa: E501

        :param requirements: The requirements of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1PreferenceRequirements
        """

        self._requirements = requirements

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

        Volumes optionally defines preferences associated with the Volumes attribute of a VirtualMachineInstace DomainSpec  # noqa: E501

        :return: The volumes of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :rtype: V1beta1VolumePreferences
        """
        return self._volumes

    @volumes.setter
    def volumes(self, volumes):
        """Sets the volumes of this V1beta1VirtualMachinePreferenceSpec.

        Volumes optionally defines preferences associated with the Volumes attribute of a VirtualMachineInstace DomainSpec  # noqa: E501

        :param volumes: The volumes of this V1beta1VirtualMachinePreferenceSpec.  # noqa: E501
        :type: V1beta1VolumePreferences
        """

        self._volumes = volumes

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

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