github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/job_state.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 JobState(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 'create_time': 'str', 37 'job_id': 'str', 38 'shards': 'dict(str, ShardState)', 39 'state': 'JobStateState', 40 'timeout_at': 'str', 41 'update_time': 'str', 42 'version': 'int' 43 } 44 45 attribute_map = { 46 'create_time': 'CreateTime', 47 'job_id': 'JobID', 48 'shards': 'Shards', 49 'state': 'State', 50 'timeout_at': 'TimeoutAt', 51 'update_time': 'UpdateTime', 52 'version': 'Version' 53 } 54 55 def __init__(self, create_time=None, job_id=None, shards=None, state=None, timeout_at=None, update_time=None, version=None, _configuration=None): # noqa: E501 56 """JobState - a model defined in Swagger""" # noqa: E501 57 if _configuration is None: 58 _configuration = Configuration() 59 self._configuration = _configuration 60 61 self._create_time = None 62 self._job_id = None 63 self._shards = None 64 self._state = None 65 self._timeout_at = None 66 self._update_time = None 67 self._version = None 68 self.discriminator = None 69 70 if create_time is not None: 71 self.create_time = create_time 72 if job_id is not None: 73 self.job_id = job_id 74 if shards is not None: 75 self.shards = shards 76 if state is not None: 77 self.state = state 78 if timeout_at is not None: 79 self.timeout_at = timeout_at 80 if update_time is not None: 81 self.update_time = update_time 82 if version is not None: 83 self.version = version 84 85 @property 86 def create_time(self): 87 """Gets the create_time of this JobState. # noqa: E501 88 89 CreateTime is the time when the job was created. # noqa: E501 90 91 :return: The create_time of this JobState. # noqa: E501 92 :rtype: str 93 """ 94 return self._create_time 95 96 @create_time.setter 97 def create_time(self, create_time): 98 """Sets the create_time of this JobState. 99 100 CreateTime is the time when the job was created. # noqa: E501 101 102 :param create_time: The create_time of this JobState. # noqa: E501 103 :type: str 104 """ 105 106 self._create_time = create_time 107 108 @property 109 def job_id(self): 110 """Gets the job_id of this JobState. # noqa: E501 111 112 JobID is the unique identifier for the job # noqa: E501 113 114 :return: The job_id of this JobState. # noqa: E501 115 :rtype: str 116 """ 117 return self._job_id 118 119 @job_id.setter 120 def job_id(self, job_id): 121 """Sets the job_id of this JobState. 122 123 JobID is the unique identifier for the job # noqa: E501 124 125 :param job_id: The job_id of this JobState. # noqa: E501 126 :type: str 127 """ 128 129 self._job_id = job_id 130 131 @property 132 def shards(self): 133 """Gets the shards of this JobState. # noqa: E501 134 135 Shards is a map of shard index to shard state. The number of shards are fixed at the time of job creation. # noqa: E501 136 137 :return: The shards of this JobState. # noqa: E501 138 :rtype: dict(str, ShardState) 139 """ 140 return self._shards 141 142 @shards.setter 143 def shards(self, shards): 144 """Sets the shards of this JobState. 145 146 Shards is a map of shard index to shard state. The number of shards are fixed at the time of job creation. # noqa: E501 147 148 :param shards: The shards of this JobState. # noqa: E501 149 :type: dict(str, ShardState) 150 """ 151 152 self._shards = shards 153 154 @property 155 def state(self): 156 """Gets the state of this JobState. # noqa: E501 157 158 159 :return: The state of this JobState. # noqa: E501 160 :rtype: JobStateState 161 """ 162 return self._state 163 164 @state.setter 165 def state(self, state): 166 """Sets the state of this JobState. 167 168 169 :param state: The state of this JobState. # noqa: E501 170 :type: JobStateState 171 """ 172 173 self._state = state 174 175 @property 176 def timeout_at(self): 177 """Gets the timeout_at of this JobState. # noqa: E501 178 179 TimeoutAt is the time when the job will be timed out if it is not completed. # noqa: E501 180 181 :return: The timeout_at of this JobState. # noqa: E501 182 :rtype: str 183 """ 184 return self._timeout_at 185 186 @timeout_at.setter 187 def timeout_at(self, timeout_at): 188 """Sets the timeout_at of this JobState. 189 190 TimeoutAt is the time when the job will be timed out if it is not completed. # noqa: E501 191 192 :param timeout_at: The timeout_at of this JobState. # noqa: E501 193 :type: str 194 """ 195 196 self._timeout_at = timeout_at 197 198 @property 199 def update_time(self): 200 """Gets the update_time of this JobState. # noqa: E501 201 202 UpdateTime is the time when the job state was last updated. # noqa: E501 203 204 :return: The update_time of this JobState. # noqa: E501 205 :rtype: str 206 """ 207 return self._update_time 208 209 @update_time.setter 210 def update_time(self, update_time): 211 """Sets the update_time of this JobState. 212 213 UpdateTime is the time when the job state was last updated. # noqa: E501 214 215 :param update_time: The update_time of this JobState. # noqa: E501 216 :type: str 217 """ 218 219 self._update_time = update_time 220 221 @property 222 def version(self): 223 """Gets the version of this JobState. # noqa: E501 224 225 Version is the version of the job state. It is incremented every time the job state is updated. # noqa: E501 226 227 :return: The version of this JobState. # noqa: E501 228 :rtype: int 229 """ 230 return self._version 231 232 @version.setter 233 def version(self, version): 234 """Sets the version of this JobState. 235 236 Version is the version of the job state. It is incremented every time the job state is updated. # noqa: E501 237 238 :param version: The version of this JobState. # noqa: E501 239 :type: int 240 """ 241 242 self._version = version 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(JobState, 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, JobState): 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, JobState): 289 return True 290 291 return self.to_dict() != other.to_dict()