Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v2_metric_target.py208 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 V2MetricTarget(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        'average_utilization': 'int',37        'average_value': 'str',38        'type': 'str',39        'value': 'str'40    }41 42    attribute_map = {43        'average_utilization': 'averageUtilization',44        'average_value': 'averageValue',45        'type': 'type',46        'value': 'value'47    }48 49    def __init__(self, average_utilization=None, average_value=None, type=None, value=None, local_vars_configuration=None):  # noqa: E50150        """V2MetricTarget - a model defined in OpenAPI"""  # noqa: E50151        if local_vars_configuration is None:52            local_vars_configuration = Configuration()53        self.local_vars_configuration = local_vars_configuration54 55        self._average_utilization = None56        self._average_value = None57        self._type = None58        self._value = None59        self.discriminator = None60 61        if average_utilization is not None:62            self.average_utilization = average_utilization63        if average_value is not None:64            self.average_value = average_value65        self.type = type66        if value is not None:67            self.value = value68 69    @property70    def average_utilization(self):71        """Gets the average_utilization of this V2MetricTarget.  # noqa: E50172 73        averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type  # noqa: E50174 75        :return: The average_utilization of this V2MetricTarget.  # noqa: E50176        :rtype: int77        """78        return self._average_utilization79 80    @average_utilization.setter81    def average_utilization(self, average_utilization):82        """Sets the average_utilization of this V2MetricTarget.83 84        averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type  # noqa: E50185 86        :param average_utilization: The average_utilization of this V2MetricTarget.  # noqa: E50187        :type: int88        """89 90        self._average_utilization = average_utilization91 92    @property93    def average_value(self):94        """Gets the average_value of this V2MetricTarget.  # noqa: E50195 96        averageValue is the target value of the average of the metric across all relevant pods (as a quantity)  # noqa: E50197 98        :return: The average_value of this V2MetricTarget.  # noqa: E50199        :rtype: str100        """101        return self._average_value102 103    @average_value.setter104    def average_value(self, average_value):105        """Sets the average_value of this V2MetricTarget.106 107        averageValue is the target value of the average of the metric across all relevant pods (as a quantity)  # noqa: E501108 109        :param average_value: The average_value of this V2MetricTarget.  # noqa: E501110        :type: str111        """112 113        self._average_value = average_value114 115    @property116    def type(self):117        """Gets the type of this V2MetricTarget.  # noqa: E501118 119        type represents whether the metric type is Utilization, Value, or AverageValue  # noqa: E501120 121        :return: The type of this V2MetricTarget.  # noqa: E501122        :rtype: str123        """124        return self._type125 126    @type.setter127    def type(self, type):128        """Sets the type of this V2MetricTarget.129 130        type represents whether the metric type is Utilization, Value, or AverageValue  # noqa: E501131 132        :param type: The type of this V2MetricTarget.  # noqa: E501133        :type: str134        """135        if self.local_vars_configuration.client_side_validation and type is None:  # noqa: E501136            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501137 138        self._type = type139 140    @property141    def value(self):142        """Gets the value of this V2MetricTarget.  # noqa: E501143 144        value is the target value of the metric (as a quantity).  # noqa: E501145 146        :return: The value of this V2MetricTarget.  # noqa: E501147        :rtype: str148        """149        return self._value150 151    @value.setter152    def value(self, value):153        """Sets the value of this V2MetricTarget.154 155        value is the target value of the metric (as a quantity).  # noqa: E501156 157        :param value: The value of this V2MetricTarget.  # noqa: E501158        :type: str159        """160 161        self._value = value162 163    def to_dict(self):164        """Returns the model properties as a dict"""165        result = {}166 167        for attr, _ in six.iteritems(self.openapi_types):168            value = getattr(self, attr)169            if isinstance(value, list):170                result[attr] = list(map(171                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,172                    value173                ))174            elif hasattr(value, "to_dict"):175                result[attr] = value.to_dict()176            elif isinstance(value, dict):177                result[attr] = dict(map(178                    lambda item: (item[0], item[1].to_dict())179                    if hasattr(item[1], "to_dict") else item,180                    value.items()181                ))182            else:183                result[attr] = value184 185        return result186 187    def to_str(self):188        """Returns the string representation of the model"""189        return pprint.pformat(self.to_dict())190 191    def __repr__(self):192        """For `print` and `pprint`"""193        return self.to_str()194 195    def __eq__(self, other):196        """Returns true if both objects are equal"""197        if not isinstance(other, V2MetricTarget):198            return False199 200        return self.to_dict() == other.to_dict()201 202    def __ne__(self, other):203        """Returns true if both objects are not equal"""204        if not isinstance(other, V2MetricTarget):205            return True206 207        return self.to_dict() != other.to_dict()208 
codekingpro/portable-devtools · Team Ai