# 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 V1PersistentVolumeClaimInfo(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 = {
        'access_modes': 'list[str]',
        'capacity': 'dict(str, K8sIoApimachineryPkgApiResourceQuantity)',
        'claim_name': 'str',
        'filesystem_overhead': 'str',
        'preallocated': 'bool',
        'requests': 'dict(str, K8sIoApimachineryPkgApiResourceQuantity)',
        'volume_mode': 'str'
    }

    attribute_map = {
        'access_modes': 'accessModes',
        'capacity': 'capacity',
        'claim_name': 'claimName',
        'filesystem_overhead': 'filesystemOverhead',
        'preallocated': 'preallocated',
        'requests': 'requests',
        'volume_mode': 'volumeMode'
    }

    def __init__(self, access_modes=None, capacity=None, claim_name=None, filesystem_overhead=None, preallocated=None, requests=None, volume_mode=None, _configuration=None):  # noqa: E501
        """V1PersistentVolumeClaimInfo - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._access_modes = None
        self._capacity = None
        self._claim_name = None
        self._filesystem_overhead = None
        self._preallocated = None
        self._requests = None
        self._volume_mode = None
        self.discriminator = None

        if access_modes is not None:
            self.access_modes = access_modes
        if capacity is not None:
            self.capacity = capacity
        if claim_name is not None:
            self.claim_name = claim_name
        if filesystem_overhead is not None:
            self.filesystem_overhead = filesystem_overhead
        if preallocated is not None:
            self.preallocated = preallocated
        if requests is not None:
            self.requests = requests
        if volume_mode is not None:
            self.volume_mode = volume_mode

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

        AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1  # noqa: E501

        :return: The access_modes of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: list[str]
        """
        return self._access_modes

    @access_modes.setter
    def access_modes(self, access_modes):
        """Sets the access_modes of this V1PersistentVolumeClaimInfo.

        AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1  # noqa: E501

        :param access_modes: The access_modes of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :type: list[str]
        """
        allowed_values = ["ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"]  # noqa: E501
        if (self._configuration.client_side_validation and
                not set(access_modes).issubset(set(allowed_values))):  # noqa: E501
            raise ValueError(
                "Invalid values for `access_modes` [{0}], must be a subset of [{1}]"  # noqa: E501
                .format(", ".join(map(str, set(access_modes) - set(allowed_values))),  # noqa: E501
                        ", ".join(map(str, allowed_values)))
            )

        self._access_modes = access_modes

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

        Capacity represents the capacity set on the corresponding PVC status  # noqa: E501

        :return: The capacity of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: dict(str, K8sIoApimachineryPkgApiResourceQuantity)
        """
        return self._capacity

    @capacity.setter
    def capacity(self, capacity):
        """Sets the capacity of this V1PersistentVolumeClaimInfo.

        Capacity represents the capacity set on the corresponding PVC status  # noqa: E501

        :param capacity: The capacity of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :type: dict(str, K8sIoApimachineryPkgApiResourceQuantity)
        """

        self._capacity = capacity

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

        ClaimName is the name of the PVC  # noqa: E501

        :return: The claim_name of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: str
        """
        return self._claim_name

    @claim_name.setter
    def claim_name(self, claim_name):
        """Sets the claim_name of this V1PersistentVolumeClaimInfo.

        ClaimName is the name of the PVC  # noqa: E501

        :param claim_name: The claim_name of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :type: str
        """

        self._claim_name = claim_name

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

        Percentage of filesystem's size to be reserved when resizing the PVC  # noqa: E501

        :return: The filesystem_overhead of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: str
        """
        return self._filesystem_overhead

    @filesystem_overhead.setter
    def filesystem_overhead(self, filesystem_overhead):
        """Sets the filesystem_overhead of this V1PersistentVolumeClaimInfo.

        Percentage of filesystem's size to be reserved when resizing the PVC  # noqa: E501

        :param filesystem_overhead: The filesystem_overhead of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :type: str
        """

        self._filesystem_overhead = filesystem_overhead

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

        Preallocated indicates if the PVC's storage is preallocated or not  # noqa: E501

        :return: The preallocated of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: bool
        """
        return self._preallocated

    @preallocated.setter
    def preallocated(self, preallocated):
        """Sets the preallocated of this V1PersistentVolumeClaimInfo.

        Preallocated indicates if the PVC's storage is preallocated or not  # noqa: E501

        :param preallocated: The preallocated of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :type: bool
        """

        self._preallocated = preallocated

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

        Requests represents the resources requested by the corresponding PVC spec  # noqa: E501

        :return: The requests of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: dict(str, K8sIoApimachineryPkgApiResourceQuantity)
        """
        return self._requests

    @requests.setter
    def requests(self, requests):
        """Sets the requests of this V1PersistentVolumeClaimInfo.

        Requests represents the resources requested by the corresponding PVC spec  # noqa: E501

        :param requests: The requests of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :type: dict(str, K8sIoApimachineryPkgApiResourceQuantity)
        """

        self._requests = requests

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

        VolumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.  Possible enum values:  - `\"Block\"` means the volume will not be formatted with a filesystem and will remain a raw block device.  - `\"Filesystem\"` means the volume will be or is formatted with a filesystem.  - `\"FromStorageProfile\"` means the volume mode will be auto selected by CDI according to a matching StorageProfile  # noqa: E501

        :return: The volume_mode of this V1PersistentVolumeClaimInfo.  # noqa: E501
        :rtype: str
        """
        return self._volume_mode

    @volume_mode.setter
    def volume_mode(self, volume_mode):
        """Sets the volume_mode of this V1PersistentVolumeClaimInfo.

        VolumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.  Possible enum values:  - `\"Block\"` means the volume will not be formatted with a filesystem and will remain a raw block device.  - `\"Filesystem\"` means the volume will be or is formatted with a filesystem.  - `\"FromStorageProfile\"` means the volume mode will be auto selected by CDI according to a matching StorageProfile  # noqa: E501

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

        self._volume_mode = volume_mode

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

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