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 V1GCEPersistentDiskVolumeSource(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 'fs_type': 'str', 32 'partition': 'int', 33 'pd_name': 'str', 34 'read_only': 'bool' 35 } 36 37 attribute_map = { 38 'fs_type': 'fsType', 39 'partition': 'partition', 40 'pd_name': 'pdName', 41 'read_only': 'readOnly' 42 } 43 44 def __init__(self, 45 fs_type=None, 46 partition=None, 47 pd_name=None, 48 read_only=None): 49 """ 50 V1GCEPersistentDiskVolumeSource - a model defined in Swagger 51 """ 52 53 self._fs_type = None 54 self._partition = None 55 self._pd_name = None 56 self._read_only = None 57 self.discriminator = None 58 59 if fs_type is not None: 60 self.fs_type = fs_type 61 if partition is not None: 62 self.partition = partition 63 self.pd_name = pd_name 64 if read_only is not None: 65 self.read_only = read_only 66 67 @property 68 def fs_type(self): 69 """ 70 Gets the fs_type of this V1GCEPersistentDiskVolumeSource. 71 Filesystem type of the volume that you want to mount. Tip: Ensure that 72 the filesystem type is supported by the host operating system. Examples: 73 \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if 74 unspecified. More info: 75 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 76 77 :return: The fs_type of this V1GCEPersistentDiskVolumeSource. 78 :rtype: str 79 """ 80 return self._fs_type 81 82 @fs_type.setter 83 def fs_type(self, fs_type): 84 """ 85 Sets the fs_type of this V1GCEPersistentDiskVolumeSource. 86 Filesystem type of the volume that you want to mount. Tip: Ensure that 87 the filesystem type is supported by the host operating system. Examples: 88 \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if 89 unspecified. More info: 90 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 91 92 :param fs_type: The fs_type of this V1GCEPersistentDiskVolumeSource. 93 :type: str 94 """ 95 96 self._fs_type = fs_type 97 98 @property 99 def partition(self): 100 """ 101 Gets the partition of this V1GCEPersistentDiskVolumeSource. 102 The partition in the volume that you want to mount. If omitted, the 103 default is to mount by volume name. Examples: For volume /dev/sda1, you 104 specify the partition as \"1\". Similarly, the volume partition for 105 /dev/sda is \"0\" (or you can leave the property empty). More info: 106 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 107 108 :return: The partition of this V1GCEPersistentDiskVolumeSource. 109 :rtype: int 110 """ 111 return self._partition 112 113 @partition.setter 114 def partition(self, partition): 115 """ 116 Sets the partition of this V1GCEPersistentDiskVolumeSource. 117 The partition in the volume that you want to mount. If omitted, the 118 default is to mount by volume name. Examples: For volume /dev/sda1, you 119 specify the partition as \"1\". Similarly, the volume partition for 120 /dev/sda is \"0\" (or you can leave the property empty). More info: 121 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 122 123 :param partition: The partition of this V1GCEPersistentDiskVolumeSource. 124 :type: int 125 """ 126 127 self._partition = partition 128 129 @property 130 def pd_name(self): 131 """ 132 Gets the pd_name of this V1GCEPersistentDiskVolumeSource. 133 Unique name of the PD resource in GCE. Used to identify the disk in GCE. 134 More info: 135 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 136 137 :return: The pd_name of this V1GCEPersistentDiskVolumeSource. 138 :rtype: str 139 """ 140 return self._pd_name 141 142 @pd_name.setter 143 def pd_name(self, pd_name): 144 """ 145 Sets the pd_name of this V1GCEPersistentDiskVolumeSource. 146 Unique name of the PD resource in GCE. Used to identify the disk in GCE. 147 More info: 148 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 149 150 :param pd_name: The pd_name of this V1GCEPersistentDiskVolumeSource. 151 :type: str 152 """ 153 if pd_name is None: 154 raise ValueError('Invalid value for `pd_name`, must not be `None`') 155 156 self._pd_name = pd_name 157 158 @property 159 def read_only(self): 160 """ 161 Gets the read_only of this V1GCEPersistentDiskVolumeSource. 162 ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults 163 to false. More info: 164 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 165 166 :return: The read_only of this V1GCEPersistentDiskVolumeSource. 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 V1GCEPersistentDiskVolumeSource. 175 ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults 176 to false. More info: 177 https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 178 179 :param read_only: The read_only of this V1GCEPersistentDiskVolumeSource. 180 :type: bool 181 """ 182 183 self._read_only = read_only 184 185 def to_dict(self): 186 """ 187 Returns the model properties as a dict 188 """ 189 result = {} 190 191 for attr, _ in iteritems(self.swagger_types): 192 value = getattr(self, attr) 193 if isinstance(value, list): 194 result[attr] = list( 195 map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value)) 196 elif hasattr(value, 'to_dict'): 197 result[attr] = value.to_dict() 198 elif isinstance(value, dict): 199 result[attr] = dict( 200 map( 201 lambda item: (item[0], item[1].to_dict()) 202 if hasattr(item[1], 'to_dict') else item, value.items())) 203 else: 204 result[attr] = value 205 206 return result 207 208 def to_str(self): 209 """ 210 Returns the string representation of the model 211 """ 212 return pformat(self.to_dict()) 213 214 def __repr__(self): 215 """ 216 For `print` and `pprint` 217 """ 218 return self.to_str() 219 220 def __eq__(self, other): 221 """ 222 Returns true if both objects are equal 223 """ 224 if not isinstance(other, V1GCEPersistentDiskVolumeSource): 225 return False 226 227 return self.__dict__ == other.__dict__ 228 229 def __ne__(self, other): 230 """ 231 Returns true if both objects are not equal 232 """ 233 return not self == other 234