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