github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/job_execution_plan.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 JobExecutionPlan(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          'shards_total': 'int'
    37      }
    38  
    39      attribute_map = {
    40          'shards_total': 'ShardsTotal'
    41      }
    42  
    43      def __init__(self, shards_total=None, _configuration=None):  # noqa: E501
    44          """JobExecutionPlan - a model defined in Swagger"""  # noqa: E501
    45          if _configuration is None:
    46              _configuration = Configuration()
    47          self._configuration = _configuration
    48  
    49          self._shards_total = None
    50          self.discriminator = None
    51  
    52          if shards_total is not None:
    53              self.shards_total = shards_total
    54  
    55      @property
    56      def shards_total(self):
    57          """Gets the shards_total of this JobExecutionPlan.  # noqa: E501
    58  
    59          how many shards are there in total for this job we are expecting this number x concurrency total ShardState objects for this job  # noqa: E501
    60  
    61          :return: The shards_total of this JobExecutionPlan.  # noqa: E501
    62          :rtype: int
    63          """
    64          return self._shards_total
    65  
    66      @shards_total.setter
    67      def shards_total(self, shards_total):
    68          """Sets the shards_total of this JobExecutionPlan.
    69  
    70          how many shards are there in total for this job we are expecting this number x concurrency total ShardState objects for this job  # noqa: E501
    71  
    72          :param shards_total: The shards_total of this JobExecutionPlan.  # noqa: E501
    73          :type: int
    74          """
    75  
    76          self._shards_total = shards_total
    77  
    78      def to_dict(self):
    79          """Returns the model properties as a dict"""
    80          result = {}
    81  
    82          for attr, _ in six.iteritems(self.swagger_types):
    83              value = getattr(self, attr)
    84              if isinstance(value, list):
    85                  result[attr] = list(map(
    86                      lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
    87                      value
    88                  ))
    89              elif hasattr(value, "to_dict"):
    90                  result[attr] = value.to_dict()
    91              elif isinstance(value, dict):
    92                  result[attr] = dict(map(
    93                      lambda item: (item[0], item[1].to_dict())
    94                      if hasattr(item[1], "to_dict") else item,
    95                      value.items()
    96                  ))
    97              else:
    98                  result[attr] = value
    99          if issubclass(JobExecutionPlan, dict):
   100              for key, value in self.items():
   101                  result[key] = value
   102  
   103          return result
   104  
   105      def to_str(self):
   106          """Returns the string representation of the model"""
   107          return pprint.pformat(self.to_dict())
   108  
   109      def __repr__(self):
   110          """For `print` and `pprint`"""
   111          return self.to_str()
   112  
   113      def __eq__(self, other):
   114          """Returns true if both objects are equal"""
   115          if not isinstance(other, JobExecutionPlan):
   116              return False
   117  
   118          return self.to_dict() == other.to_dict()
   119  
   120      def __ne__(self, other):
   121          """Returns true if both objects are not equal"""
   122          if not isinstance(other, JobExecutionPlan):
   123              return True
   124  
   125          return self.to_dict() != other.to_dict()