1# coding: utf-8 2""" 3 Kubernetes 4 5 No description provided (generated by Swagger Codegen 6 https://github.com/swagger-api/swagger-codegen) 7 8 OpenAPI spec version: v1.14.4 9 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11""" 12 13from pprint import pformat 14from six import iteritems 15import re 16 17 18class V1CSIVolumeSource(object): 19 """ 20 NOTE: This class is auto generated by the swagger code generator program. 21 Do not edit the class manually. 22 """ 23 """ 24 Attributes: 25 swagger_types (dict): The key is attribute name and the value is attribute 26 type. 27 attribute_map (dict): The key is attribute name and the value is json key 28 in definition. 29 """ 30 swagger_types = { 31 'driver': 'str', 32 'fs_type': 'str', 33 'node_publish_secret_ref': 'V1LocalObjectReference', 34 'read_only': 'bool', 35 'volume_attributes': 'dict(str, str)' 36 } 37 38 attribute_map = { 39 'driver': 'driver', 40 'fs_type': 'fsType', 41 'node_publish_secret_ref': 'nodePublishSecretRef', 42 'read_only': 'readOnly', 43 'volume_attributes': 'volumeAttributes' 44 } 45 46 def __init__(self, 47 driver=None, 48 fs_type=None, 49 node_publish_secret_ref=None, 50 read_only=None, 51 volume_attributes=None): 52 """ 53 V1CSIVolumeSource - a model defined in Swagger 54 """ 55 56 self._driver = None 57 self._fs_type = None 58 self._node_publish_secret_ref = None 59 self._read_only = None 60 self._volume_attributes = None 61 self.discriminator = None 62 63 self.driver = driver 64 if fs_type is not None: 65 self.fs_type = fs_type 66 if node_publish_secret_ref is not None: 67 self.node_publish_secret_ref = node_publish_secret_ref 68 if read_only is not None: 69 self.read_only = read_only 70 if volume_attributes is not None: 71 self.volume_attributes = volume_attributes 72 73 @property 74 def driver(self): 75 """ 76 Gets the driver of this V1CSIVolumeSource. 77 Driver is the name of the CSI driver that handles this volume. Consult 78 with your admin for the correct name as registered in the cluster. 79 80 :return: The driver of this V1CSIVolumeSource. 81 :rtype: str 82 """ 83 return self._driver 84 85 @driver.setter 86 def driver(self, driver): 87 """ 88 Sets the driver of this V1CSIVolumeSource. 89 Driver is the name of the CSI driver that handles this volume. Consult 90 with your admin for the correct name as registered in the cluster. 91 92 :param driver: The driver of this V1CSIVolumeSource. 93 :type: str 94 """ 95 if driver is None: 96 raise ValueError('Invalid value for `driver`, must not be `None`') 97 98 self._driver = driver 99 100 @property 101 def fs_type(self): 102 """ 103 Gets the fs_type of this V1CSIVolumeSource. 104 Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not 105 provided, the empty value is passed to the associated CSI driver which 106 will determine the default filesystem to apply. 107 108 :return: The fs_type of this V1CSIVolumeSource. 109 :rtype: str 110 """ 111 return self._fs_type 112 113 @fs_type.setter 114 def fs_type(self, fs_type): 115 """ 116 Sets the fs_type of this V1CSIVolumeSource. 117 Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not 118 provided, the empty value is passed to the associated CSI driver which 119 will determine the default filesystem to apply. 120 121 :param fs_type: The fs_type of this V1CSIVolumeSource. 122 :type: str 123 """ 124 125 self._fs_type = fs_type 126 127 @property 128 def node_publish_secret_ref(self): 129 """ 130 Gets the node_publish_secret_ref of this V1CSIVolumeSource. 131 NodePublishSecretRef is a reference to the secret object containing 132 sensitive information to pass to the CSI driver to complete the CSI 133 NodePublishVolume and NodeUnpublishVolume calls. This field is optional, 134 and may be empty if no secret is required. If the secret object 135 contains more than one secret, all secret references are passed. 136 137 :return: The node_publish_secret_ref of this V1CSIVolumeSource. 138 :rtype: V1LocalObjectReference 139 """ 140 return self._node_publish_secret_ref 141 142 @node_publish_secret_ref.setter 143 def node_publish_secret_ref(self, node_publish_secret_ref): 144 """ 145 Sets the node_publish_secret_ref of this V1CSIVolumeSource. 146 NodePublishSecretRef is a reference to the secret object containing 147 sensitive information to pass to the CSI driver to complete the CSI 148 NodePublishVolume and NodeUnpublishVolume calls. This field is optional, 149 and may be empty if no secret is required. If the secret object 150 contains more than one secret, all secret references are passed. 151 152 :param node_publish_secret_ref: The node_publish_secret_ref of this 153 V1CSIVolumeSource. 154 :type: V1LocalObjectReference 155 """ 156 157 self._node_publish_secret_ref = node_publish_secret_ref 158 159 @property 160 def read_only(self): 161 """ 162 Gets the read_only of this V1CSIVolumeSource. 163 Specifies a read-only configuration for the volume. Defaults to false 164 (read/write). 165 166 :return: The read_only of this V1CSIVolumeSource. 167 :rtype: bool 168 """ 169 return self._read_only 170 171 @read_only.setter 172 def read_only(self, read_only): 173 """ 174 Sets the read_only of this V1CSIVolumeSource. 175 Specifies a read-only configuration for the volume. Defaults to false 176 (read/write). 177 178 :param read_only: The read_only of this V1CSIVolumeSource. 179 :type: bool 180 """ 181 182 self._read_only = read_only 183 184 @property 185 def volume_attributes(self): 186 """ 187 Gets the volume_attributes of this V1CSIVolumeSource. 188 VolumeAttributes stores driver-specific properties that are passed to 189 the CSI driver. Consult your driver's documentation for supported 190 values. 191 192 :return: The volume_attributes of this V1CSIVolumeSource. 193 :rtype: dict(str, str) 194 """ 195 return self._volume_attributes 196 197 @volume_attributes.setter 198 def volume_attributes(self, volume_attributes): 199 """ 200 Sets the volume_attributes of this V1CSIVolumeSource. 201 VolumeAttributes stores driver-specific properties that are passed to 202 the CSI driver. Consult your driver's documentation for supported 203 values. 204 205 :param volume_attributes: The volume_attributes of this 206 V1CSIVolumeSource. 207 :type: dict(str, str) 208 """ 209 210 self._volume_attributes = volume_attributes 211 212 def to_dict(self): 213 """ 214 Returns the model properties as a dict 215 """ 216 result = {} 217 218 for attr, _ in iteritems(self.swagger_types): 219 value = getattr(self, attr) 220 if isinstance(value, list): 221 result[attr] = list( 222 map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value)) 223 elif hasattr(value, 'to_dict'): 224 result[attr] = value.to_dict() 225 elif isinstance(value, dict): 226 result[attr] = dict( 227 map( 228 lambda item: (item[0], item[1].to_dict()) 229 if hasattr(item[1], 'to_dict') else item, value.items())) 230 else: 231 result[attr] = value 232 233 return result 234 235 def to_str(self): 236 """ 237 Returns the string representation of the model 238 """ 239 return pformat(self.to_dict()) 240 241 def __repr__(self): 242 """ 243 For `print` and `pprint` 244 """ 245 return self.to_str() 246 247 def __eq__(self, other): 248 """ 249 Returns true if both objects are equal 250 """ 251 if not isinstance(other, V1CSIVolumeSource): 252 return False 253 254 return self.__dict__ == other.__dict__ 255 256 def __ne__(self, other): 257 """ 258 Returns true if both objects are not equal 259 """ 260 return not self == other 261