Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_capacity_request_policy.py177 linesDownload Raw Back to models
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 V1CapacityRequestPolicy(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        'default': 'str',37        'valid_range': 'V1CapacityRequestPolicyRange',38        'valid_values': 'list[str]'39    }40 41    attribute_map = {42        'default': 'default',43        'valid_range': 'validRange',44        'valid_values': 'validValues'45    }46 47    def __init__(self, default=None, valid_range=None, valid_values=None, local_vars_configuration=None):  # noqa: E50148        """V1CapacityRequestPolicy - 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._default = None54        self._valid_range = None55        self._valid_values = None56        self.discriminator = None57 58        if default is not None:59            self.default = default60        if valid_range is not None:61            self.valid_range = valid_range62        if valid_values is not None:63            self.valid_values = valid_values64 65    @property66    def default(self):67        """Gets the default of this V1CapacityRequestPolicy.  # noqa: E50168 69        Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity.  # noqa: E50170 71        :return: The default of this V1CapacityRequestPolicy.  # noqa: E50172        :rtype: str73        """74        return self._default75 76    @default.setter77    def default(self, default):78        """Sets the default of this V1CapacityRequestPolicy.79 80        Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity.  # noqa: E50181 82        :param default: The default of this V1CapacityRequestPolicy.  # noqa: E50183        :type: str84        """85 86        self._default = default87 88    @property89    def valid_range(self):90        """Gets the valid_range of this V1CapacityRequestPolicy.  # noqa: E50191 92 93        :return: The valid_range of this V1CapacityRequestPolicy.  # noqa: E50194        :rtype: V1CapacityRequestPolicyRange95        """96        return self._valid_range97 98    @valid_range.setter99    def valid_range(self, valid_range):100        """Sets the valid_range of this V1CapacityRequestPolicy.101 102 103        :param valid_range: The valid_range of this V1CapacityRequestPolicy.  # noqa: E501104        :type: V1CapacityRequestPolicyRange105        """106 107        self._valid_range = valid_range108 109    @property110    def valid_values(self):111        """Gets the valid_values of this V1CapacityRequestPolicy.  # noqa: E501112 113        ValidValues defines a set of acceptable quantity values in consuming requests.  Must not contain more than 10 entries. Must be sorted in ascending order.  If this field is set, Default must be defined and it must be included in ValidValues list.  If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues).  If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated.  # noqa: E501114 115        :return: The valid_values of this V1CapacityRequestPolicy.  # noqa: E501116        :rtype: list[str]117        """118        return self._valid_values119 120    @valid_values.setter121    def valid_values(self, valid_values):122        """Sets the valid_values of this V1CapacityRequestPolicy.123 124        ValidValues defines a set of acceptable quantity values in consuming requests.  Must not contain more than 10 entries. Must be sorted in ascending order.  If this field is set, Default must be defined and it must be included in ValidValues list.  If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues).  If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated.  # noqa: E501125 126        :param valid_values: The valid_values of this V1CapacityRequestPolicy.  # noqa: E501127        :type: list[str]128        """129 130        self._valid_values = valid_values131 132    def to_dict(self):133        """Returns the model properties as a dict"""134        result = {}135 136        for attr, _ in six.iteritems(self.openapi_types):137            value = getattr(self, attr)138            if isinstance(value, list):139                result[attr] = list(map(140                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,141                    value142                ))143            elif hasattr(value, "to_dict"):144                result[attr] = value.to_dict()145            elif isinstance(value, dict):146                result[attr] = dict(map(147                    lambda item: (item[0], item[1].to_dict())148                    if hasattr(item[1], "to_dict") else item,149                    value.items()150                ))151            else:152                result[attr] = value153 154        return result155 156    def to_str(self):157        """Returns the string representation of the model"""158        return pprint.pformat(self.to_dict())159 160    def __repr__(self):161        """For `print` and `pprint`"""162        return self.to_str()163 164    def __eq__(self, other):165        """Returns true if both objects are equal"""166        if not isinstance(other, V1CapacityRequestPolicy):167            return False168 169        return self.to_dict() == other.to_dict()170 171    def __ne__(self, other):172        """Returns true if both objects are not equal"""173        if not isinstance(other, V1CapacityRequestPolicy):174            return True175 176        return self.to_dict() != other.to_dict()177 
codekingpro/portable-devtools · Team Ai