codekingpro/portable-devtools
114k
1# coding: utf-82 3"""4 Kubernetes5 6 No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E5017 8 The version of the OpenAPI document: release-1.359 Generated by: https://openapi-generator.tech10"""11 12 13import pprint14import re # noqa: F40115 16import six17 18from kubernetes.client.configuration import Configuration19 20 21class V1beta1ResourcePool(object):22 """NOTE: This class is auto generated by OpenAPI Generator.23 Ref: https://openapi-generator.tech24 25 Do not edit the class manually.26 """27 28 """29 Attributes:30 openapi_types (dict): The key is attribute name31 and the value is attribute type.32 attribute_map (dict): The key is attribute name33 and the value is json key in definition.34 """35 openapi_types = {36 'generation': 'int',37 'name': 'str',38 'resource_slice_count': 'int'39 }40 41 attribute_map = {42 'generation': 'generation',43 'name': 'name',44 'resource_slice_count': 'resourceSliceCount'45 }46 47 def __init__(self, generation=None, name=None, resource_slice_count=None, local_vars_configuration=None): # noqa: E50148 """V1beta1ResourcePool - a model defined in OpenAPI""" # noqa: E50149 if local_vars_configuration is None:50 local_vars_configuration = Configuration()51 self.local_vars_configuration = local_vars_configuration52 53 self._generation = None54 self._name = None55 self._resource_slice_count = None56 self.discriminator = None57 58 self.generation = generation59 self.name = name60 self.resource_slice_count = resource_slice_count61 62 @property63 def generation(self):64 """Gets the generation of this V1beta1ResourcePool. # noqa: E50165 66 Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted. Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state. # noqa: E50167 68 :return: The generation of this V1beta1ResourcePool. # noqa: E50169 :rtype: int70 """71 return self._generation72 73 @generation.setter74 def generation(self, generation):75 """Sets the generation of this V1beta1ResourcePool.76 77 Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted. Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state. # noqa: E50178 79 :param generation: The generation of this V1beta1ResourcePool. # noqa: E50180 :type: int81 """82 if self.local_vars_configuration.client_side_validation and generation is None: # noqa: E50183 raise ValueError("Invalid value for `generation`, must not be `None`") # noqa: E50184 85 self._generation = generation86 87 @property88 def name(self):89 """Gets the name of this V1beta1ResourcePool. # noqa: E50190 91 Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable. # noqa: E50192 93 :return: The name of this V1beta1ResourcePool. # noqa: E50194 :rtype: str95 """96 return self._name97 98 @name.setter99 def name(self, name):100 """Sets the name of this V1beta1ResourcePool.101 102 Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable. # noqa: E501103 104 :param name: The name of this V1beta1ResourcePool. # noqa: E501105 :type: str106 """107 if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501108 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501109 110 self._name = name111 112 @property113 def resource_slice_count(self):114 """Gets the resource_slice_count of this V1beta1ResourcePool. # noqa: E501115 116 ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero. Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool. # noqa: E501117 118 :return: The resource_slice_count of this V1beta1ResourcePool. # noqa: E501119 :rtype: int120 """121 return self._resource_slice_count122 123 @resource_slice_count.setter124 def resource_slice_count(self, resource_slice_count):125 """Sets the resource_slice_count of this V1beta1ResourcePool.126 127 ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero. Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool. # noqa: E501128 129 :param resource_slice_count: The resource_slice_count of this V1beta1ResourcePool. # noqa: E501130 :type: int131 """132 if self.local_vars_configuration.client_side_validation and resource_slice_count is None: # noqa: E501133 raise ValueError("Invalid value for `resource_slice_count`, must not be `None`") # noqa: E501134 135 self._resource_slice_count = resource_slice_count136 137 def to_dict(self):138 """Returns the model properties as a dict"""139 result = {}140 141 for attr, _ in six.iteritems(self.openapi_types):142 value = getattr(self, attr)143 if isinstance(value, list):144 result[attr] = list(map(145 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,146 value147 ))148 elif hasattr(value, "to_dict"):149 result[attr] = value.to_dict()150 elif isinstance(value, dict):151 result[attr] = dict(map(152 lambda item: (item[0], item[1].to_dict())153 if hasattr(item[1], "to_dict") else item,154 value.items()155 ))156 else:157 result[attr] = value158 159 return result160 161 def to_str(self):162 """Returns the string representation of the model"""163 return pprint.pformat(self.to_dict())164 165 def __repr__(self):166 """For `print` and `pprint`"""167 return self.to_str()168 169 def __eq__(self, other):170 """Returns true if both objects are equal"""171 if not isinstance(other, V1beta1ResourcePool):172 return False173 174 return self.to_dict() == other.to_dict()175 176 def __ne__(self, other):177 """Returns true if both objects are not equal"""178 if not isinstance(other, V1beta1ResourcePool):179 return True180 181 return self.to_dict() != other.to_dict()182 