# 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 V1ContainerDiskSource(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 = {
        'image': 'str',
        'image_pull_policy': 'str',
        'image_pull_secret': 'str',
        'path': 'str'
    }

    attribute_map = {
        'image': 'image',
        'image_pull_policy': 'imagePullPolicy',
        'image_pull_secret': 'imagePullSecret',
        'path': 'path'
    }

    def __init__(self, image='', image_pull_policy=None, image_pull_secret=None, path=None, _configuration=None):  # noqa: E501
        """V1ContainerDiskSource - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._image = None
        self._image_pull_policy = None
        self._image_pull_secret = None
        self._path = None
        self.discriminator = None

        self.image = image
        if image_pull_policy is not None:
            self.image_pull_policy = image_pull_policy
        if image_pull_secret is not None:
            self.image_pull_secret = image_pull_secret
        if path is not None:
            self.path = path

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

        Image is the name of the image with the embedded disk.  # noqa: E501

        :return: The image of this V1ContainerDiskSource.  # noqa: E501
        :rtype: str
        """
        return self._image

    @image.setter
    def image(self, image):
        """Sets the image of this V1ContainerDiskSource.

        Image is the name of the image with the embedded disk.  # noqa: E501

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

        self._image = image

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

        Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images  Possible enum values:  - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.  - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.  - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present  # noqa: E501

        :return: The image_pull_policy of this V1ContainerDiskSource.  # noqa: E501
        :rtype: str
        """
        return self._image_pull_policy

    @image_pull_policy.setter
    def image_pull_policy(self, image_pull_policy):
        """Sets the image_pull_policy of this V1ContainerDiskSource.

        Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images  Possible enum values:  - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.  - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.  - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present  # noqa: E501

        :param image_pull_policy: The image_pull_policy of this V1ContainerDiskSource.  # noqa: E501
        :type: str
        """
        allowed_values = ["Always", "IfNotPresent", "Never"]  # noqa: E501
        if (self._configuration.client_side_validation and
                image_pull_policy not in allowed_values):
            raise ValueError(
                "Invalid value for `image_pull_policy` ({0}), must be one of {1}"  # noqa: E501
                .format(image_pull_policy, allowed_values)
            )

        self._image_pull_policy = image_pull_policy

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

        ImagePullSecret is the name of the Docker registry secret required to pull the image. The secret must already exist.  # noqa: E501

        :return: The image_pull_secret of this V1ContainerDiskSource.  # noqa: E501
        :rtype: str
        """
        return self._image_pull_secret

    @image_pull_secret.setter
    def image_pull_secret(self, image_pull_secret):
        """Sets the image_pull_secret of this V1ContainerDiskSource.

        ImagePullSecret is the name of the Docker registry secret required to pull the image. The secret must already exist.  # noqa: E501

        :param image_pull_secret: The image_pull_secret of this V1ContainerDiskSource.  # noqa: E501
        :type: str
        """

        self._image_pull_secret = image_pull_secret

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

        Path defines the path to disk file in the container  # noqa: E501

        :return: The path of this V1ContainerDiskSource.  # noqa: E501
        :rtype: str
        """
        return self._path

    @path.setter
    def path(self, path):
        """Sets the path of this V1ContainerDiskSource.

        Path defines the path to disk file in the container  # noqa: E501

        :param path: The path of this V1ContainerDiskSource.  # noqa: E501
        :type: str
        """

        self._path = path

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

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