cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
resource.py
Go to the documentation of this file.
1 # coding: utf-8
2 
3 """
4  cloudFPGA Resource Manager API
5 
6  No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 
8  OpenAPI spec version: 0.8
9 
10  Generated by: https://github.com/swagger-api/swagger-codegen.git
11 """
12 
13 import pprint
14 import re # noqa: F401
15 
16 import six
17 
18 class Resource(object):
19  """NOTE: This class is auto generated by the swagger code generator program.
20 
21  Do not edit the class manually.
22  """
23  """
24  Attributes:
25  swagger_types (dict): The key is attribute name
26  and the value is attribute type.
27  attribute_map (dict): The key is attribute name
28  and the value is json key in definition.
29  """
30  swagger_types = {
31  'fpga_board': 'str',
32  'shell_type': 'str',
33  'sled_ip': 'str',
34  'slot_num': 'int'
35  }
36 
37  attribute_map = {
38  'fpga_board': 'fpga_board',
39  'shell_type': 'shell_type',
40  'sled_ip': 'sled_ip',
41  'slot_num': 'slot_num'
42  }
43 
44  def __init__(self, fpga_board=None, shell_type=None, sled_ip=None, slot_num=None): # noqa: E501
45  """Resource - a model defined in Swagger""" # noqa: E501
46  self._fpga_board_fpga_board = None
47  self._shell_type_shell_type = None
48  self._sled_ip_sled_ip = None
49  self._slot_num_slot_num = None
50  self.discriminatordiscriminator = None
51  if fpga_board is not None:
52  self.fpga_boardfpga_boardfpga_boardfpga_board = fpga_board
53  if shell_type is not None:
54  self.shell_typeshell_typeshell_typeshell_type = shell_type
55  if sled_ip is not None:
56  self.sled_ipsled_ipsled_ipsled_ip = sled_ip
57  if slot_num is not None:
58  self.slot_numslot_numslot_numslot_num = slot_num
59 
60  @property
61  def fpga_board(self):
62  """Gets the fpga_board of this Resource. # noqa: E501
63 
64  Type of cloudFPGA # noqa: E501
65 
66  :return: The fpga_board of this Resource. # noqa: E501
67  :rtype: str
68  """
69  return self._fpga_board_fpga_board
70 
71  @fpga_board.setter
72  def fpga_board(self, fpga_board):
73  """Sets the fpga_board of this Resource.
74 
75  Type of cloudFPGA # noqa: E501
76 
77  :param fpga_board: The fpga_board of this Resource. # noqa: E501
78  :type: str
79  """
80 
81  self._fpga_board_fpga_board = fpga_board
82 
83  @property
84  def shell_type(self):
85  """Gets the shell_type of this Resource. # noqa: E501
86 
87  Type of the current Shell (interface) of the FPGA # noqa: E501
88 
89  :return: The shell_type of this Resource. # noqa: E501
90  :rtype: str
91  """
92  return self._shell_type_shell_type
93 
94  @shell_type.setter
95  def shell_type(self, shell_type):
96  """Sets the shell_type of this Resource.
97 
98  Type of the current Shell (interface) of the FPGA # noqa: E501
99 
100  :param shell_type: The shell_type of this Resource. # noqa: E501
101  :type: str
102  """
103 
104  self._shell_type_shell_type = shell_type
105 
106  @property
107  def sled_ip(self):
108  """Gets the sled_ip of this Resource. # noqa: E501
109 
110  IP of sled manager # noqa: E501
111 
112  :return: The sled_ip of this Resource. # noqa: E501
113  :rtype: str
114  """
115  return self._sled_ip_sled_ip
116 
117  @sled_ip.setter
118  def sled_ip(self, sled_ip):
119  """Sets the sled_ip of this Resource.
120 
121  IP of sled manager # noqa: E501
122 
123  :param sled_ip: The sled_ip of this Resource. # noqa: E501
124  :type: str
125  """
126 
127  self._sled_ip_sled_ip = sled_ip
128 
129  @property
130  def slot_num(self):
131  """Gets the slot_num of this Resource. # noqa: E501
132 
133  Slot number of resource # noqa: E501
134 
135  :return: The slot_num of this Resource. # noqa: E501
136  :rtype: int
137  """
138  return self._slot_num_slot_num
139 
140  @slot_num.setter
141  def slot_num(self, slot_num):
142  """Sets the slot_num of this Resource.
143 
144  Slot number of resource # noqa: E501
145 
146  :param slot_num: The slot_num of this Resource. # noqa: E501
147  :type: int
148  """
149 
150  self._slot_num_slot_num = slot_num
151 
152  def to_dict(self):
153  """Returns the model properties as a dict"""
154  result = {}
155 
156  for attr, _ in six.iteritems(self.swagger_typesswagger_types):
157  value = getattr(self, attr)
158  if isinstance(value, list):
159  result[attr] = list(map(
160  lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
161  value
162  ))
163  elif hasattr(value, "to_dict"):
164  result[attr] = value.to_dict()
165  elif isinstance(value, dict):
166  result[attr] = dict(map(
167  lambda item: (item[0], item[1].to_dict())
168  if hasattr(item[1], "to_dict") else item,
169  value.items()
170  ))
171  else:
172  result[attr] = value
173  if issubclass(Resource, dict):
174  for key, value in self.items():
175  result[key] = value
176 
177  return result
178 
179  def to_str(self):
180  """Returns the string representation of the model"""
181  return pprint.pformat(self.to_dictto_dict())
182 
183  def __repr__(self):
184  """For `print` and `pprint`"""
185  return self.to_strto_str()
186 
187  def __eq__(self, other):
188  """Returns true if both objects are equal"""
189  if not isinstance(other, Resource):
190  return False
191 
192  return self.__dict____dict__ == other.__dict__
193 
194  def __ne__(self, other):
195  """Returns true if both objects are not equal"""
196  return not self == other
def __init__(self, fpga_board=None, shell_type=None, sled_ip=None, slot_num=None)
Definition: resource.py:44