github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/storage_spec.py (about) 1 # coding: utf-8 2 3 """ 4 Bacalhau API 5 6 This page is the reference of the Bacalhau REST API. Project docs are available at https://docs.bacalhau.org/. Find more information about Bacalhau at https://github.com/filecoin-project/bacalhau. # noqa: E501 7 8 OpenAPI spec version: 0.3.22.post4 9 Contact: team@bacalhau.org 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11 """ 12 13 14 import pprint 15 import re # noqa: F401 16 17 import six 18 19 from bacalhau_apiclient.configuration import Configuration 20 21 22 class StorageSpec(object): 23 """NOTE: This class is auto generated by the swagger code generator program. 24 25 Do not edit the class manually. 26 """ 27 28 """ 29 Attributes: 30 swagger_types (dict): The key is attribute name 31 and the value is attribute type. 32 attribute_map (dict): The key is attribute name 33 and the value is json key in definition. 34 """ 35 swagger_types = { 36 'cid': 'str', 37 'metadata': 'dict(str, str)', 38 'name': 'str', 39 'source_path': 'str', 40 'storage_source': 'StorageSpecStorageSource', 41 'url': 'str', 42 'path': 'str' 43 } 44 45 attribute_map = { 46 'cid': 'CID', 47 'metadata': 'Metadata', 48 'name': 'Name', 49 'source_path': 'SourcePath', 50 'storage_source': 'StorageSource', 51 'url': 'URL', 52 'path': 'path' 53 } 54 55 def __init__(self, cid=None, metadata=None, name=None, source_path=None, storage_source=None, url=None, path=None, _configuration=None): # noqa: E501 56 """StorageSpec - a model defined in Swagger""" # noqa: E501 57 if _configuration is None: 58 _configuration = Configuration() 59 self._configuration = _configuration 60 61 self._cid = None 62 self._metadata = None 63 self._name = None 64 self._source_path = None 65 self._storage_source = None 66 self._url = None 67 self._path = None 68 self.discriminator = None 69 70 if cid is not None: 71 self.cid = cid 72 if metadata is not None: 73 self.metadata = metadata 74 if name is not None: 75 self.name = name 76 if source_path is not None: 77 self.source_path = source_path 78 if storage_source is not None: 79 self.storage_source = storage_source 80 if url is not None: 81 self.url = url 82 if path is not None: 83 self.path = path 84 85 @property 86 def cid(self): 87 """Gets the cid of this StorageSpec. # noqa: E501 88 89 The unique ID of the data, where it makes sense (for example, in an IPFS storage spec this will be the data's CID). NOTE: The below is capitalized to match IPFS & IPLD (even though it's out of golang fmt) # noqa: E501 90 91 :return: The cid of this StorageSpec. # noqa: E501 92 :rtype: str 93 """ 94 return self._cid 95 96 @cid.setter 97 def cid(self, cid): 98 """Sets the cid of this StorageSpec. 99 100 The unique ID of the data, where it makes sense (for example, in an IPFS storage spec this will be the data's CID). NOTE: The below is capitalized to match IPFS & IPLD (even though it's out of golang fmt) # noqa: E501 101 102 :param cid: The cid of this StorageSpec. # noqa: E501 103 :type: str 104 """ 105 106 self._cid = cid 107 108 @property 109 def metadata(self): 110 """Gets the metadata of this StorageSpec. # noqa: E501 111 112 Additional properties specific to each driver # noqa: E501 113 114 :return: The metadata of this StorageSpec. # noqa: E501 115 :rtype: dict(str, str) 116 """ 117 return self._metadata 118 119 @metadata.setter 120 def metadata(self, metadata): 121 """Sets the metadata of this StorageSpec. 122 123 Additional properties specific to each driver # noqa: E501 124 125 :param metadata: The metadata of this StorageSpec. # noqa: E501 126 :type: dict(str, str) 127 """ 128 129 self._metadata = metadata 130 131 @property 132 def name(self): 133 """Gets the name of this StorageSpec. # noqa: E501 134 135 Name of the spec's data, for reference. # noqa: E501 136 137 :return: The name of this StorageSpec. # noqa: E501 138 :rtype: str 139 """ 140 return self._name 141 142 @name.setter 143 def name(self, name): 144 """Sets the name of this StorageSpec. 145 146 Name of the spec's data, for reference. # noqa: E501 147 148 :param name: The name of this StorageSpec. # noqa: E501 149 :type: str 150 """ 151 152 self._name = name 153 154 @property 155 def source_path(self): 156 """Gets the source_path of this StorageSpec. # noqa: E501 157 158 The path of the host data if we are using local directory paths # noqa: E501 159 160 :return: The source_path of this StorageSpec. # noqa: E501 161 :rtype: str 162 """ 163 return self._source_path 164 165 @source_path.setter 166 def source_path(self, source_path): 167 """Sets the source_path of this StorageSpec. 168 169 The path of the host data if we are using local directory paths # noqa: E501 170 171 :param source_path: The source_path of this StorageSpec. # noqa: E501 172 :type: str 173 """ 174 175 self._source_path = source_path 176 177 @property 178 def storage_source(self): 179 """Gets the storage_source of this StorageSpec. # noqa: E501 180 181 182 :return: The storage_source of this StorageSpec. # noqa: E501 183 :rtype: StorageSpecStorageSource 184 """ 185 return self._storage_source 186 187 @storage_source.setter 188 def storage_source(self, storage_source): 189 """Sets the storage_source of this StorageSpec. 190 191 192 :param storage_source: The storage_source of this StorageSpec. # noqa: E501 193 :type: StorageSpecStorageSource 194 """ 195 196 self._storage_source = storage_source 197 198 @property 199 def url(self): 200 """Gets the url of this StorageSpec. # noqa: E501 201 202 Source URL of the data # noqa: E501 203 204 :return: The url of this StorageSpec. # noqa: E501 205 :rtype: str 206 """ 207 return self._url 208 209 @url.setter 210 def url(self, url): 211 """Sets the url of this StorageSpec. 212 213 Source URL of the data # noqa: E501 214 215 :param url: The url of this StorageSpec. # noqa: E501 216 :type: str 217 """ 218 219 self._url = url 220 221 @property 222 def path(self): 223 """Gets the path of this StorageSpec. # noqa: E501 224 225 The path that the spec's data should be mounted on, where it makes sense (for example, in a Docker storage spec this will be a filesystem path). TODO: #668 Replace with \"Path\" (note the caps) for yaml/json when we update the n.js file # noqa: E501 226 227 :return: The path of this StorageSpec. # noqa: E501 228 :rtype: str 229 """ 230 return self._path 231 232 @path.setter 233 def path(self, path): 234 """Sets the path of this StorageSpec. 235 236 The path that the spec's data should be mounted on, where it makes sense (for example, in a Docker storage spec this will be a filesystem path). TODO: #668 Replace with \"Path\" (note the caps) for yaml/json when we update the n.js file # noqa: E501 237 238 :param path: The path of this StorageSpec. # noqa: E501 239 :type: str 240 """ 241 242 self._path = path 243 244 def to_dict(self): 245 """Returns the model properties as a dict""" 246 result = {} 247 248 for attr, _ in six.iteritems(self.swagger_types): 249 value = getattr(self, attr) 250 if isinstance(value, list): 251 result[attr] = list(map( 252 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 253 value 254 )) 255 elif hasattr(value, "to_dict"): 256 result[attr] = value.to_dict() 257 elif isinstance(value, dict): 258 result[attr] = dict(map( 259 lambda item: (item[0], item[1].to_dict()) 260 if hasattr(item[1], "to_dict") else item, 261 value.items() 262 )) 263 else: 264 result[attr] = value 265 if issubclass(StorageSpec, dict): 266 for key, value in self.items(): 267 result[key] = value 268 269 return result 270 271 def to_str(self): 272 """Returns the string representation of the model""" 273 return pprint.pformat(self.to_dict()) 274 275 def __repr__(self): 276 """For `print` and `pprint`""" 277 return self.to_str() 278 279 def __eq__(self, other): 280 """Returns true if both objects are equal""" 281 if not isinstance(other, StorageSpec): 282 return False 283 284 return self.to_dict() == other.to_dict() 285 286 def __ne__(self, other): 287 """Returns true if both objects are not equal""" 288 if not isinstance(other, StorageSpec): 289 return True 290 291 return self.to_dict() != other.to_dict()