codekingpro/portable-devtools
114k
1# coding: utf-82 3"""4 Kubernetes5 6 No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E5017 8 The version of the OpenAPI document: release-1.359 Generated by: https://openapi-generator.tech10"""11 12 13import pprint14import re # noqa: F40115 16import six17 18from kubernetes.client.configuration import Configuration19 20 21class V1VolumeMount(object):22 """NOTE: This class is auto generated by OpenAPI Generator.23 Ref: https://openapi-generator.tech24 25 Do not edit the class manually.26 """27 28 """29 Attributes:30 openapi_types (dict): The key is attribute name31 and the value is attribute type.32 attribute_map (dict): The key is attribute name33 and the value is json key in definition.34 """35 openapi_types = {36 'mount_path': 'str',37 'mount_propagation': 'str',38 'name': 'str',39 'read_only': 'bool',40 'recursive_read_only': 'str',41 'sub_path': 'str',42 'sub_path_expr': 'str'43 }44 45 attribute_map = {46 'mount_path': 'mountPath',47 'mount_propagation': 'mountPropagation',48 'name': 'name',49 'read_only': 'readOnly',50 'recursive_read_only': 'recursiveReadOnly',51 'sub_path': 'subPath',52 'sub_path_expr': 'subPathExpr'53 }54 55 def __init__(self, mount_path=None, mount_propagation=None, name=None, read_only=None, recursive_read_only=None, sub_path=None, sub_path_expr=None, local_vars_configuration=None): # noqa: E50156 """V1VolumeMount - a model defined in OpenAPI""" # noqa: E50157 if local_vars_configuration is None:58 local_vars_configuration = Configuration()59 self.local_vars_configuration = local_vars_configuration60 61 self._mount_path = None62 self._mount_propagation = None63 self._name = None64 self._read_only = None65 self._recursive_read_only = None66 self._sub_path = None67 self._sub_path_expr = None68 self.discriminator = None69 70 self.mount_path = mount_path71 if mount_propagation is not None:72 self.mount_propagation = mount_propagation73 self.name = name74 if read_only is not None:75 self.read_only = read_only76 if recursive_read_only is not None:77 self.recursive_read_only = recursive_read_only78 if sub_path is not None:79 self.sub_path = sub_path80 if sub_path_expr is not None:81 self.sub_path_expr = sub_path_expr82 83 @property84 def mount_path(self):85 """Gets the mount_path of this V1VolumeMount. # noqa: E50186 87 Path within the container at which the volume should be mounted. Must not contain ':'. # noqa: E50188 89 :return: The mount_path of this V1VolumeMount. # noqa: E50190 :rtype: str91 """92 return self._mount_path93 94 @mount_path.setter95 def mount_path(self, mount_path):96 """Sets the mount_path of this V1VolumeMount.97 98 Path within the container at which the volume should be mounted. Must not contain ':'. # noqa: E50199 100 :param mount_path: The mount_path of this V1VolumeMount. # noqa: E501101 :type: str102 """103 if self.local_vars_configuration.client_side_validation and mount_path is None: # noqa: E501104 raise ValueError("Invalid value for `mount_path`, must not be `None`") # noqa: E501105 106 self._mount_path = mount_path107 108 @property109 def mount_propagation(self):110 """Gets the mount_propagation of this V1VolumeMount. # noqa: E501111 112 mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified (which defaults to None). # noqa: E501113 114 :return: The mount_propagation of this V1VolumeMount. # noqa: E501115 :rtype: str116 """117 return self._mount_propagation118 119 @mount_propagation.setter120 def mount_propagation(self, mount_propagation):121 """Sets the mount_propagation of this V1VolumeMount.122 123 mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified (which defaults to None). # noqa: E501124 125 :param mount_propagation: The mount_propagation of this V1VolumeMount. # noqa: E501126 :type: str127 """128 129 self._mount_propagation = mount_propagation130 131 @property132 def name(self):133 """Gets the name of this V1VolumeMount. # noqa: E501134 135 This must match the Name of a Volume. # noqa: E501136 137 :return: The name of this V1VolumeMount. # noqa: E501138 :rtype: str139 """140 return self._name141 142 @name.setter143 def name(self, name):144 """Sets the name of this V1VolumeMount.145 146 This must match the Name of a Volume. # noqa: E501147 148 :param name: The name of this V1VolumeMount. # noqa: E501149 :type: str150 """151 if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501152 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501153 154 self._name = name155 156 @property157 def read_only(self):158 """Gets the read_only of this V1VolumeMount. # noqa: E501159 160 Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. # noqa: E501161 162 :return: The read_only of this V1VolumeMount. # noqa: E501163 :rtype: bool164 """165 return self._read_only166 167 @read_only.setter168 def read_only(self, read_only):169 """Sets the read_only of this V1VolumeMount.170 171 Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. # noqa: E501172 173 :param read_only: The read_only of this V1VolumeMount. # noqa: E501174 :type: bool175 """176 177 self._read_only = read_only178 179 @property180 def recursive_read_only(self):181 """Gets the recursive_read_only of this V1VolumeMount. # noqa: E501182 183 RecursiveReadOnly specifies whether read-only mounts should be handled recursively. If ReadOnly is false, this field has no meaning and must be unspecified. If ReadOnly is true, and this field is set to Disabled, the mount is not made recursively read-only. If this field is set to IfPossible, the mount is made recursively read-only, if it is supported by the container runtime. If this field is set to Enabled, the mount is made recursively read-only if it is supported by the container runtime, otherwise the pod will not be started and an error will be generated to indicate the reason. If this field is set to IfPossible or Enabled, MountPropagation must be set to None (or be unspecified, which defaults to None). If this field is not specified, it is treated as an equivalent of Disabled. # noqa: E501184 185 :return: The recursive_read_only of this V1VolumeMount. # noqa: E501186 :rtype: str187 """188 return self._recursive_read_only189 190 @recursive_read_only.setter191 def recursive_read_only(self, recursive_read_only):192 """Sets the recursive_read_only of this V1VolumeMount.193 194 RecursiveReadOnly specifies whether read-only mounts should be handled recursively. If ReadOnly is false, this field has no meaning and must be unspecified. If ReadOnly is true, and this field is set to Disabled, the mount is not made recursively read-only. If this field is set to IfPossible, the mount is made recursively read-only, if it is supported by the container runtime. If this field is set to Enabled, the mount is made recursively read-only if it is supported by the container runtime, otherwise the pod will not be started and an error will be generated to indicate the reason. If this field is set to IfPossible or Enabled, MountPropagation must be set to None (or be unspecified, which defaults to None). If this field is not specified, it is treated as an equivalent of Disabled. # noqa: E501195 196 :param recursive_read_only: The recursive_read_only of this V1VolumeMount. # noqa: E501197 :type: str198 """199 200 self._recursive_read_only = recursive_read_only201 202 @property203 def sub_path(self):204 """Gets the sub_path of this V1VolumeMount. # noqa: E501205 206 Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root). # noqa: E501207 208 :return: The sub_path of this V1VolumeMount. # noqa: E501209 :rtype: str210 """211 return self._sub_path212 213 @sub_path.setter214 def sub_path(self, sub_path):215 """Sets the sub_path of this V1VolumeMount.216 217 Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root). # noqa: E501218 219 :param sub_path: The sub_path of this V1VolumeMount. # noqa: E501220 :type: str221 """222 223 self._sub_path = sub_path224 225 @property226 def sub_path_expr(self):227 """Gets the sub_path_expr of this V1VolumeMount. # noqa: E501228 229 Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. # noqa: E501230 231 :return: The sub_path_expr of this V1VolumeMount. # noqa: E501232 :rtype: str233 """234 return self._sub_path_expr235 236 @sub_path_expr.setter237 def sub_path_expr(self, sub_path_expr):238 """Sets the sub_path_expr of this V1VolumeMount.239 240 Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. # noqa: E501241 242 :param sub_path_expr: The sub_path_expr of this V1VolumeMount. # noqa: E501243 :type: str244 """245 246 self._sub_path_expr = sub_path_expr247 248 def to_dict(self):249 """Returns the model properties as a dict"""250 result = {}251 252 for attr, _ in six.iteritems(self.openapi_types):253 value = getattr(self, attr)254 if isinstance(value, list):255 result[attr] = list(map(256 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,257 value258 ))259 elif hasattr(value, "to_dict"):260 result[attr] = value.to_dict()261 elif isinstance(value, dict):262 result[attr] = dict(map(263 lambda item: (item[0], item[1].to_dict())264 if hasattr(item[1], "to_dict") else item,265 value.items()266 ))267 else:268 result[attr] = value269 270 return result271 272 def to_str(self):273 """Returns the string representation of the model"""274 return pprint.pformat(self.to_dict())275 276 def __repr__(self):277 """For `print` and `pprint`"""278 return self.to_str()279 280 def __eq__(self, other):281 """Returns true if both objects are equal"""282 if not isinstance(other, V1VolumeMount):283 return False284 285 return self.to_dict() == other.to_dict()286 287 def __ne__(self, other):288 """Returns true if both objects are not equal"""289 if not isinstance(other, V1VolumeMount):290 return True291 292 return self.to_dict() != other.to_dict()293 