# 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 V1beta1VirtualMachineSnapshotSpec(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 = {
        'deletion_policy': 'str',
        'failure_deadline': 'K8sIoApimachineryPkgApisMetaV1Duration',
        'source': 'K8sIoApiCoreV1TypedLocalObjectReference'
    }

    attribute_map = {
        'deletion_policy': 'deletionPolicy',
        'failure_deadline': 'failureDeadline',
        'source': 'source'
    }

    def __init__(self, deletion_policy=None, failure_deadline=None, source=None, _configuration=None):  # noqa: E501
        """V1beta1VirtualMachineSnapshotSpec - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._deletion_policy = None
        self._failure_deadline = None
        self._source = None
        self.discriminator = None

        if deletion_policy is not None:
            self.deletion_policy = deletion_policy
        if failure_deadline is not None:
            self.failure_deadline = failure_deadline
        self.source = source

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


        :return: The deletion_policy of this V1beta1VirtualMachineSnapshotSpec.  # noqa: E501
        :rtype: str
        """
        return self._deletion_policy

    @deletion_policy.setter
    def deletion_policy(self, deletion_policy):
        """Sets the deletion_policy of this V1beta1VirtualMachineSnapshotSpec.


        :param deletion_policy: The deletion_policy of this V1beta1VirtualMachineSnapshotSpec.  # noqa: E501
        :type: str
        """

        self._deletion_policy = deletion_policy

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

        This time represents the number of seconds we permit the vm snapshot to take. In case we pass this deadline we mark this snapshot as failed. Defaults to DefaultFailureDeadline - 5min  # noqa: E501

        :return: The failure_deadline of this V1beta1VirtualMachineSnapshotSpec.  # noqa: E501
        :rtype: K8sIoApimachineryPkgApisMetaV1Duration
        """
        return self._failure_deadline

    @failure_deadline.setter
    def failure_deadline(self, failure_deadline):
        """Sets the failure_deadline of this V1beta1VirtualMachineSnapshotSpec.

        This time represents the number of seconds we permit the vm snapshot to take. In case we pass this deadline we mark this snapshot as failed. Defaults to DefaultFailureDeadline - 5min  # noqa: E501

        :param failure_deadline: The failure_deadline of this V1beta1VirtualMachineSnapshotSpec.  # noqa: E501
        :type: K8sIoApimachineryPkgApisMetaV1Duration
        """

        self._failure_deadline = failure_deadline

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


        :return: The source of this V1beta1VirtualMachineSnapshotSpec.  # noqa: E501
        :rtype: K8sIoApiCoreV1TypedLocalObjectReference
        """
        return self._source

    @source.setter
    def source(self, source):
        """Sets the source of this V1beta1VirtualMachineSnapshotSpec.


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

        self._source = source

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

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