github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/spec.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 Spec(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          'annotations': 'list[str]',
    37          'contexts': 'list[StorageSpec]',
    38          'deal': 'SpecDeal',
    39          'do_not_track': 'bool',
    40          'docker': 'SpecDocker',
    41          'engine': 'SpecEngine',
    42          'execution_plan': 'SpecExecutionPlan',
    43          'language': 'JobSpecLanguage',
    44          'network': 'SpecNetwork',
    45          'node_selectors': 'list[LabelSelectorRequirement]',
    46          'publisher': 'SpecPublisher',
    47          'resources': 'SpecResources',
    48          'sharding': 'SpecSharding',
    49          'timeout': 'float',
    50          'verifier': 'Verifier',
    51          'wasm': 'JobSpecWasm',
    52          'inputs': 'list[StorageSpec]',
    53          'outputs': 'list[StorageSpec]'
    54      }
    55  
    56      attribute_map = {
    57          'annotations': 'Annotations',
    58          'contexts': 'Contexts',
    59          'deal': 'Deal',
    60          'do_not_track': 'DoNotTrack',
    61          'docker': 'Docker',
    62          'engine': 'Engine',
    63          'execution_plan': 'ExecutionPlan',
    64          'language': 'Language',
    65          'network': 'Network',
    66          'node_selectors': 'NodeSelectors',
    67          'publisher': 'Publisher',
    68          'resources': 'Resources',
    69          'sharding': 'Sharding',
    70          'timeout': 'Timeout',
    71          'verifier': 'Verifier',
    72          'wasm': 'Wasm',
    73          'inputs': 'inputs',
    74          'outputs': 'outputs'
    75      }
    76  
    77      def __init__(self, annotations=None, contexts=None, deal=None, do_not_track=None, docker=None, engine=None, execution_plan=None, language=None, network=None, node_selectors=None, publisher=None, resources=None, sharding=None, timeout=None, verifier=None, wasm=None, inputs=None, outputs=None, _configuration=None):  # noqa: E501
    78          """Spec - a model defined in Swagger"""  # noqa: E501
    79          if _configuration is None:
    80              _configuration = Configuration()
    81          self._configuration = _configuration
    82  
    83          self._annotations = None
    84          self._contexts = None
    85          self._deal = None
    86          self._do_not_track = None
    87          self._docker = None
    88          self._engine = None
    89          self._execution_plan = None
    90          self._language = None
    91          self._network = None
    92          self._node_selectors = None
    93          self._publisher = None
    94          self._resources = None
    95          self._sharding = None
    96          self._timeout = None
    97          self._verifier = None
    98          self._wasm = None
    99          self._inputs = None
   100          self._outputs = None
   101          self.discriminator = None
   102  
   103          if annotations is not None:
   104              self.annotations = annotations
   105          if contexts is not None:
   106              self.contexts = contexts
   107          if deal is not None:
   108              self.deal = deal
   109          if do_not_track is not None:
   110              self.do_not_track = do_not_track
   111          if docker is not None:
   112              self.docker = docker
   113          if engine is not None:
   114              self.engine = engine
   115          if execution_plan is not None:
   116              self.execution_plan = execution_plan
   117          if language is not None:
   118              self.language = language
   119          if network is not None:
   120              self.network = network
   121          if node_selectors is not None:
   122              self.node_selectors = node_selectors
   123          if publisher is not None:
   124              self.publisher = publisher
   125          if resources is not None:
   126              self.resources = resources
   127          if sharding is not None:
   128              self.sharding = sharding
   129          if timeout is not None:
   130              self.timeout = timeout
   131          if verifier is not None:
   132              self.verifier = verifier
   133          if wasm is not None:
   134              self.wasm = wasm
   135          if inputs is not None:
   136              self.inputs = inputs
   137          if outputs is not None:
   138              self.outputs = outputs
   139  
   140      @property
   141      def annotations(self):
   142          """Gets the annotations of this Spec.  # noqa: E501
   143  
   144          Annotations on the job - could be user or machine assigned  # noqa: E501
   145  
   146          :return: The annotations of this Spec.  # noqa: E501
   147          :rtype: list[str]
   148          """
   149          return self._annotations
   150  
   151      @annotations.setter
   152      def annotations(self, annotations):
   153          """Sets the annotations of this Spec.
   154  
   155          Annotations on the job - could be user or machine assigned  # noqa: E501
   156  
   157          :param annotations: The annotations of this Spec.  # noqa: E501
   158          :type: list[str]
   159          """
   160  
   161          self._annotations = annotations
   162  
   163      @property
   164      def contexts(self):
   165          """Gets the contexts of this Spec.  # noqa: E501
   166  
   167          Input volumes that will not be sharded for example to upload code into a base image every shard will get the full range of context volumes  # noqa: E501
   168  
   169          :return: The contexts of this Spec.  # noqa: E501
   170          :rtype: list[StorageSpec]
   171          """
   172          return self._contexts
   173  
   174      @contexts.setter
   175      def contexts(self, contexts):
   176          """Sets the contexts of this Spec.
   177  
   178          Input volumes that will not be sharded for example to upload code into a base image every shard will get the full range of context volumes  # noqa: E501
   179  
   180          :param contexts: The contexts of this Spec.  # noqa: E501
   181          :type: list[StorageSpec]
   182          """
   183  
   184          self._contexts = contexts
   185  
   186      @property
   187      def deal(self):
   188          """Gets the deal of this Spec.  # noqa: E501
   189  
   190  
   191          :return: The deal of this Spec.  # noqa: E501
   192          :rtype: SpecDeal
   193          """
   194          return self._deal
   195  
   196      @deal.setter
   197      def deal(self, deal):
   198          """Sets the deal of this Spec.
   199  
   200  
   201          :param deal: The deal of this Spec.  # noqa: E501
   202          :type: SpecDeal
   203          """
   204  
   205          self._deal = deal
   206  
   207      @property
   208      def do_not_track(self):
   209          """Gets the do_not_track of this Spec.  # noqa: E501
   210  
   211          Do not track specified by the client  # noqa: E501
   212  
   213          :return: The do_not_track of this Spec.  # noqa: E501
   214          :rtype: bool
   215          """
   216          return self._do_not_track
   217  
   218      @do_not_track.setter
   219      def do_not_track(self, do_not_track):
   220          """Sets the do_not_track of this Spec.
   221  
   222          Do not track specified by the client  # noqa: E501
   223  
   224          :param do_not_track: The do_not_track of this Spec.  # noqa: E501
   225          :type: bool
   226          """
   227  
   228          self._do_not_track = do_not_track
   229  
   230      @property
   231      def docker(self):
   232          """Gets the docker of this Spec.  # noqa: E501
   233  
   234  
   235          :return: The docker of this Spec.  # noqa: E501
   236          :rtype: SpecDocker
   237          """
   238          return self._docker
   239  
   240      @docker.setter
   241      def docker(self, docker):
   242          """Sets the docker of this Spec.
   243  
   244  
   245          :param docker: The docker of this Spec.  # noqa: E501
   246          :type: SpecDocker
   247          """
   248  
   249          self._docker = docker
   250  
   251      @property
   252      def engine(self):
   253          """Gets the engine of this Spec.  # noqa: E501
   254  
   255  
   256          :return: The engine of this Spec.  # noqa: E501
   257          :rtype: SpecEngine
   258          """
   259          return self._engine
   260  
   261      @engine.setter
   262      def engine(self, engine):
   263          """Sets the engine of this Spec.
   264  
   265  
   266          :param engine: The engine of this Spec.  # noqa: E501
   267          :type: SpecEngine
   268          """
   269  
   270          self._engine = engine
   271  
   272      @property
   273      def execution_plan(self):
   274          """Gets the execution_plan of this Spec.  # noqa: E501
   275  
   276  
   277          :return: The execution_plan of this Spec.  # noqa: E501
   278          :rtype: SpecExecutionPlan
   279          """
   280          return self._execution_plan
   281  
   282      @execution_plan.setter
   283      def execution_plan(self, execution_plan):
   284          """Sets the execution_plan of this Spec.
   285  
   286  
   287          :param execution_plan: The execution_plan of this Spec.  # noqa: E501
   288          :type: SpecExecutionPlan
   289          """
   290  
   291          self._execution_plan = execution_plan
   292  
   293      @property
   294      def language(self):
   295          """Gets the language of this Spec.  # noqa: E501
   296  
   297  
   298          :return: The language of this Spec.  # noqa: E501
   299          :rtype: JobSpecLanguage
   300          """
   301          return self._language
   302  
   303      @language.setter
   304      def language(self, language):
   305          """Sets the language of this Spec.
   306  
   307  
   308          :param language: The language of this Spec.  # noqa: E501
   309          :type: JobSpecLanguage
   310          """
   311  
   312          self._language = language
   313  
   314      @property
   315      def network(self):
   316          """Gets the network of this Spec.  # noqa: E501
   317  
   318  
   319          :return: The network of this Spec.  # noqa: E501
   320          :rtype: SpecNetwork
   321          """
   322          return self._network
   323  
   324      @network.setter
   325      def network(self, network):
   326          """Sets the network of this Spec.
   327  
   328  
   329          :param network: The network of this Spec.  # noqa: E501
   330          :type: SpecNetwork
   331          """
   332  
   333          self._network = network
   334  
   335      @property
   336      def node_selectors(self):
   337          """Gets the node_selectors of this Spec.  # noqa: E501
   338  
   339          NodeSelectors is a selector which must be true for the compute node to run this job.  # noqa: E501
   340  
   341          :return: The node_selectors of this Spec.  # noqa: E501
   342          :rtype: list[LabelSelectorRequirement]
   343          """
   344          return self._node_selectors
   345  
   346      @node_selectors.setter
   347      def node_selectors(self, node_selectors):
   348          """Sets the node_selectors of this Spec.
   349  
   350          NodeSelectors is a selector which must be true for the compute node to run this job.  # noqa: E501
   351  
   352          :param node_selectors: The node_selectors of this Spec.  # noqa: E501
   353          :type: list[LabelSelectorRequirement]
   354          """
   355  
   356          self._node_selectors = node_selectors
   357  
   358      @property
   359      def publisher(self):
   360          """Gets the publisher of this Spec.  # noqa: E501
   361  
   362  
   363          :return: The publisher of this Spec.  # noqa: E501
   364          :rtype: SpecPublisher
   365          """
   366          return self._publisher
   367  
   368      @publisher.setter
   369      def publisher(self, publisher):
   370          """Sets the publisher of this Spec.
   371  
   372  
   373          :param publisher: The publisher of this Spec.  # noqa: E501
   374          :type: SpecPublisher
   375          """
   376  
   377          self._publisher = publisher
   378  
   379      @property
   380      def resources(self):
   381          """Gets the resources of this Spec.  # noqa: E501
   382  
   383  
   384          :return: The resources of this Spec.  # noqa: E501
   385          :rtype: SpecResources
   386          """
   387          return self._resources
   388  
   389      @resources.setter
   390      def resources(self, resources):
   391          """Sets the resources of this Spec.
   392  
   393  
   394          :param resources: The resources of this Spec.  # noqa: E501
   395          :type: SpecResources
   396          """
   397  
   398          self._resources = resources
   399  
   400      @property
   401      def sharding(self):
   402          """Gets the sharding of this Spec.  # noqa: E501
   403  
   404  
   405          :return: The sharding of this Spec.  # noqa: E501
   406          :rtype: SpecSharding
   407          """
   408          return self._sharding
   409  
   410      @sharding.setter
   411      def sharding(self, sharding):
   412          """Sets the sharding of this Spec.
   413  
   414  
   415          :param sharding: The sharding of this Spec.  # noqa: E501
   416          :type: SpecSharding
   417          """
   418  
   419          self._sharding = sharding
   420  
   421      @property
   422      def timeout(self):
   423          """Gets the timeout of this Spec.  # noqa: E501
   424  
   425          How long a job can run in seconds before it is killed. This includes the time required to run, verify and publish results  # noqa: E501
   426  
   427          :return: The timeout of this Spec.  # noqa: E501
   428          :rtype: float
   429          """
   430          return self._timeout
   431  
   432      @timeout.setter
   433      def timeout(self, timeout):
   434          """Sets the timeout of this Spec.
   435  
   436          How long a job can run in seconds before it is killed. This includes the time required to run, verify and publish results  # noqa: E501
   437  
   438          :param timeout: The timeout of this Spec.  # noqa: E501
   439          :type: float
   440          """
   441  
   442          self._timeout = timeout
   443  
   444      @property
   445      def verifier(self):
   446          """Gets the verifier of this Spec.  # noqa: E501
   447  
   448  
   449          :return: The verifier of this Spec.  # noqa: E501
   450          :rtype: Verifier
   451          """
   452          return self._verifier
   453  
   454      @verifier.setter
   455      def verifier(self, verifier):
   456          """Sets the verifier of this Spec.
   457  
   458  
   459          :param verifier: The verifier of this Spec.  # noqa: E501
   460          :type: Verifier
   461          """
   462  
   463          self._verifier = verifier
   464  
   465      @property
   466      def wasm(self):
   467          """Gets the wasm of this Spec.  # noqa: E501
   468  
   469  
   470          :return: The wasm of this Spec.  # noqa: E501
   471          :rtype: JobSpecWasm
   472          """
   473          return self._wasm
   474  
   475      @wasm.setter
   476      def wasm(self, wasm):
   477          """Sets the wasm of this Spec.
   478  
   479  
   480          :param wasm: The wasm of this Spec.  # noqa: E501
   481          :type: JobSpecWasm
   482          """
   483  
   484          self._wasm = wasm
   485  
   486      @property
   487      def inputs(self):
   488          """Gets the inputs of this Spec.  # noqa: E501
   489  
   490          the data volumes we will read in the job for example \"read this ipfs cid\" TODO: #667 Replace with \"Inputs\", \"Outputs\" (note the caps) for yaml/json when we update the n.js file  # noqa: E501
   491  
   492          :return: The inputs of this Spec.  # noqa: E501
   493          :rtype: list[StorageSpec]
   494          """
   495          return self._inputs
   496  
   497      @inputs.setter
   498      def inputs(self, inputs):
   499          """Sets the inputs of this Spec.
   500  
   501          the data volumes we will read in the job for example \"read this ipfs cid\" TODO: #667 Replace with \"Inputs\", \"Outputs\" (note the caps) for yaml/json when we update the n.js file  # noqa: E501
   502  
   503          :param inputs: The inputs of this Spec.  # noqa: E501
   504          :type: list[StorageSpec]
   505          """
   506  
   507          self._inputs = inputs
   508  
   509      @property
   510      def outputs(self):
   511          """Gets the outputs of this Spec.  # noqa: E501
   512  
   513          the data volumes we will write in the job for example \"write the results to ipfs\"  # noqa: E501
   514  
   515          :return: The outputs of this Spec.  # noqa: E501
   516          :rtype: list[StorageSpec]
   517          """
   518          return self._outputs
   519  
   520      @outputs.setter
   521      def outputs(self, outputs):
   522          """Sets the outputs of this Spec.
   523  
   524          the data volumes we will write in the job for example \"write the results to ipfs\"  # noqa: E501
   525  
   526          :param outputs: The outputs of this Spec.  # noqa: E501
   527          :type: list[StorageSpec]
   528          """
   529  
   530          self._outputs = outputs
   531  
   532      def to_dict(self):
   533          """Returns the model properties as a dict"""
   534          result = {}
   535  
   536          for attr, _ in six.iteritems(self.swagger_types):
   537              value = getattr(self, attr)
   538              if isinstance(value, list):
   539                  result[attr] = list(map(
   540                      lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
   541                      value
   542                  ))
   543              elif hasattr(value, "to_dict"):
   544                  result[attr] = value.to_dict()
   545              elif isinstance(value, dict):
   546                  result[attr] = dict(map(
   547                      lambda item: (item[0], item[1].to_dict())
   548                      if hasattr(item[1], "to_dict") else item,
   549                      value.items()
   550                  ))
   551              else:
   552                  result[attr] = value
   553          if issubclass(Spec, dict):
   554              for key, value in self.items():
   555                  result[key] = value
   556  
   557          return result
   558  
   559      def to_str(self):
   560          """Returns the string representation of the model"""
   561          return pprint.pformat(self.to_dict())
   562  
   563      def __repr__(self):
   564          """For `print` and `pprint`"""
   565          return self.to_str()
   566  
   567      def __eq__(self, other):
   568          """Returns true if both objects are equal"""
   569          if not isinstance(other, Spec):
   570              return False
   571  
   572          return self.to_dict() == other.to_dict()
   573  
   574      def __ne__(self, other):
   575          """Returns true if both objects are not equal"""
   576          if not isinstance(other, Spec):
   577              return True
   578  
   579          return self.to_dict() != other.to_dict()