# 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 V1beta1VirtualMachinePoolSpec(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 = {
        'autohealing': 'V1beta1VirtualMachinePoolAutohealingStrategy',
        'max_unavailable': 'K8sIoApimachineryPkgUtilIntstrIntOrString',
        'name_generation': 'V1beta1VirtualMachinePoolNameGeneration',
        'paused': 'bool',
        'replicas': 'int',
        'scale_in_strategy': 'V1beta1VirtualMachinePoolScaleInStrategy',
        'selector': 'K8sIoApimachineryPkgApisMetaV1LabelSelector',
        'update_strategy': 'V1beta1VirtualMachinePoolUpdateStrategy',
        'virtual_machine_template': 'V1beta1VirtualMachineTemplateSpec'
    }

    attribute_map = {
        'autohealing': 'autohealing',
        'max_unavailable': 'maxUnavailable',
        'name_generation': 'nameGeneration',
        'paused': 'paused',
        'replicas': 'replicas',
        'scale_in_strategy': 'scaleInStrategy',
        'selector': 'selector',
        'update_strategy': 'updateStrategy',
        'virtual_machine_template': 'virtualMachineTemplate'
    }

    def __init__(self, autohealing=None, max_unavailable=None, name_generation=None, paused=None, replicas=None, scale_in_strategy=None, selector=None, update_strategy=None, virtual_machine_template=None, _configuration=None):  # noqa: E501
        """V1beta1VirtualMachinePoolSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._autohealing = None
        self._max_unavailable = None
        self._name_generation = None
        self._paused = None
        self._replicas = None
        self._scale_in_strategy = None
        self._selector = None
        self._update_strategy = None
        self._virtual_machine_template = None
        self.discriminator = None

        if autohealing is not None:
            self.autohealing = autohealing
        if max_unavailable is not None:
            self.max_unavailable = max_unavailable
        if name_generation is not None:
            self.name_generation = name_generation
        if paused is not None:
            self.paused = paused
        if replicas is not None:
            self.replicas = replicas
        if scale_in_strategy is not None:
            self.scale_in_strategy = scale_in_strategy
        self.selector = selector
        if update_strategy is not None:
            self.update_strategy = update_strategy
        self.virtual_machine_template = virtual_machine_template

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

        Autohealing specifies when a VMpool should replace a failing VM with a reprovisioned instance  # noqa: E501

        :return: The autohealing of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: V1beta1VirtualMachinePoolAutohealingStrategy
        """
        return self._autohealing

    @autohealing.setter
    def autohealing(self, autohealing):
        """Sets the autohealing of this V1beta1VirtualMachinePoolSpec.

        Autohealing specifies when a VMpool should replace a failing VM with a reprovisioned instance  # noqa: E501

        :param autohealing: The autohealing of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: V1beta1VirtualMachinePoolAutohealingStrategy
        """

        self._autohealing = autohealing

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

        (Defaults to 100%) Integer or string pointer, that when set represents either a percentage or number of VMs in a pool that can be unavailable (ready condition false) at a time during automated update.  # noqa: E501

        :return: The max_unavailable of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: K8sIoApimachineryPkgUtilIntstrIntOrString
        """
        return self._max_unavailable

    @max_unavailable.setter
    def max_unavailable(self, max_unavailable):
        """Sets the max_unavailable of this V1beta1VirtualMachinePoolSpec.

        (Defaults to 100%) Integer or string pointer, that when set represents either a percentage or number of VMs in a pool that can be unavailable (ready condition false) at a time during automated update.  # noqa: E501

        :param max_unavailable: The max_unavailable of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: K8sIoApimachineryPkgUtilIntstrIntOrString
        """

        self._max_unavailable = max_unavailable

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

        Options for the name generation in a pool.  # noqa: E501

        :return: The name_generation of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: V1beta1VirtualMachinePoolNameGeneration
        """
        return self._name_generation

    @name_generation.setter
    def name_generation(self, name_generation):
        """Sets the name_generation of this V1beta1VirtualMachinePoolSpec.

        Options for the name generation in a pool.  # noqa: E501

        :param name_generation: The name_generation of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: V1beta1VirtualMachinePoolNameGeneration
        """

        self._name_generation = name_generation

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

        Indicates that the pool is paused.  # noqa: E501

        :return: The paused of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: bool
        """
        return self._paused

    @paused.setter
    def paused(self, paused):
        """Sets the paused of this V1beta1VirtualMachinePoolSpec.

        Indicates that the pool is paused.  # noqa: E501

        :param paused: The paused of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: bool
        """

        self._paused = paused

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

        Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.  # noqa: E501

        :return: The replicas of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: int
        """
        return self._replicas

    @replicas.setter
    def replicas(self, replicas):
        """Sets the replicas of this V1beta1VirtualMachinePoolSpec.

        Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.  # noqa: E501

        :param replicas: The replicas of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: int
        """

        self._replicas = replicas

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

        ScaleInStrategy specifies how the VMPool controller manages scaling in VMs within a VMPool  # noqa: E501

        :return: The scale_in_strategy of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: V1beta1VirtualMachinePoolScaleInStrategy
        """
        return self._scale_in_strategy

    @scale_in_strategy.setter
    def scale_in_strategy(self, scale_in_strategy):
        """Sets the scale_in_strategy of this V1beta1VirtualMachinePoolSpec.

        ScaleInStrategy specifies how the VMPool controller manages scaling in VMs within a VMPool  # noqa: E501

        :param scale_in_strategy: The scale_in_strategy of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: V1beta1VirtualMachinePoolScaleInStrategy
        """

        self._scale_in_strategy = scale_in_strategy

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

        Label selector for pods. Existing Poolss whose pods are selected by this will be the ones affected by this deployment.  # noqa: E501

        :return: The selector of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: K8sIoApimachineryPkgApisMetaV1LabelSelector
        """
        return self._selector

    @selector.setter
    def selector(self, selector):
        """Sets the selector of this V1beta1VirtualMachinePoolSpec.

        Label selector for pods. Existing Poolss whose pods are selected by this will be the ones affected by this deployment.  # noqa: E501

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

        self._selector = selector

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

        UpdateStrategy specifies how the VMPool controller manages updating VMs within a VMPool  # noqa: E501

        :return: The update_strategy of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: V1beta1VirtualMachinePoolUpdateStrategy
        """
        return self._update_strategy

    @update_strategy.setter
    def update_strategy(self, update_strategy):
        """Sets the update_strategy of this V1beta1VirtualMachinePoolSpec.

        UpdateStrategy specifies how the VMPool controller manages updating VMs within a VMPool  # noqa: E501

        :param update_strategy: The update_strategy of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :type: V1beta1VirtualMachinePoolUpdateStrategy
        """

        self._update_strategy = update_strategy

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

        Template describes the VM that will be created.  # noqa: E501

        :return: The virtual_machine_template of this V1beta1VirtualMachinePoolSpec.  # noqa: E501
        :rtype: V1beta1VirtualMachineTemplateSpec
        """
        return self._virtual_machine_template

    @virtual_machine_template.setter
    def virtual_machine_template(self, virtual_machine_template):
        """Sets the virtual_machine_template of this V1beta1VirtualMachinePoolSpec.

        Template describes the VM that will be created.  # noqa: E501

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

        self._virtual_machine_template = virtual_machine_template

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

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