# 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 V1VirtualMachineSpec(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 = {
        'data_volume_templates': 'list[V1DataVolumeTemplateSpec]',
        'instancetype': 'V1InstancetypeMatcher',
        'preference': 'V1PreferenceMatcher',
        'run_strategy': 'str',
        'running': 'bool',
        'template': 'V1VirtualMachineInstanceTemplateSpec',
        'update_volumes_strategy': 'str'
    }

    attribute_map = {
        'data_volume_templates': 'dataVolumeTemplates',
        'instancetype': 'instancetype',
        'preference': 'preference',
        'run_strategy': 'runStrategy',
        'running': 'running',
        'template': 'template',
        'update_volumes_strategy': 'updateVolumesStrategy'
    }

    def __init__(self, data_volume_templates=None, instancetype=None, preference=None, run_strategy=None, running=None, template=None, update_volumes_strategy=None, _configuration=None):  # noqa: E501
        """V1VirtualMachineSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._data_volume_templates = None
        self._instancetype = None
        self._preference = None
        self._run_strategy = None
        self._running = None
        self._template = None
        self._update_volumes_strategy = None
        self.discriminator = None

        if data_volume_templates is not None:
            self.data_volume_templates = data_volume_templates
        if instancetype is not None:
            self.instancetype = instancetype
        if preference is not None:
            self.preference = preference
        if run_strategy is not None:
            self.run_strategy = run_strategy
        if running is not None:
            self.running = running
        self.template = template
        if update_volumes_strategy is not None:
            self.update_volumes_strategy = update_volumes_strategy

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

        dataVolumeTemplates is a list of dataVolumes that the VirtualMachineInstance template can reference. DataVolumes in this list are dynamically created for the VirtualMachine and are tied to the VirtualMachine's life-cycle.  # noqa: E501

        :return: The data_volume_templates of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: list[V1DataVolumeTemplateSpec]
        """
        return self._data_volume_templates

    @data_volume_templates.setter
    def data_volume_templates(self, data_volume_templates):
        """Sets the data_volume_templates of this V1VirtualMachineSpec.

        dataVolumeTemplates is a list of dataVolumes that the VirtualMachineInstance template can reference. DataVolumes in this list are dynamically created for the VirtualMachine and are tied to the VirtualMachine's life-cycle.  # noqa: E501

        :param data_volume_templates: The data_volume_templates of this V1VirtualMachineSpec.  # noqa: E501
        :type: list[V1DataVolumeTemplateSpec]
        """

        self._data_volume_templates = data_volume_templates

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

        InstancetypeMatcher references a instancetype that is used to fill fields in Template  # noqa: E501

        :return: The instancetype of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: V1InstancetypeMatcher
        """
        return self._instancetype

    @instancetype.setter
    def instancetype(self, instancetype):
        """Sets the instancetype of this V1VirtualMachineSpec.

        InstancetypeMatcher references a instancetype that is used to fill fields in Template  # noqa: E501

        :param instancetype: The instancetype of this V1VirtualMachineSpec.  # noqa: E501
        :type: V1InstancetypeMatcher
        """

        self._instancetype = instancetype

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

        PreferenceMatcher references a set of preference that is used to fill fields in Template  # noqa: E501

        :return: The preference of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: V1PreferenceMatcher
        """
        return self._preference

    @preference.setter
    def preference(self, preference):
        """Sets the preference of this V1VirtualMachineSpec.

        PreferenceMatcher references a set of preference that is used to fill fields in Template  # noqa: E501

        :param preference: The preference of this V1VirtualMachineSpec.  # noqa: E501
        :type: V1PreferenceMatcher
        """

        self._preference = preference

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

        Running state indicates the requested running state of the VirtualMachineInstance mutually exclusive with Running  # noqa: E501

        :return: The run_strategy of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: str
        """
        return self._run_strategy

    @run_strategy.setter
    def run_strategy(self, run_strategy):
        """Sets the run_strategy of this V1VirtualMachineSpec.

        Running state indicates the requested running state of the VirtualMachineInstance mutually exclusive with Running  # noqa: E501

        :param run_strategy: The run_strategy of this V1VirtualMachineSpec.  # noqa: E501
        :type: str
        """

        self._run_strategy = run_strategy

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

        Running controls whether the associatied VirtualMachineInstance is created or not Mutually exclusive with RunStrategy Deprecated: VirtualMachineInstance field \"Running\" is now deprecated, please use RunStrategy instead.  # noqa: E501

        :return: The running of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: bool
        """
        return self._running

    @running.setter
    def running(self, running):
        """Sets the running of this V1VirtualMachineSpec.

        Running controls whether the associatied VirtualMachineInstance is created or not Mutually exclusive with RunStrategy Deprecated: VirtualMachineInstance field \"Running\" is now deprecated, please use RunStrategy instead.  # noqa: E501

        :param running: The running of this V1VirtualMachineSpec.  # noqa: E501
        :type: bool
        """

        self._running = running

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

        Template is the direct specification of VirtualMachineInstance  # noqa: E501

        :return: The template of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: V1VirtualMachineInstanceTemplateSpec
        """
        return self._template

    @template.setter
    def template(self, template):
        """Sets the template of this V1VirtualMachineSpec.

        Template is the direct specification of VirtualMachineInstance  # noqa: E501

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

        self._template = template

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

        UpdateVolumesStrategy is the strategy to apply on volumes updates  # noqa: E501

        :return: The update_volumes_strategy of this V1VirtualMachineSpec.  # noqa: E501
        :rtype: str
        """
        return self._update_volumes_strategy

    @update_volumes_strategy.setter
    def update_volumes_strategy(self, update_volumes_strategy):
        """Sets the update_volumes_strategy of this V1VirtualMachineSpec.

        UpdateVolumesStrategy is the strategy to apply on volumes updates  # noqa: E501

        :param update_volumes_strategy: The update_volumes_strategy of this V1VirtualMachineSpec.  # noqa: E501
        :type: str
        """

        self._update_volumes_strategy = update_volumes_strategy

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

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