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 V1ResourceRequirements(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 'claims': 'list[CoreV1ResourceClaim]',37 'limits': 'dict(str, str)',38 'requests': 'dict(str, str)'39 }40 41 attribute_map = {42 'claims': 'claims',43 'limits': 'limits',44 'requests': 'requests'45 }46 47 def __init__(self, claims=None, limits=None, requests=None, local_vars_configuration=None): # noqa: E50148 """V1ResourceRequirements - 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._claims = None54 self._limits = None55 self._requests = None56 self.discriminator = None57 58 if claims is not None:59 self.claims = claims60 if limits is not None:61 self.limits = limits62 if requests is not None:63 self.requests = requests64 65 @property66 def claims(self):67 """Gets the claims of this V1ResourceRequirements. # noqa: E50168 69 Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This field depends on the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. # noqa: E50170 71 :return: The claims of this V1ResourceRequirements. # noqa: E50172 :rtype: list[CoreV1ResourceClaim]73 """74 return self._claims75 76 @claims.setter77 def claims(self, claims):78 """Sets the claims of this V1ResourceRequirements.79 80 Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This field depends on the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. # noqa: E50181 82 :param claims: The claims of this V1ResourceRequirements. # noqa: E50183 :type: list[CoreV1ResourceClaim]84 """85 86 self._claims = claims87 88 @property89 def limits(self):90 """Gets the limits of this V1ResourceRequirements. # noqa: E50191 92 Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ # noqa: E50193 94 :return: The limits of this V1ResourceRequirements. # noqa: E50195 :rtype: dict(str, str)96 """97 return self._limits98 99 @limits.setter100 def limits(self, limits):101 """Sets the limits of this V1ResourceRequirements.102 103 Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ # noqa: E501104 105 :param limits: The limits of this V1ResourceRequirements. # noqa: E501106 :type: dict(str, str)107 """108 109 self._limits = limits110 111 @property112 def requests(self):113 """Gets the requests of this V1ResourceRequirements. # noqa: E501114 115 Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ # noqa: E501116 117 :return: The requests of this V1ResourceRequirements. # noqa: E501118 :rtype: dict(str, str)119 """120 return self._requests121 122 @requests.setter123 def requests(self, requests):124 """Sets the requests of this V1ResourceRequirements.125 126 Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ # noqa: E501127 128 :param requests: The requests of this V1ResourceRequirements. # noqa: E501129 :type: dict(str, str)130 """131 132 self._requests = requests133 134 def to_dict(self):135 """Returns the model properties as a dict"""136 result = {}137 138 for attr, _ in six.iteritems(self.openapi_types):139 value = getattr(self, attr)140 if isinstance(value, list):141 result[attr] = list(map(142 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,143 value144 ))145 elif hasattr(value, "to_dict"):146 result[attr] = value.to_dict()147 elif isinstance(value, dict):148 result[attr] = dict(map(149 lambda item: (item[0], item[1].to_dict())150 if hasattr(item[1], "to_dict") else item,151 value.items()152 ))153 else:154 result[attr] = value155 156 return result157 158 def to_str(self):159 """Returns the string representation of the model"""160 return pprint.pformat(self.to_dict())161 162 def __repr__(self):163 """For `print` and `pprint`"""164 return self.to_str()165 166 def __eq__(self, other):167 """Returns true if both objects are equal"""168 if not isinstance(other, V1ResourceRequirements):169 return False170 171 return self.to_dict() == other.to_dict()172 173 def __ne__(self, other):174 """Returns true if both objects are not equal"""175 if not isinstance(other, V1ResourceRequirements):176 return True177 178 return self.to_dict() != other.to_dict()179 