# 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 V1LiveUpdateConfiguration(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 = {
        'max_cpu_sockets': 'int',
        'max_guest': 'K8sIoApimachineryPkgApiResourceQuantity',
        'max_hotplug_ratio': 'int'
    }

    attribute_map = {
        'max_cpu_sockets': 'maxCpuSockets',
        'max_guest': 'maxGuest',
        'max_hotplug_ratio': 'maxHotplugRatio'
    }

    def __init__(self, max_cpu_sockets=None, max_guest=None, max_hotplug_ratio=None, _configuration=None):  # noqa: E501
        """V1LiveUpdateConfiguration - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._max_cpu_sockets = None
        self._max_guest = None
        self._max_hotplug_ratio = None
        self.discriminator = None

        if max_cpu_sockets is not None:
            self.max_cpu_sockets = max_cpu_sockets
        if max_guest is not None:
            self.max_guest = max_guest
        if max_hotplug_ratio is not None:
            self.max_hotplug_ratio = max_hotplug_ratio

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

        MaxCpuSockets provides a MaxSockets value for VMs that do not provide their own. For VMs with more sockets than maximum the MaxSockets will be set to equal number of sockets.  # noqa: E501

        :return: The max_cpu_sockets of this V1LiveUpdateConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._max_cpu_sockets

    @max_cpu_sockets.setter
    def max_cpu_sockets(self, max_cpu_sockets):
        """Sets the max_cpu_sockets of this V1LiveUpdateConfiguration.

        MaxCpuSockets provides a MaxSockets value for VMs that do not provide their own. For VMs with more sockets than maximum the MaxSockets will be set to equal number of sockets.  # noqa: E501

        :param max_cpu_sockets: The max_cpu_sockets of this V1LiveUpdateConfiguration.  # noqa: E501
        :type: int
        """

        self._max_cpu_sockets = max_cpu_sockets

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

        MaxGuest defines the maximum amount memory that can be allocated to the guest using hotplug.  # noqa: E501

        :return: The max_guest of this V1LiveUpdateConfiguration.  # noqa: E501
        :rtype: K8sIoApimachineryPkgApiResourceQuantity
        """
        return self._max_guest

    @max_guest.setter
    def max_guest(self, max_guest):
        """Sets the max_guest of this V1LiveUpdateConfiguration.

        MaxGuest defines the maximum amount memory that can be allocated to the guest using hotplug.  # noqa: E501

        :param max_guest: The max_guest of this V1LiveUpdateConfiguration.  # noqa: E501
        :type: K8sIoApimachineryPkgApiResourceQuantity
        """

        self._max_guest = max_guest

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

        MaxHotplugRatio is the ratio used to define the max amount of a hotplug resource that can be made available to a VM when the specific Max* setting is not defined (MaxCpuSockets, MaxGuest) Example: VM is configured with 512Mi of guest memory, if MaxGuest is not defined and MaxHotplugRatio is 2 then MaxGuest = 1Gi defaults to 4  # noqa: E501

        :return: The max_hotplug_ratio of this V1LiveUpdateConfiguration.  # noqa: E501
        :rtype: int
        """
        return self._max_hotplug_ratio

    @max_hotplug_ratio.setter
    def max_hotplug_ratio(self, max_hotplug_ratio):
        """Sets the max_hotplug_ratio of this V1LiveUpdateConfiguration.

        MaxHotplugRatio is the ratio used to define the max amount of a hotplug resource that can be made available to a VM when the specific Max* setting is not defined (MaxCpuSockets, MaxGuest) Example: VM is configured with 512Mi of guest memory, if MaxGuest is not defined and MaxHotplugRatio is 2 then MaxGuest = 1Gi defaults to 4  # noqa: E501

        :param max_hotplug_ratio: The max_hotplug_ratio of this V1LiveUpdateConfiguration.  # noqa: E501
        :type: int
        """

        self._max_hotplug_ratio = max_hotplug_ratio

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

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