# 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 V1DeveloperConfiguration(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 = {
        'cluster_profiler': 'bool',
        'cpu_allocation_ratio': 'int',
        'disk_verification': 'V1DiskVerification',
        'feature_gates': 'list[str]',
        'log_verbosity': 'V1LogVerbosity',
        'memory_overcommit': 'int',
        'minimum_cluster_tsc_frequency': 'int',
        'minimum_reserve_pvc_bytes': 'int',
        'node_selectors': 'dict(str, str)',
        'pvc_tolerate_less_space_up_to_percent': 'int',
        'use_emulation': 'bool'
    }

    attribute_map = {
        'cluster_profiler': 'clusterProfiler',
        'cpu_allocation_ratio': 'cpuAllocationRatio',
        'disk_verification': 'diskVerification',
        'feature_gates': 'featureGates',
        'log_verbosity': 'logVerbosity',
        'memory_overcommit': 'memoryOvercommit',
        'minimum_cluster_tsc_frequency': 'minimumClusterTSCFrequency',
        'minimum_reserve_pvc_bytes': 'minimumReservePVCBytes',
        'node_selectors': 'nodeSelectors',
        'pvc_tolerate_less_space_up_to_percent': 'pvcTolerateLessSpaceUpToPercent',
        'use_emulation': 'useEmulation'
    }

    def __init__(self, cluster_profiler=None, cpu_allocation_ratio=None, disk_verification=None, feature_gates=None, log_verbosity=None, memory_overcommit=None, minimum_cluster_tsc_frequency=None, minimum_reserve_pvc_bytes=None, node_selectors=None, pvc_tolerate_less_space_up_to_percent=None, use_emulation=None, _configuration=None):  # noqa: E501
        """V1DeveloperConfiguration - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._cluster_profiler = None
        self._cpu_allocation_ratio = None
        self._disk_verification = None
        self._feature_gates = None
        self._log_verbosity = None
        self._memory_overcommit = None
        self._minimum_cluster_tsc_frequency = None
        self._minimum_reserve_pvc_bytes = None
        self._node_selectors = None
        self._pvc_tolerate_less_space_up_to_percent = None
        self._use_emulation = None
        self.discriminator = None

        if cluster_profiler is not None:
            self.cluster_profiler = cluster_profiler
        if cpu_allocation_ratio is not None:
            self.cpu_allocation_ratio = cpu_allocation_ratio
        if disk_verification is not None:
            self.disk_verification = disk_verification
        if feature_gates is not None:
            self.feature_gates = feature_gates
        if log_verbosity is not None:
            self.log_verbosity = log_verbosity
        if memory_overcommit is not None:
            self.memory_overcommit = memory_overcommit
        if minimum_cluster_tsc_frequency is not None:
            self.minimum_cluster_tsc_frequency = minimum_cluster_tsc_frequency
        if minimum_reserve_pvc_bytes is not None:
            self.minimum_reserve_pvc_bytes = minimum_reserve_pvc_bytes
        if node_selectors is not None:
            self.node_selectors = node_selectors
        if pvc_tolerate_less_space_up_to_percent is not None:
            self.pvc_tolerate_less_space_up_to_percent = pvc_tolerate_less_space_up_to_percent
        if use_emulation is not None:
            self.use_emulation = use_emulation

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

        Enable the ability to pprof profile KubeVirt control plane  # noqa: E501

        :return: The cluster_profiler of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: bool
        """
        return self._cluster_profiler

    @cluster_profiler.setter
    def cluster_profiler(self, cluster_profiler):
        """Sets the cluster_profiler of this V1DeveloperConfiguration.

        Enable the ability to pprof profile KubeVirt control plane  # noqa: E501

        :param cluster_profiler: The cluster_profiler of this V1DeveloperConfiguration.  # noqa: E501
        :type: bool
        """

        self._cluster_profiler = cluster_profiler

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

        For each requested virtual CPU, CPUAllocationRatio defines how much physical CPU to request per VMI from the hosting node. The value is in fraction of a CPU thread (or core on non-hyperthreaded nodes). For example, a value of 1 means 1 physical CPU thread per VMI CPU thread. A value of 100 would be 1% of a physical thread allocated for each requested VMI thread. This option has no effect on VMIs that request dedicated CPUs. More information at: https://kubevirt.io/user-guide/operations/node_overcommit/#node-cpu-allocation-ratio Defaults to 10  # noqa: E501

        :return: The cpu_allocation_ratio of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._cpu_allocation_ratio

    @cpu_allocation_ratio.setter
    def cpu_allocation_ratio(self, cpu_allocation_ratio):
        """Sets the cpu_allocation_ratio of this V1DeveloperConfiguration.

        For each requested virtual CPU, CPUAllocationRatio defines how much physical CPU to request per VMI from the hosting node. The value is in fraction of a CPU thread (or core on non-hyperthreaded nodes). For example, a value of 1 means 1 physical CPU thread per VMI CPU thread. A value of 100 would be 1% of a physical thread allocated for each requested VMI thread. This option has no effect on VMIs that request dedicated CPUs. More information at: https://kubevirt.io/user-guide/operations/node_overcommit/#node-cpu-allocation-ratio Defaults to 10  # noqa: E501

        :param cpu_allocation_ratio: The cpu_allocation_ratio of this V1DeveloperConfiguration.  # noqa: E501
        :type: int
        """

        self._cpu_allocation_ratio = cpu_allocation_ratio

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


        :return: The disk_verification of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: V1DiskVerification
        """
        return self._disk_verification

    @disk_verification.setter
    def disk_verification(self, disk_verification):
        """Sets the disk_verification of this V1DeveloperConfiguration.


        :param disk_verification: The disk_verification of this V1DeveloperConfiguration.  # noqa: E501
        :type: V1DiskVerification
        """

        self._disk_verification = disk_verification

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

        FeatureGates is the list of experimental features to enable. Defaults to none  # noqa: E501

        :return: The feature_gates of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: list[str]
        """
        return self._feature_gates

    @feature_gates.setter
    def feature_gates(self, feature_gates):
        """Sets the feature_gates of this V1DeveloperConfiguration.

        FeatureGates is the list of experimental features to enable. Defaults to none  # noqa: E501

        :param feature_gates: The feature_gates of this V1DeveloperConfiguration.  # noqa: E501
        :type: list[str]
        """

        self._feature_gates = feature_gates

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


        :return: The log_verbosity of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: V1LogVerbosity
        """
        return self._log_verbosity

    @log_verbosity.setter
    def log_verbosity(self, log_verbosity):
        """Sets the log_verbosity of this V1DeveloperConfiguration.


        :param log_verbosity: The log_verbosity of this V1DeveloperConfiguration.  # noqa: E501
        :type: V1LogVerbosity
        """

        self._log_verbosity = log_verbosity

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

        MemoryOvercommit is the percentage of memory we want to give VMIs compared to the amount given to its parent pod (virt-launcher). For example, a value of 102 means the VMI will \"see\" 2% more memory than its parent pod. Values under 100 are effectively \"undercommits\". Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 100  # noqa: E501

        :return: The memory_overcommit of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._memory_overcommit

    @memory_overcommit.setter
    def memory_overcommit(self, memory_overcommit):
        """Sets the memory_overcommit of this V1DeveloperConfiguration.

        MemoryOvercommit is the percentage of memory we want to give VMIs compared to the amount given to its parent pod (virt-launcher). For example, a value of 102 means the VMI will \"see\" 2% more memory than its parent pod. Values under 100 are effectively \"undercommits\". Overcommits can lead to memory exhaustion, which in turn can lead to crashes. Use carefully. Defaults to 100  # noqa: E501

        :param memory_overcommit: The memory_overcommit of this V1DeveloperConfiguration.  # noqa: E501
        :type: int
        """

        self._memory_overcommit = memory_overcommit

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

        Allow overriding the automatically determined minimum TSC frequency of the cluster and fixate the minimum to this frequency.  # noqa: E501

        :return: The minimum_cluster_tsc_frequency of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._minimum_cluster_tsc_frequency

    @minimum_cluster_tsc_frequency.setter
    def minimum_cluster_tsc_frequency(self, minimum_cluster_tsc_frequency):
        """Sets the minimum_cluster_tsc_frequency of this V1DeveloperConfiguration.

        Allow overriding the automatically determined minimum TSC frequency of the cluster and fixate the minimum to this frequency.  # noqa: E501

        :param minimum_cluster_tsc_frequency: The minimum_cluster_tsc_frequency of this V1DeveloperConfiguration.  # noqa: E501
        :type: int
        """

        self._minimum_cluster_tsc_frequency = minimum_cluster_tsc_frequency

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

        MinimumReservePVCBytes is the amount of space, in bytes, to leave unused on disks. Defaults to 131072 (128KiB)  # noqa: E501

        :return: The minimum_reserve_pvc_bytes of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._minimum_reserve_pvc_bytes

    @minimum_reserve_pvc_bytes.setter
    def minimum_reserve_pvc_bytes(self, minimum_reserve_pvc_bytes):
        """Sets the minimum_reserve_pvc_bytes of this V1DeveloperConfiguration.

        MinimumReservePVCBytes is the amount of space, in bytes, to leave unused on disks. Defaults to 131072 (128KiB)  # noqa: E501

        :param minimum_reserve_pvc_bytes: The minimum_reserve_pvc_bytes of this V1DeveloperConfiguration.  # noqa: E501
        :type: int
        """

        self._minimum_reserve_pvc_bytes = minimum_reserve_pvc_bytes

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

        NodeSelectors allows restricting VMI creation to nodes that match a set of labels. Defaults to none  # noqa: E501

        :return: The node_selectors of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._node_selectors

    @node_selectors.setter
    def node_selectors(self, node_selectors):
        """Sets the node_selectors of this V1DeveloperConfiguration.

        NodeSelectors allows restricting VMI creation to nodes that match a set of labels. Defaults to none  # noqa: E501

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

        self._node_selectors = node_selectors

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

        LessPVCSpaceToleration determines how much smaller, in percentage, disk PVCs are allowed to be compared to the requested size (to account for various overheads). Defaults to 10  # noqa: E501

        :return: The pvc_tolerate_less_space_up_to_percent of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._pvc_tolerate_less_space_up_to_percent

    @pvc_tolerate_less_space_up_to_percent.setter
    def pvc_tolerate_less_space_up_to_percent(self, pvc_tolerate_less_space_up_to_percent):
        """Sets the pvc_tolerate_less_space_up_to_percent of this V1DeveloperConfiguration.

        LessPVCSpaceToleration determines how much smaller, in percentage, disk PVCs are allowed to be compared to the requested size (to account for various overheads). Defaults to 10  # noqa: E501

        :param pvc_tolerate_less_space_up_to_percent: The pvc_tolerate_less_space_up_to_percent of this V1DeveloperConfiguration.  # noqa: E501
        :type: int
        """

        self._pvc_tolerate_less_space_up_to_percent = pvc_tolerate_less_space_up_to_percent

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

        UseEmulation can be set to true to allow fallback to software emulation in case hardware-assisted emulation is not available. Defaults to false  # noqa: E501

        :return: The use_emulation of this V1DeveloperConfiguration.  # noqa: E501
        :rtype: bool
        """
        return self._use_emulation

    @use_emulation.setter
    def use_emulation(self, use_emulation):
        """Sets the use_emulation of this V1DeveloperConfiguration.

        UseEmulation can be set to true to allow fallback to software emulation in case hardware-assisted emulation is not available. Defaults to false  # noqa: E501

        :param use_emulation: The use_emulation of this V1DeveloperConfiguration.  # noqa: E501
        :type: bool
        """

        self._use_emulation = use_emulation

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

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