github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/job_with_info.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 JobWithInfo(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          'history': 'list[JobHistory]',
    37          'job': 'JobWithInfoJob',
    38          'state': 'JobWithInfoState'
    39      }
    40  
    41      attribute_map = {
    42          'history': 'History',
    43          'job': 'Job',
    44          'state': 'State'
    45      }
    46  
    47      def __init__(self, history=None, job=None, state=None, _configuration=None):  # noqa: E501
    48          """JobWithInfo - a model defined in Swagger"""  # noqa: E501
    49          if _configuration is None:
    50              _configuration = Configuration()
    51          self._configuration = _configuration
    52  
    53          self._history = None
    54          self._job = None
    55          self._state = None
    56          self.discriminator = None
    57  
    58          if history is not None:
    59              self.history = history
    60          if job is not None:
    61              self.job = job
    62          if state is not None:
    63              self.state = state
    64  
    65      @property
    66      def history(self):
    67          """Gets the history of this JobWithInfo.  # noqa: E501
    68  
    69          History of changes to the job state. Not always populated in the job description  # noqa: E501
    70  
    71          :return: The history of this JobWithInfo.  # noqa: E501
    72          :rtype: list[JobHistory]
    73          """
    74          return self._history
    75  
    76      @history.setter
    77      def history(self, history):
    78          """Sets the history of this JobWithInfo.
    79  
    80          History of changes to the job state. Not always populated in the job description  # noqa: E501
    81  
    82          :param history: The history of this JobWithInfo.  # noqa: E501
    83          :type: list[JobHistory]
    84          """
    85  
    86          self._history = history
    87  
    88      @property
    89      def job(self):
    90          """Gets the job of this JobWithInfo.  # noqa: E501
    91  
    92  
    93          :return: The job of this JobWithInfo.  # noqa: E501
    94          :rtype: JobWithInfoJob
    95          """
    96          return self._job
    97  
    98      @job.setter
    99      def job(self, job):
   100          """Sets the job of this JobWithInfo.
   101  
   102  
   103          :param job: The job of this JobWithInfo.  # noqa: E501
   104          :type: JobWithInfoJob
   105          """
   106  
   107          self._job = job
   108  
   109      @property
   110      def state(self):
   111          """Gets the state of this JobWithInfo.  # noqa: E501
   112  
   113  
   114          :return: The state of this JobWithInfo.  # noqa: E501
   115          :rtype: JobWithInfoState
   116          """
   117          return self._state
   118  
   119      @state.setter
   120      def state(self, state):
   121          """Sets the state of this JobWithInfo.
   122  
   123  
   124          :param state: The state of this JobWithInfo.  # noqa: E501
   125          :type: JobWithInfoState
   126          """
   127  
   128          self._state = state
   129  
   130      def to_dict(self):
   131          """Returns the model properties as a dict"""
   132          result = {}
   133  
   134          for attr, _ in six.iteritems(self.swagger_types):
   135              value = getattr(self, attr)
   136              if isinstance(value, list):
   137                  result[attr] = list(map(
   138                      lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
   139                      value
   140                  ))
   141              elif hasattr(value, "to_dict"):
   142                  result[attr] = value.to_dict()
   143              elif isinstance(value, dict):
   144                  result[attr] = dict(map(
   145                      lambda item: (item[0], item[1].to_dict())
   146                      if hasattr(item[1], "to_dict") else item,
   147                      value.items()
   148                  ))
   149              else:
   150                  result[attr] = value
   151          if issubclass(JobWithInfo, dict):
   152              for key, value in self.items():
   153                  result[key] = value
   154  
   155          return result
   156  
   157      def to_str(self):
   158          """Returns the string representation of the model"""
   159          return pprint.pformat(self.to_dict())
   160  
   161      def __repr__(self):
   162          """For `print` and `pprint`"""
   163          return self.to_str()
   164  
   165      def __eq__(self, other):
   166          """Returns true if both objects are equal"""
   167          if not isinstance(other, JobWithInfo):
   168              return False
   169  
   170          return self.to_dict() == other.to_dict()
   171  
   172      def __ne__(self, other):
   173          """Returns true if both objects are not equal"""
   174          if not isinstance(other, JobWithInfo):
   175              return True
   176  
   177          return self.to_dict() != other.to_dict()