cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
quota.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 Quota(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  'allowed_resources': 'list[int]',
32  'current_acquired_instances': 'int',
33  'max_acquire_instances': 'int'
34  }
35 
36  attribute_map = {
37  'allowed_resources': 'allowed_resources',
38  'current_acquired_instances': 'current_acquired_instances',
39  'max_acquire_instances': 'max_acquire_instances'
40  }
41 
42  def __init__(self, allowed_resources=None, current_acquired_instances=None, max_acquire_instances=None): # noqa: E501
43  """Quota - a model defined in Swagger""" # noqa: E501
44  self._allowed_resources_allowed_resources = None
45  self._current_acquired_instances_current_acquired_instances = None
46  self._max_acquire_instances_max_acquire_instances = None
47  self.discriminatordiscriminator = None
48  if allowed_resources is not None:
49  self.allowed_resourcesallowed_resourcesallowed_resourcesallowed_resources = allowed_resources
50  if current_acquired_instances is not None:
51  self.current_acquired_instancescurrent_acquired_instancescurrent_acquired_instancescurrent_acquired_instances = current_acquired_instances
52  if max_acquire_instances is not None:
53  self.max_acquire_instancesmax_acquire_instancesmax_acquire_instancesmax_acquire_instances = max_acquire_instances
54 
55  @property
56  def allowed_resources(self):
57  """Gets the allowed_resources of this Quota. # noqa: E501
58 
59  List of allowed resources for this project (admin only). # noqa: E501
60 
61  :return: The allowed_resources of this Quota. # noqa: E501
62  :rtype: list[int]
63  """
64  return self._allowed_resources_allowed_resources
65 
66  @allowed_resources.setter
67  def allowed_resources(self, allowed_resources):
68  """Sets the allowed_resources of this Quota.
69 
70  List of allowed resources for this project (admin only). # noqa: E501
71 
72  :param allowed_resources: The allowed_resources of this Quota. # noqa: E501
73  :type: list[int]
74  """
75 
76  self._allowed_resources_allowed_resources = allowed_resources
77 
78  @property
80  """Gets the current_acquired_instances of this Quota. # noqa: E501
81 
82  Number of currently acquired Instances # noqa: E501
83 
84  :return: The current_acquired_instances of this Quota. # noqa: E501
85  :rtype: int
86  """
87  return self._current_acquired_instances_current_acquired_instances
88 
89  @current_acquired_instances.setter
90  def current_acquired_instances(self, current_acquired_instances):
91  """Sets the current_acquired_instances of this Quota.
92 
93  Number of currently acquired Instances # noqa: E501
94 
95  :param current_acquired_instances: The current_acquired_instances of this Quota. # noqa: E501
96  :type: int
97  """
98 
99  self._current_acquired_instances_current_acquired_instances = current_acquired_instances
100 
101  @property
103  """Gets the max_acquire_instances of this Quota. # noqa: E501
104 
105  Maximum allowed number of Instaces to be acquired by project # noqa: E501
106 
107  :return: The max_acquire_instances of this Quota. # noqa: E501
108  :rtype: int
109  """
110  return self._max_acquire_instances_max_acquire_instances
111 
112  @max_acquire_instances.setter
113  def max_acquire_instances(self, max_acquire_instances):
114  """Sets the max_acquire_instances of this Quota.
115 
116  Maximum allowed number of Instaces to be acquired by project # noqa: E501
117 
118  :param max_acquire_instances: The max_acquire_instances of this Quota. # noqa: E501
119  :type: int
120  """
121 
122  self._max_acquire_instances_max_acquire_instances = max_acquire_instances
123 
124  def to_dict(self):
125  """Returns the model properties as a dict"""
126  result = {}
127 
128  for attr, _ in six.iteritems(self.swagger_typesswagger_types):
129  value = getattr(self, attr)
130  if isinstance(value, list):
131  result[attr] = list(map(
132  lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
133  value
134  ))
135  elif hasattr(value, "to_dict"):
136  result[attr] = value.to_dict()
137  elif isinstance(value, dict):
138  result[attr] = dict(map(
139  lambda item: (item[0], item[1].to_dict())
140  if hasattr(item[1], "to_dict") else item,
141  value.items()
142  ))
143  else:
144  result[attr] = value
145  if issubclass(Quota, dict):
146  for key, value in self.items():
147  result[key] = value
148 
149  return result
150 
151  def to_str(self):
152  """Returns the string representation of the model"""
153  return pprint.pformat(self.to_dictto_dict())
154 
155  def __repr__(self):
156  """For `print` and `pprint`"""
157  return self.to_strto_str()
158 
159  def __eq__(self, other):
160  """Returns true if both objects are equal"""
161  if not isinstance(other, Quota):
162  return False
163 
164  return self.__dict____dict__ == other.__dict__
165 
166  def __ne__(self, other):
167  """Returns true if both objects are not equal"""
168  return not self == other
def current_acquired_instances(self, current_acquired_instances)
Definition: quota.py:90
def __init__(self, allowed_resources=None, current_acquired_instances=None, max_acquire_instances=None)
Definition: quota.py:42
def max_acquire_instances(self, max_acquire_instances)
Definition: quota.py:113