github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/execution_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 ExecutionState(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          'compute_reference': 'str',
    37          'create_time': 'str',
    38          'job_id': 'str',
    39          'node_id': 'str',
    40          'published_results': 'StorageSpec',
    41          'run_output': 'ExecutionStateRunOutput',
    42          'shard_index': 'int',
    43          'state': 'ExecutionStateState',
    44          'status': 'str',
    45          'update_time': 'str',
    46          'verification_proposal': 'list[int]',
    47          'verification_result': 'VerificationResult',
    48          'version': 'int'
    49      }
    50  
    51      attribute_map = {
    52          'compute_reference': 'ComputeReference',
    53          'create_time': 'CreateTime',
    54          'job_id': 'JobID',
    55          'node_id': 'NodeId',
    56          'published_results': 'PublishedResults',
    57          'run_output': 'RunOutput',
    58          'shard_index': 'ShardIndex',
    59          'state': 'State',
    60          'status': 'Status',
    61          'update_time': 'UpdateTime',
    62          'verification_proposal': 'VerificationProposal',
    63          'verification_result': 'VerificationResult',
    64          'version': 'Version'
    65      }
    66  
    67      def __init__(self, compute_reference=None, create_time=None, job_id=None, node_id=None, published_results=None, run_output=None, shard_index=None, state=None, status=None, update_time=None, verification_proposal=None, verification_result=None, version=None, _configuration=None):  # noqa: E501
    68          """ExecutionState - a model defined in Swagger"""  # noqa: E501
    69          if _configuration is None:
    70              _configuration = Configuration()
    71          self._configuration = _configuration
    72  
    73          self._compute_reference = None
    74          self._create_time = None
    75          self._job_id = None
    76          self._node_id = None
    77          self._published_results = None
    78          self._run_output = None
    79          self._shard_index = None
    80          self._state = None
    81          self._status = None
    82          self._update_time = None
    83          self._verification_proposal = None
    84          self._verification_result = None
    85          self._version = None
    86          self.discriminator = None
    87  
    88          if compute_reference is not None:
    89              self.compute_reference = compute_reference
    90          if create_time is not None:
    91              self.create_time = create_time
    92          if job_id is not None:
    93              self.job_id = job_id
    94          if node_id is not None:
    95              self.node_id = node_id
    96          if published_results is not None:
    97              self.published_results = published_results
    98          if run_output is not None:
    99              self.run_output = run_output
   100          if shard_index is not None:
   101              self.shard_index = shard_index
   102          if state is not None:
   103              self.state = state
   104          if status is not None:
   105              self.status = status
   106          if update_time is not None:
   107              self.update_time = update_time
   108          if verification_proposal is not None:
   109              self.verification_proposal = verification_proposal
   110          if verification_result is not None:
   111              self.verification_result = verification_result
   112          if version is not None:
   113              self.version = version
   114  
   115      @property
   116      def compute_reference(self):
   117          """Gets the compute_reference of this ExecutionState.  # noqa: E501
   118  
   119          Compute node reference for this shard execution  # noqa: E501
   120  
   121          :return: The compute_reference of this ExecutionState.  # noqa: E501
   122          :rtype: str
   123          """
   124          return self._compute_reference
   125  
   126      @compute_reference.setter
   127      def compute_reference(self, compute_reference):
   128          """Sets the compute_reference of this ExecutionState.
   129  
   130          Compute node reference for this shard execution  # noqa: E501
   131  
   132          :param compute_reference: The compute_reference of this ExecutionState.  # noqa: E501
   133          :type: str
   134          """
   135  
   136          self._compute_reference = compute_reference
   137  
   138      @property
   139      def create_time(self):
   140          """Gets the create_time of this ExecutionState.  # noqa: E501
   141  
   142          CreateTime is the time when the job was created.  # noqa: E501
   143  
   144          :return: The create_time of this ExecutionState.  # noqa: E501
   145          :rtype: str
   146          """
   147          return self._create_time
   148  
   149      @create_time.setter
   150      def create_time(self, create_time):
   151          """Sets the create_time of this ExecutionState.
   152  
   153          CreateTime is the time when the job was created.  # noqa: E501
   154  
   155          :param create_time: The create_time of this ExecutionState.  # noqa: E501
   156          :type: str
   157          """
   158  
   159          self._create_time = create_time
   160  
   161      @property
   162      def job_id(self):
   163          """Gets the job_id of this ExecutionState.  # noqa: E501
   164  
   165          JobID the job id  # noqa: E501
   166  
   167          :return: The job_id of this ExecutionState.  # noqa: E501
   168          :rtype: str
   169          """
   170          return self._job_id
   171  
   172      @job_id.setter
   173      def job_id(self, job_id):
   174          """Sets the job_id of this ExecutionState.
   175  
   176          JobID the job id  # noqa: E501
   177  
   178          :param job_id: The job_id of this ExecutionState.  # noqa: E501
   179          :type: str
   180          """
   181  
   182          self._job_id = job_id
   183  
   184      @property
   185      def node_id(self):
   186          """Gets the node_id of this ExecutionState.  # noqa: E501
   187  
   188          which node is running this execution  # noqa: E501
   189  
   190          :return: The node_id of this ExecutionState.  # noqa: E501
   191          :rtype: str
   192          """
   193          return self._node_id
   194  
   195      @node_id.setter
   196      def node_id(self, node_id):
   197          """Sets the node_id of this ExecutionState.
   198  
   199          which node is running this execution  # noqa: E501
   200  
   201          :param node_id: The node_id of this ExecutionState.  # noqa: E501
   202          :type: str
   203          """
   204  
   205          self._node_id = node_id
   206  
   207      @property
   208      def published_results(self):
   209          """Gets the published_results of this ExecutionState.  # noqa: E501
   210  
   211  
   212          :return: The published_results of this ExecutionState.  # noqa: E501
   213          :rtype: StorageSpec
   214          """
   215          return self._published_results
   216  
   217      @published_results.setter
   218      def published_results(self, published_results):
   219          """Sets the published_results of this ExecutionState.
   220  
   221  
   222          :param published_results: The published_results of this ExecutionState.  # noqa: E501
   223          :type: StorageSpec
   224          """
   225  
   226          self._published_results = published_results
   227  
   228      @property
   229      def run_output(self):
   230          """Gets the run_output of this ExecutionState.  # noqa: E501
   231  
   232  
   233          :return: The run_output of this ExecutionState.  # noqa: E501
   234          :rtype: ExecutionStateRunOutput
   235          """
   236          return self._run_output
   237  
   238      @run_output.setter
   239      def run_output(self, run_output):
   240          """Sets the run_output of this ExecutionState.
   241  
   242  
   243          :param run_output: The run_output of this ExecutionState.  # noqa: E501
   244          :type: ExecutionStateRunOutput
   245          """
   246  
   247          self._run_output = run_output
   248  
   249      @property
   250      def shard_index(self):
   251          """Gets the shard_index of this ExecutionState.  # noqa: E501
   252  
   253          what shard is this we are running  # noqa: E501
   254  
   255          :return: The shard_index of this ExecutionState.  # noqa: E501
   256          :rtype: int
   257          """
   258          return self._shard_index
   259  
   260      @shard_index.setter
   261      def shard_index(self, shard_index):
   262          """Sets the shard_index of this ExecutionState.
   263  
   264          what shard is this we are running  # noqa: E501
   265  
   266          :param shard_index: The shard_index of this ExecutionState.  # noqa: E501
   267          :type: int
   268          """
   269  
   270          self._shard_index = shard_index
   271  
   272      @property
   273      def state(self):
   274          """Gets the state of this ExecutionState.  # noqa: E501
   275  
   276  
   277          :return: The state of this ExecutionState.  # noqa: E501
   278          :rtype: ExecutionStateState
   279          """
   280          return self._state
   281  
   282      @state.setter
   283      def state(self, state):
   284          """Sets the state of this ExecutionState.
   285  
   286  
   287          :param state: The state of this ExecutionState.  # noqa: E501
   288          :type: ExecutionStateState
   289          """
   290  
   291          self._state = state
   292  
   293      @property
   294      def status(self):
   295          """Gets the status of this ExecutionState.  # noqa: E501
   296  
   297          an arbitrary status message  # noqa: E501
   298  
   299          :return: The status of this ExecutionState.  # noqa: E501
   300          :rtype: str
   301          """
   302          return self._status
   303  
   304      @status.setter
   305      def status(self, status):
   306          """Sets the status of this ExecutionState.
   307  
   308          an arbitrary status message  # noqa: E501
   309  
   310          :param status: The status of this ExecutionState.  # noqa: E501
   311          :type: str
   312          """
   313  
   314          self._status = status
   315  
   316      @property
   317      def update_time(self):
   318          """Gets the update_time of this ExecutionState.  # noqa: E501
   319  
   320          UpdateTime is the time when the job state was last updated.  # noqa: E501
   321  
   322          :return: The update_time of this ExecutionState.  # noqa: E501
   323          :rtype: str
   324          """
   325          return self._update_time
   326  
   327      @update_time.setter
   328      def update_time(self, update_time):
   329          """Sets the update_time of this ExecutionState.
   330  
   331          UpdateTime is the time when the job state was last updated.  # noqa: E501
   332  
   333          :param update_time: The update_time of this ExecutionState.  # noqa: E501
   334          :type: str
   335          """
   336  
   337          self._update_time = update_time
   338  
   339      @property
   340      def verification_proposal(self):
   341          """Gets the verification_proposal of this ExecutionState.  # noqa: E501
   342  
   343          the proposed results for this execution this will be resolved by the verifier somehow  # noqa: E501
   344  
   345          :return: The verification_proposal of this ExecutionState.  # noqa: E501
   346          :rtype: list[int]
   347          """
   348          return self._verification_proposal
   349  
   350      @verification_proposal.setter
   351      def verification_proposal(self, verification_proposal):
   352          """Sets the verification_proposal of this ExecutionState.
   353  
   354          the proposed results for this execution this will be resolved by the verifier somehow  # noqa: E501
   355  
   356          :param verification_proposal: The verification_proposal of this ExecutionState.  # noqa: E501
   357          :type: list[int]
   358          """
   359  
   360          self._verification_proposal = verification_proposal
   361  
   362      @property
   363      def verification_result(self):
   364          """Gets the verification_result of this ExecutionState.  # noqa: E501
   365  
   366  
   367          :return: The verification_result of this ExecutionState.  # noqa: E501
   368          :rtype: VerificationResult
   369          """
   370          return self._verification_result
   371  
   372      @verification_result.setter
   373      def verification_result(self, verification_result):
   374          """Sets the verification_result of this ExecutionState.
   375  
   376  
   377          :param verification_result: The verification_result of this ExecutionState.  # noqa: E501
   378          :type: VerificationResult
   379          """
   380  
   381          self._verification_result = verification_result
   382  
   383      @property
   384      def version(self):
   385          """Gets the version of this ExecutionState.  # noqa: E501
   386  
   387          Version is the version of the job state. It is incremented every time the job state is updated.  # noqa: E501
   388  
   389          :return: The version of this ExecutionState.  # noqa: E501
   390          :rtype: int
   391          """
   392          return self._version
   393  
   394      @version.setter
   395      def version(self, version):
   396          """Sets the version of this ExecutionState.
   397  
   398          Version is the version of the job state. It is incremented every time the job state is updated.  # noqa: E501
   399  
   400          :param version: The version of this ExecutionState.  # noqa: E501
   401          :type: int
   402          """
   403  
   404          self._version = version
   405  
   406      def to_dict(self):
   407          """Returns the model properties as a dict"""
   408          result = {}
   409  
   410          for attr, _ in six.iteritems(self.swagger_types):
   411              value = getattr(self, attr)
   412              if isinstance(value, list):
   413                  result[attr] = list(map(
   414                      lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
   415                      value
   416                  ))
   417              elif hasattr(value, "to_dict"):
   418                  result[attr] = value.to_dict()
   419              elif isinstance(value, dict):
   420                  result[attr] = dict(map(
   421                      lambda item: (item[0], item[1].to_dict())
   422                      if hasattr(item[1], "to_dict") else item,
   423                      value.items()
   424                  ))
   425              else:
   426                  result[attr] = value
   427          if issubclass(ExecutionState, dict):
   428              for key, value in self.items():
   429                  result[key] = value
   430  
   431          return result
   432  
   433      def to_str(self):
   434          """Returns the string representation of the model"""
   435          return pprint.pformat(self.to_dict())
   436  
   437      def __repr__(self):
   438          """For `print` and `pprint`"""
   439          return self.to_str()
   440  
   441      def __eq__(self, other):
   442          """Returns true if both objects are equal"""
   443          if not isinstance(other, ExecutionState):
   444              return False
   445  
   446          return self.to_dict() == other.to_dict()
   447  
   448      def __ne__(self, other):
   449          """Returns true if both objects are not equal"""
   450          if not isinstance(other, ExecutionState):
   451              return True
   452  
   453          return self.to_dict() != other.to_dict()