github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/clients/python/bacalhau_apiclient/models/resource_usage_config.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 ResourceUsageConfig(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 'cpu': 'str', 37 'disk': 'str', 38 'gpu': 'str', 39 'memory': 'str' 40 } 41 42 attribute_map = { 43 'cpu': 'CPU', 44 'disk': 'Disk', 45 'gpu': 'GPU', 46 'memory': 'Memory' 47 } 48 49 def __init__(self, cpu=None, disk=None, gpu=None, memory=None, _configuration=None): # noqa: E501 50 """ResourceUsageConfig - a model defined in Swagger""" # noqa: E501 51 if _configuration is None: 52 _configuration = Configuration() 53 self._configuration = _configuration 54 55 self._cpu = None 56 self._disk = None 57 self._gpu = None 58 self._memory = None 59 self.discriminator = None 60 61 if cpu is not None: 62 self.cpu = cpu 63 if disk is not None: 64 self.disk = disk 65 if gpu is not None: 66 self.gpu = gpu 67 if memory is not None: 68 self.memory = memory 69 70 @property 71 def cpu(self): 72 """Gets the cpu of this ResourceUsageConfig. # noqa: E501 73 74 https://github.com/BTBurke/k8sresource string # noqa: E501 75 76 :return: The cpu of this ResourceUsageConfig. # noqa: E501 77 :rtype: str 78 """ 79 return self._cpu 80 81 @cpu.setter 82 def cpu(self, cpu): 83 """Sets the cpu of this ResourceUsageConfig. 84 85 https://github.com/BTBurke/k8sresource string # noqa: E501 86 87 :param cpu: The cpu of this ResourceUsageConfig. # noqa: E501 88 :type: str 89 """ 90 91 self._cpu = cpu 92 93 @property 94 def disk(self): 95 """Gets the disk of this ResourceUsageConfig. # noqa: E501 96 97 98 :return: The disk of this ResourceUsageConfig. # noqa: E501 99 :rtype: str 100 """ 101 return self._disk 102 103 @disk.setter 104 def disk(self, disk): 105 """Sets the disk of this ResourceUsageConfig. 106 107 108 :param disk: The disk of this ResourceUsageConfig. # noqa: E501 109 :type: str 110 """ 111 112 self._disk = disk 113 114 @property 115 def gpu(self): 116 """Gets the gpu of this ResourceUsageConfig. # noqa: E501 117 118 unsigned integer string # noqa: E501 119 120 :return: The gpu of this ResourceUsageConfig. # noqa: E501 121 :rtype: str 122 """ 123 return self._gpu 124 125 @gpu.setter 126 def gpu(self, gpu): 127 """Sets the gpu of this ResourceUsageConfig. 128 129 unsigned integer string # noqa: E501 130 131 :param gpu: The gpu of this ResourceUsageConfig. # noqa: E501 132 :type: str 133 """ 134 135 self._gpu = gpu 136 137 @property 138 def memory(self): 139 """Gets the memory of this ResourceUsageConfig. # noqa: E501 140 141 github.com/c2h5oh/datasize string # noqa: E501 142 143 :return: The memory of this ResourceUsageConfig. # noqa: E501 144 :rtype: str 145 """ 146 return self._memory 147 148 @memory.setter 149 def memory(self, memory): 150 """Sets the memory of this ResourceUsageConfig. 151 152 github.com/c2h5oh/datasize string # noqa: E501 153 154 :param memory: The memory of this ResourceUsageConfig. # noqa: E501 155 :type: str 156 """ 157 158 self._memory = memory 159 160 def to_dict(self): 161 """Returns the model properties as a dict""" 162 result = {} 163 164 for attr, _ in six.iteritems(self.swagger_types): 165 value = getattr(self, attr) 166 if isinstance(value, list): 167 result[attr] = list(map( 168 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 169 value 170 )) 171 elif hasattr(value, "to_dict"): 172 result[attr] = value.to_dict() 173 elif isinstance(value, dict): 174 result[attr] = dict(map( 175 lambda item: (item[0], item[1].to_dict()) 176 if hasattr(item[1], "to_dict") else item, 177 value.items() 178 )) 179 else: 180 result[attr] = value 181 if issubclass(ResourceUsageConfig, dict): 182 for key, value in self.items(): 183 result[key] = value 184 185 return result 186 187 def to_str(self): 188 """Returns the string representation of the model""" 189 return pprint.pformat(self.to_dict()) 190 191 def __repr__(self): 192 """For `print` and `pprint`""" 193 return self.to_str() 194 195 def __eq__(self, other): 196 """Returns true if both objects are equal""" 197 if not isinstance(other, ResourceUsageConfig): 198 return False 199 200 return self.to_dict() == other.to_dict() 201 202 def __ne__(self, other): 203 """Returns true if both objects are not equal""" 204 if not isinstance(other, ResourceUsageConfig): 205 return True 206 207 return self.to_dict() != other.to_dict()