github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/compute_node_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 ComputeNodeInfo(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 'available_capacity': 'ResourceUsageData', 37 'enqueued_executions': 'int', 38 'execution_engines': 'list[Engine]', 39 'max_capacity': 'ResourceUsageData', 40 'max_job_requirements': 'ResourceUsageData', 41 'running_executions': 'int' 42 } 43 44 attribute_map = { 45 'available_capacity': 'AvailableCapacity', 46 'enqueued_executions': 'EnqueuedExecutions', 47 'execution_engines': 'ExecutionEngines', 48 'max_capacity': 'MaxCapacity', 49 'max_job_requirements': 'MaxJobRequirements', 50 'running_executions': 'RunningExecutions' 51 } 52 53 def __init__(self, available_capacity=None, enqueued_executions=None, execution_engines=None, max_capacity=None, max_job_requirements=None, running_executions=None, _configuration=None): # noqa: E501 54 """ComputeNodeInfo - a model defined in Swagger""" # noqa: E501 55 if _configuration is None: 56 _configuration = Configuration() 57 self._configuration = _configuration 58 59 self._available_capacity = None 60 self._enqueued_executions = None 61 self._execution_engines = None 62 self._max_capacity = None 63 self._max_job_requirements = None 64 self._running_executions = None 65 self.discriminator = None 66 67 if available_capacity is not None: 68 self.available_capacity = available_capacity 69 if enqueued_executions is not None: 70 self.enqueued_executions = enqueued_executions 71 if execution_engines is not None: 72 self.execution_engines = execution_engines 73 if max_capacity is not None: 74 self.max_capacity = max_capacity 75 if max_job_requirements is not None: 76 self.max_job_requirements = max_job_requirements 77 if running_executions is not None: 78 self.running_executions = running_executions 79 80 @property 81 def available_capacity(self): 82 """Gets the available_capacity of this ComputeNodeInfo. # noqa: E501 83 84 85 :return: The available_capacity of this ComputeNodeInfo. # noqa: E501 86 :rtype: ResourceUsageData 87 """ 88 return self._available_capacity 89 90 @available_capacity.setter 91 def available_capacity(self, available_capacity): 92 """Sets the available_capacity of this ComputeNodeInfo. 93 94 95 :param available_capacity: The available_capacity of this ComputeNodeInfo. # noqa: E501 96 :type: ResourceUsageData 97 """ 98 99 self._available_capacity = available_capacity 100 101 @property 102 def enqueued_executions(self): 103 """Gets the enqueued_executions of this ComputeNodeInfo. # noqa: E501 104 105 106 :return: The enqueued_executions of this ComputeNodeInfo. # noqa: E501 107 :rtype: int 108 """ 109 return self._enqueued_executions 110 111 @enqueued_executions.setter 112 def enqueued_executions(self, enqueued_executions): 113 """Sets the enqueued_executions of this ComputeNodeInfo. 114 115 116 :param enqueued_executions: The enqueued_executions of this ComputeNodeInfo. # noqa: E501 117 :type: int 118 """ 119 120 self._enqueued_executions = enqueued_executions 121 122 @property 123 def execution_engines(self): 124 """Gets the execution_engines of this ComputeNodeInfo. # noqa: E501 125 126 127 :return: The execution_engines of this ComputeNodeInfo. # noqa: E501 128 :rtype: list[Engine] 129 """ 130 return self._execution_engines 131 132 @execution_engines.setter 133 def execution_engines(self, execution_engines): 134 """Sets the execution_engines of this ComputeNodeInfo. 135 136 137 :param execution_engines: The execution_engines of this ComputeNodeInfo. # noqa: E501 138 :type: list[Engine] 139 """ 140 141 self._execution_engines = execution_engines 142 143 @property 144 def max_capacity(self): 145 """Gets the max_capacity of this ComputeNodeInfo. # noqa: E501 146 147 148 :return: The max_capacity of this ComputeNodeInfo. # noqa: E501 149 :rtype: ResourceUsageData 150 """ 151 return self._max_capacity 152 153 @max_capacity.setter 154 def max_capacity(self, max_capacity): 155 """Sets the max_capacity of this ComputeNodeInfo. 156 157 158 :param max_capacity: The max_capacity of this ComputeNodeInfo. # noqa: E501 159 :type: ResourceUsageData 160 """ 161 162 self._max_capacity = max_capacity 163 164 @property 165 def max_job_requirements(self): 166 """Gets the max_job_requirements of this ComputeNodeInfo. # noqa: E501 167 168 169 :return: The max_job_requirements of this ComputeNodeInfo. # noqa: E501 170 :rtype: ResourceUsageData 171 """ 172 return self._max_job_requirements 173 174 @max_job_requirements.setter 175 def max_job_requirements(self, max_job_requirements): 176 """Sets the max_job_requirements of this ComputeNodeInfo. 177 178 179 :param max_job_requirements: The max_job_requirements of this ComputeNodeInfo. # noqa: E501 180 :type: ResourceUsageData 181 """ 182 183 self._max_job_requirements = max_job_requirements 184 185 @property 186 def running_executions(self): 187 """Gets the running_executions of this ComputeNodeInfo. # noqa: E501 188 189 190 :return: The running_executions of this ComputeNodeInfo. # noqa: E501 191 :rtype: int 192 """ 193 return self._running_executions 194 195 @running_executions.setter 196 def running_executions(self, running_executions): 197 """Sets the running_executions of this ComputeNodeInfo. 198 199 200 :param running_executions: The running_executions of this ComputeNodeInfo. # noqa: E501 201 :type: int 202 """ 203 204 self._running_executions = running_executions 205 206 def to_dict(self): 207 """Returns the model properties as a dict""" 208 result = {} 209 210 for attr, _ in six.iteritems(self.swagger_types): 211 value = getattr(self, attr) 212 if isinstance(value, list): 213 result[attr] = list(map( 214 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 215 value 216 )) 217 elif hasattr(value, "to_dict"): 218 result[attr] = value.to_dict() 219 elif isinstance(value, dict): 220 result[attr] = dict(map( 221 lambda item: (item[0], item[1].to_dict()) 222 if hasattr(item[1], "to_dict") else item, 223 value.items() 224 )) 225 else: 226 result[attr] = value 227 if issubclass(ComputeNodeInfo, dict): 228 for key, value in self.items(): 229 result[key] = value 230 231 return result 232 233 def to_str(self): 234 """Returns the string representation of the model""" 235 return pprint.pformat(self.to_dict()) 236 237 def __repr__(self): 238 """For `print` and `pprint`""" 239 return self.to_str() 240 241 def __eq__(self, other): 242 """Returns true if both objects are equal""" 243 if not isinstance(other, ComputeNodeInfo): 244 return False 245 246 return self.to_dict() == other.to_dict() 247 248 def __ne__(self, other): 249 """Returns true if both objects are not equal""" 250 if not isinstance(other, ComputeNodeInfo): 251 return True 252 253 return self.to_dict() != other.to_dict()