# coding: utf-8

"""
    KubeVirt API

    This is KubeVirt API an add-on for Kubernetes.

    OpenAPI spec version: 1.0.0
    Contact: kubevirt-dev@googlegroups.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


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]',
        'run_strategy': 'str',
        'running': 'bool',
        'template': 'V1VirtualMachineInstanceTemplateSpec'
    }

    attribute_map = {
        'data_volume_templates': 'dataVolumeTemplates',
        'run_strategy': 'runStrategy',
        'running': 'running',
        'template': 'template'
    }

    def __init__(self, data_volume_templates=None, run_strategy=None, running=None, template=None):
        """
        V1VirtualMachineSpec - a model defined in Swagger
        """

        self._data_volume_templates = None
        self._run_strategy = None
        self._running = None
        self._template = None

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

    @property
    def data_volume_templates(self):
        """
        Gets 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.

        :return: The data_volume_templates of this V1VirtualMachineSpec.
        :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.

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

        self._data_volume_templates = data_volume_templates

    @property
    def run_strategy(self):
        """
        Gets the run_strategy of this V1VirtualMachineSpec.
        Running state indicates the requested running state of the VirtualMachineInstance mutually exclusive with Running

        :return: The run_strategy of this V1VirtualMachineSpec.
        :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

        :param run_strategy: The run_strategy of this V1VirtualMachineSpec.
        :type: str
        """

        self._run_strategy = run_strategy

    @property
    def running(self):
        """
        Gets the running of this V1VirtualMachineSpec.
        Running controls whether the associatied VirtualMachineInstance is created or not Mutually exclusive with RunStrategy

        :return: The running of this V1VirtualMachineSpec.
        :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

        :param running: The running of this V1VirtualMachineSpec.
        :type: bool
        """

        self._running = running

    @property
    def template(self):
        """
        Gets the template of this V1VirtualMachineSpec.
        Template is the direct specification of VirtualMachineInstance

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

    @template.setter
    def template(self, template):
        """
        Sets the template of this V1VirtualMachineSpec.
        Template is the direct specification of VirtualMachineInstance

        :param template: The template of this V1VirtualMachineSpec.
        :type: V1VirtualMachineInstanceTemplateSpec
        """
        if template is None:
            raise ValueError("Invalid value for `template`, must not be `None`")

        self._template = template

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
