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