# 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 V1beta1VirtualMachineRestoreSpec(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 = {
        'patches': 'list[str]',
        'target': 'K8sIoApiCoreV1TypedLocalObjectReference',
        'target_readiness_policy': 'str',
        'virtual_machine_snapshot_name': 'str',
        'volume_ownership_policy': 'str',
        'volume_restore_overrides': 'list[V1beta1VolumeRestoreOverride]',
        'volume_restore_policy': 'str'
    }

    attribute_map = {
        'patches': 'patches',
        'target': 'target',
        'target_readiness_policy': 'targetReadinessPolicy',
        'virtual_machine_snapshot_name': 'virtualMachineSnapshotName',
        'volume_ownership_policy': 'volumeOwnershipPolicy',
        'volume_restore_overrides': 'volumeRestoreOverrides',
        'volume_restore_policy': 'volumeRestorePolicy'
    }

    def __init__(self, patches=None, target=None, target_readiness_policy=None, virtual_machine_snapshot_name='', volume_ownership_policy=None, volume_restore_overrides=None, volume_restore_policy=None, _configuration=None):  # noqa: E501
        """V1beta1VirtualMachineRestoreSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._patches = None
        self._target = None
        self._target_readiness_policy = None
        self._virtual_machine_snapshot_name = None
        self._volume_ownership_policy = None
        self._volume_restore_overrides = None
        self._volume_restore_policy = None
        self.discriminator = None

        if patches is not None:
            self.patches = patches
        self.target = target
        if target_readiness_policy is not None:
            self.target_readiness_policy = target_readiness_policy
        self.virtual_machine_snapshot_name = virtual_machine_snapshot_name
        if volume_ownership_policy is not None:
            self.volume_ownership_policy = volume_ownership_policy
        if volume_restore_overrides is not None:
            self.volume_restore_overrides = volume_restore_overrides
        if volume_restore_policy is not None:
            self.volume_restore_policy = volume_restore_policy

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

        If the target for the restore does not exist, it will be created. Patches holds JSON patches that would be applied to the target manifest before it's created. Patches should fit the target's Kind.  Example for a patch: {\"op\": \"replace\", \"path\": \"/metadata/name\", \"value\": \"new-vm-name\"}  # noqa: E501

        :return: The patches of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: list[str]
        """
        return self._patches

    @patches.setter
    def patches(self, patches):
        """Sets the patches of this V1beta1VirtualMachineRestoreSpec.

        If the target for the restore does not exist, it will be created. Patches holds JSON patches that would be applied to the target manifest before it's created. Patches should fit the target's Kind.  Example for a patch: {\"op\": \"replace\", \"path\": \"/metadata/name\", \"value\": \"new-vm-name\"}  # noqa: E501

        :param patches: The patches of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :type: list[str]
        """

        self._patches = patches

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

        initially only VirtualMachine type supported  # noqa: E501

        :return: The target of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: K8sIoApiCoreV1TypedLocalObjectReference
        """
        return self._target

    @target.setter
    def target(self, target):
        """Sets the target of this V1beta1VirtualMachineRestoreSpec.

        initially only VirtualMachine type supported  # noqa: E501

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

        self._target = target

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


        :return: The target_readiness_policy of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: str
        """
        return self._target_readiness_policy

    @target_readiness_policy.setter
    def target_readiness_policy(self, target_readiness_policy):
        """Sets the target_readiness_policy of this V1beta1VirtualMachineRestoreSpec.


        :param target_readiness_policy: The target_readiness_policy of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :type: str
        """

        self._target_readiness_policy = target_readiness_policy

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


        :return: The virtual_machine_snapshot_name of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: str
        """
        return self._virtual_machine_snapshot_name

    @virtual_machine_snapshot_name.setter
    def virtual_machine_snapshot_name(self, virtual_machine_snapshot_name):
        """Sets the virtual_machine_snapshot_name of this V1beta1VirtualMachineRestoreSpec.


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

        self._virtual_machine_snapshot_name = virtual_machine_snapshot_name

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


        :return: The volume_ownership_policy of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: str
        """
        return self._volume_ownership_policy

    @volume_ownership_policy.setter
    def volume_ownership_policy(self, volume_ownership_policy):
        """Sets the volume_ownership_policy of this V1beta1VirtualMachineRestoreSpec.


        :param volume_ownership_policy: The volume_ownership_policy of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :type: str
        """

        self._volume_ownership_policy = volume_ownership_policy

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

        VolumeRestoreOverrides gives the option to change properties of each restored volume For example, specifying the name of the restored volume, or adding labels/annotations to it  # noqa: E501

        :return: The volume_restore_overrides of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: list[V1beta1VolumeRestoreOverride]
        """
        return self._volume_restore_overrides

    @volume_restore_overrides.setter
    def volume_restore_overrides(self, volume_restore_overrides):
        """Sets the volume_restore_overrides of this V1beta1VirtualMachineRestoreSpec.

        VolumeRestoreOverrides gives the option to change properties of each restored volume For example, specifying the name of the restored volume, or adding labels/annotations to it  # noqa: E501

        :param volume_restore_overrides: The volume_restore_overrides of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :type: list[V1beta1VolumeRestoreOverride]
        """

        self._volume_restore_overrides = volume_restore_overrides

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


        :return: The volume_restore_policy of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :rtype: str
        """
        return self._volume_restore_policy

    @volume_restore_policy.setter
    def volume_restore_policy(self, volume_restore_policy):
        """Sets the volume_restore_policy of this V1beta1VirtualMachineRestoreSpec.


        :param volume_restore_policy: The volume_restore_policy of this V1beta1VirtualMachineRestoreSpec.  # noqa: E501
        :type: str
        """

        self._volume_restore_policy = volume_restore_policy

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

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