github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/job_spec_wasm.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 JobSpecWasm(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 'entry_module': 'JobSpecWasmEntryModule', 37 'entry_point': 'str', 38 'environment_variables': 'dict(str, str)', 39 'import_modules': 'list[StorageSpec]', 40 'parameters': 'list[str]' 41 } 42 43 attribute_map = { 44 'entry_module': 'EntryModule', 45 'entry_point': 'EntryPoint', 46 'environment_variables': 'EnvironmentVariables', 47 'import_modules': 'ImportModules', 48 'parameters': 'Parameters' 49 } 50 51 def __init__(self, entry_module=None, entry_point=None, environment_variables=None, import_modules=None, parameters=None, _configuration=None): # noqa: E501 52 """JobSpecWasm - a model defined in Swagger""" # noqa: E501 53 if _configuration is None: 54 _configuration = Configuration() 55 self._configuration = _configuration 56 57 self._entry_module = None 58 self._entry_point = None 59 self._environment_variables = None 60 self._import_modules = None 61 self._parameters = None 62 self.discriminator = None 63 64 if entry_module is not None: 65 self.entry_module = entry_module 66 if entry_point is not None: 67 self.entry_point = entry_point 68 if environment_variables is not None: 69 self.environment_variables = environment_variables 70 if import_modules is not None: 71 self.import_modules = import_modules 72 if parameters is not None: 73 self.parameters = parameters 74 75 @property 76 def entry_module(self): 77 """Gets the entry_module of this JobSpecWasm. # noqa: E501 78 79 80 :return: The entry_module of this JobSpecWasm. # noqa: E501 81 :rtype: JobSpecWasmEntryModule 82 """ 83 return self._entry_module 84 85 @entry_module.setter 86 def entry_module(self, entry_module): 87 """Sets the entry_module of this JobSpecWasm. 88 89 90 :param entry_module: The entry_module of this JobSpecWasm. # noqa: E501 91 :type: JobSpecWasmEntryModule 92 """ 93 94 self._entry_module = entry_module 95 96 @property 97 def entry_point(self): 98 """Gets the entry_point of this JobSpecWasm. # noqa: E501 99 100 The name of the function in the EntryModule to call to run the job. For WASI jobs, this will always be `_start`, but jobs can choose to call other WASM functions instead. The EntryPoint must be a zero-parameter zero-result function. # noqa: E501 101 102 :return: The entry_point of this JobSpecWasm. # noqa: E501 103 :rtype: str 104 """ 105 return self._entry_point 106 107 @entry_point.setter 108 def entry_point(self, entry_point): 109 """Sets the entry_point of this JobSpecWasm. 110 111 The name of the function in the EntryModule to call to run the job. For WASI jobs, this will always be `_start`, but jobs can choose to call other WASM functions instead. The EntryPoint must be a zero-parameter zero-result function. # noqa: E501 112 113 :param entry_point: The entry_point of this JobSpecWasm. # noqa: E501 114 :type: str 115 """ 116 117 self._entry_point = entry_point 118 119 @property 120 def environment_variables(self): 121 """Gets the environment_variables of this JobSpecWasm. # noqa: E501 122 123 The variables available in the environment of the running program. # noqa: E501 124 125 :return: The environment_variables of this JobSpecWasm. # noqa: E501 126 :rtype: dict(str, str) 127 """ 128 return self._environment_variables 129 130 @environment_variables.setter 131 def environment_variables(self, environment_variables): 132 """Sets the environment_variables of this JobSpecWasm. 133 134 The variables available in the environment of the running program. # noqa: E501 135 136 :param environment_variables: The environment_variables of this JobSpecWasm. # noqa: E501 137 :type: dict(str, str) 138 """ 139 140 self._environment_variables = environment_variables 141 142 @property 143 def import_modules(self): 144 """Gets the import_modules of this JobSpecWasm. # noqa: E501 145 146 TODO #880: Other WASM modules whose exports will be available as imports to the EntryModule. # noqa: E501 147 148 :return: The import_modules of this JobSpecWasm. # noqa: E501 149 :rtype: list[StorageSpec] 150 """ 151 return self._import_modules 152 153 @import_modules.setter 154 def import_modules(self, import_modules): 155 """Sets the import_modules of this JobSpecWasm. 156 157 TODO #880: Other WASM modules whose exports will be available as imports to the EntryModule. # noqa: E501 158 159 :param import_modules: The import_modules of this JobSpecWasm. # noqa: E501 160 :type: list[StorageSpec] 161 """ 162 163 self._import_modules = import_modules 164 165 @property 166 def parameters(self): 167 """Gets the parameters of this JobSpecWasm. # noqa: E501 168 169 The arguments supplied to the program (i.e. as ARGV). # noqa: E501 170 171 :return: The parameters of this JobSpecWasm. # noqa: E501 172 :rtype: list[str] 173 """ 174 return self._parameters 175 176 @parameters.setter 177 def parameters(self, parameters): 178 """Sets the parameters of this JobSpecWasm. 179 180 The arguments supplied to the program (i.e. as ARGV). # noqa: E501 181 182 :param parameters: The parameters of this JobSpecWasm. # noqa: E501 183 :type: list[str] 184 """ 185 186 self._parameters = parameters 187 188 def to_dict(self): 189 """Returns the model properties as a dict""" 190 result = {} 191 192 for attr, _ in six.iteritems(self.swagger_types): 193 value = getattr(self, attr) 194 if isinstance(value, list): 195 result[attr] = list(map( 196 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 197 value 198 )) 199 elif hasattr(value, "to_dict"): 200 result[attr] = value.to_dict() 201 elif isinstance(value, dict): 202 result[attr] = dict(map( 203 lambda item: (item[0], item[1].to_dict()) 204 if hasattr(item[1], "to_dict") else item, 205 value.items() 206 )) 207 else: 208 result[attr] = value 209 if issubclass(JobSpecWasm, dict): 210 for key, value in self.items(): 211 result[key] = value 212 213 return result 214 215 def to_str(self): 216 """Returns the string representation of the model""" 217 return pprint.pformat(self.to_dict()) 218 219 def __repr__(self): 220 """For `print` and `pprint`""" 221 return self.to_str() 222 223 def __eq__(self, other): 224 """Returns true if both objects are equal""" 225 if not isinstance(other, JobSpecWasm): 226 return False 227 228 return self.to_dict() == other.to_dict() 229 230 def __ne__(self, other): 231 """Returns true if both objects are not equal""" 232 if not isinstance(other, JobSpecWasm): 233 return True 234 235 return self.to_dict() != other.to_dict()