github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/job_history.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 JobHistory(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 'comment': 'str', 37 'compute_reference': 'str', 38 'job_id': 'str', 39 'new_state': 'str', 40 'new_state_type': 'JobHistoryNewStateType', 41 'new_version': 'int', 42 'node_id': 'str', 43 'previous_state': 'str', 44 'shard_index': 'int', 45 'time': 'str', 46 'type': 'JobHistoryType' 47 } 48 49 attribute_map = { 50 'comment': 'Comment', 51 'compute_reference': 'ComputeReference', 52 'job_id': 'JobID', 53 'new_state': 'NewState', 54 'new_state_type': 'NewStateType', 55 'new_version': 'NewVersion', 56 'node_id': 'NodeID', 57 'previous_state': 'PreviousState', 58 'shard_index': 'ShardIndex', 59 'time': 'Time', 60 'type': 'Type' 61 } 62 63 def __init__(self, comment=None, compute_reference=None, job_id=None, new_state=None, new_state_type=None, new_version=None, node_id=None, previous_state=None, shard_index=None, time=None, type=None, _configuration=None): # noqa: E501 64 """JobHistory - a model defined in Swagger""" # noqa: E501 65 if _configuration is None: 66 _configuration = Configuration() 67 self._configuration = _configuration 68 69 self._comment = None 70 self._compute_reference = None 71 self._job_id = None 72 self._new_state = None 73 self._new_state_type = None 74 self._new_version = None 75 self._node_id = None 76 self._previous_state = None 77 self._shard_index = None 78 self._time = None 79 self._type = None 80 self.discriminator = None 81 82 if comment is not None: 83 self.comment = comment 84 if compute_reference is not None: 85 self.compute_reference = compute_reference 86 if job_id is not None: 87 self.job_id = job_id 88 if new_state is not None: 89 self.new_state = new_state 90 if new_state_type is not None: 91 self.new_state_type = new_state_type 92 if new_version is not None: 93 self.new_version = new_version 94 if node_id is not None: 95 self.node_id = node_id 96 if previous_state is not None: 97 self.previous_state = previous_state 98 if shard_index is not None: 99 self.shard_index = shard_index 100 if time is not None: 101 self.time = time 102 if type is not None: 103 self.type = type 104 105 @property 106 def comment(self): 107 """Gets the comment of this JobHistory. # noqa: E501 108 109 110 :return: The comment of this JobHistory. # noqa: E501 111 :rtype: str 112 """ 113 return self._comment 114 115 @comment.setter 116 def comment(self, comment): 117 """Sets the comment of this JobHistory. 118 119 120 :param comment: The comment of this JobHistory. # noqa: E501 121 :type: str 122 """ 123 124 self._comment = comment 125 126 @property 127 def compute_reference(self): 128 """Gets the compute_reference of this JobHistory. # noqa: E501 129 130 131 :return: The compute_reference of this JobHistory. # noqa: E501 132 :rtype: str 133 """ 134 return self._compute_reference 135 136 @compute_reference.setter 137 def compute_reference(self, compute_reference): 138 """Sets the compute_reference of this JobHistory. 139 140 141 :param compute_reference: The compute_reference of this JobHistory. # noqa: E501 142 :type: str 143 """ 144 145 self._compute_reference = compute_reference 146 147 @property 148 def job_id(self): 149 """Gets the job_id of this JobHistory. # noqa: E501 150 151 152 :return: The job_id of this JobHistory. # noqa: E501 153 :rtype: str 154 """ 155 return self._job_id 156 157 @job_id.setter 158 def job_id(self, job_id): 159 """Sets the job_id of this JobHistory. 160 161 162 :param job_id: The job_id of this JobHistory. # noqa: E501 163 :type: str 164 """ 165 166 self._job_id = job_id 167 168 @property 169 def new_state(self): 170 """Gets the new_state of this JobHistory. # noqa: E501 171 172 173 :return: The new_state of this JobHistory. # noqa: E501 174 :rtype: str 175 """ 176 return self._new_state 177 178 @new_state.setter 179 def new_state(self, new_state): 180 """Sets the new_state of this JobHistory. 181 182 183 :param new_state: The new_state of this JobHistory. # noqa: E501 184 :type: str 185 """ 186 187 self._new_state = new_state 188 189 @property 190 def new_state_type(self): 191 """Gets the new_state_type of this JobHistory. # noqa: E501 192 193 194 :return: The new_state_type of this JobHistory. # noqa: E501 195 :rtype: JobHistoryNewStateType 196 """ 197 return self._new_state_type 198 199 @new_state_type.setter 200 def new_state_type(self, new_state_type): 201 """Sets the new_state_type of this JobHistory. 202 203 204 :param new_state_type: The new_state_type of this JobHistory. # noqa: E501 205 :type: JobHistoryNewStateType 206 """ 207 208 self._new_state_type = new_state_type 209 210 @property 211 def new_version(self): 212 """Gets the new_version of this JobHistory. # noqa: E501 213 214 215 :return: The new_version of this JobHistory. # noqa: E501 216 :rtype: int 217 """ 218 return self._new_version 219 220 @new_version.setter 221 def new_version(self, new_version): 222 """Sets the new_version of this JobHistory. 223 224 225 :param new_version: The new_version of this JobHistory. # noqa: E501 226 :type: int 227 """ 228 229 self._new_version = new_version 230 231 @property 232 def node_id(self): 233 """Gets the node_id of this JobHistory. # noqa: E501 234 235 236 :return: The node_id of this JobHistory. # noqa: E501 237 :rtype: str 238 """ 239 return self._node_id 240 241 @node_id.setter 242 def node_id(self, node_id): 243 """Sets the node_id of this JobHistory. 244 245 246 :param node_id: The node_id of this JobHistory. # noqa: E501 247 :type: str 248 """ 249 250 self._node_id = node_id 251 252 @property 253 def previous_state(self): 254 """Gets the previous_state of this JobHistory. # noqa: E501 255 256 257 :return: The previous_state of this JobHistory. # noqa: E501 258 :rtype: str 259 """ 260 return self._previous_state 261 262 @previous_state.setter 263 def previous_state(self, previous_state): 264 """Sets the previous_state of this JobHistory. 265 266 267 :param previous_state: The previous_state of this JobHistory. # noqa: E501 268 :type: str 269 """ 270 271 self._previous_state = previous_state 272 273 @property 274 def shard_index(self): 275 """Gets the shard_index of this JobHistory. # noqa: E501 276 277 278 :return: The shard_index of this JobHistory. # noqa: E501 279 :rtype: int 280 """ 281 return self._shard_index 282 283 @shard_index.setter 284 def shard_index(self, shard_index): 285 """Sets the shard_index of this JobHistory. 286 287 288 :param shard_index: The shard_index of this JobHistory. # noqa: E501 289 :type: int 290 """ 291 292 self._shard_index = shard_index 293 294 @property 295 def time(self): 296 """Gets the time of this JobHistory. # noqa: E501 297 298 299 :return: The time of this JobHistory. # noqa: E501 300 :rtype: str 301 """ 302 return self._time 303 304 @time.setter 305 def time(self, time): 306 """Sets the time of this JobHistory. 307 308 309 :param time: The time of this JobHistory. # noqa: E501 310 :type: str 311 """ 312 313 self._time = time 314 315 @property 316 def type(self): 317 """Gets the type of this JobHistory. # noqa: E501 318 319 320 :return: The type of this JobHistory. # noqa: E501 321 :rtype: JobHistoryType 322 """ 323 return self._type 324 325 @type.setter 326 def type(self, type): 327 """Sets the type of this JobHistory. 328 329 330 :param type: The type of this JobHistory. # noqa: E501 331 :type: JobHistoryType 332 """ 333 334 self._type = type 335 336 def to_dict(self): 337 """Returns the model properties as a dict""" 338 result = {} 339 340 for attr, _ in six.iteritems(self.swagger_types): 341 value = getattr(self, attr) 342 if isinstance(value, list): 343 result[attr] = list(map( 344 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 345 value 346 )) 347 elif hasattr(value, "to_dict"): 348 result[attr] = value.to_dict() 349 elif isinstance(value, dict): 350 result[attr] = dict(map( 351 lambda item: (item[0], item[1].to_dict()) 352 if hasattr(item[1], "to_dict") else item, 353 value.items() 354 )) 355 else: 356 result[attr] = value 357 if issubclass(JobHistory, dict): 358 for key, value in self.items(): 359 result[key] = value 360 361 return result 362 363 def to_str(self): 364 """Returns the string representation of the model""" 365 return pprint.pformat(self.to_dict()) 366 367 def __repr__(self): 368 """For `print` and `pprint`""" 369 return self.to_str() 370 371 def __eq__(self, other): 372 """Returns true if both objects are equal""" 373 if not isinstance(other, JobHistory): 374 return False 375 376 return self.to_dict() == other.to_dict() 377 378 def __ne__(self, other): 379 """Returns true if both objects are not equal""" 380 if not isinstance(other, JobHistory): 381 return True 382 383 return self.to_dict() != other.to_dict()