Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v2_metric_spec.py254 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 V2MetricSpec(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        'container_resource': 'V2ContainerResourceMetricSource',37        'external': 'V2ExternalMetricSource',38        'object': 'V2ObjectMetricSource',39        'pods': 'V2PodsMetricSource',40        'resource': 'V2ResourceMetricSource',41        'type': 'str'42    }43 44    attribute_map = {45        'container_resource': 'containerResource',46        'external': 'external',47        'object': 'object',48        'pods': 'pods',49        'resource': 'resource',50        'type': 'type'51    }52 53    def __init__(self, container_resource=None, external=None, object=None, pods=None, resource=None, type=None, local_vars_configuration=None):  # noqa: E50154        """V2MetricSpec - a model defined in OpenAPI"""  # noqa: E50155        if local_vars_configuration is None:56            local_vars_configuration = Configuration()57        self.local_vars_configuration = local_vars_configuration58 59        self._container_resource = None60        self._external = None61        self._object = None62        self._pods = None63        self._resource = None64        self._type = None65        self.discriminator = None66 67        if container_resource is not None:68            self.container_resource = container_resource69        if external is not None:70            self.external = external71        if object is not None:72            self.object = object73        if pods is not None:74            self.pods = pods75        if resource is not None:76            self.resource = resource77        self.type = type78 79    @property80    def container_resource(self):81        """Gets the container_resource of this V2MetricSpec.  # noqa: E50182 83 84        :return: The container_resource of this V2MetricSpec.  # noqa: E50185        :rtype: V2ContainerResourceMetricSource86        """87        return self._container_resource88 89    @container_resource.setter90    def container_resource(self, container_resource):91        """Sets the container_resource of this V2MetricSpec.92 93 94        :param container_resource: The container_resource of this V2MetricSpec.  # noqa: E50195        :type: V2ContainerResourceMetricSource96        """97 98        self._container_resource = container_resource99 100    @property101    def external(self):102        """Gets the external of this V2MetricSpec.  # noqa: E501103 104 105        :return: The external of this V2MetricSpec.  # noqa: E501106        :rtype: V2ExternalMetricSource107        """108        return self._external109 110    @external.setter111    def external(self, external):112        """Sets the external of this V2MetricSpec.113 114 115        :param external: The external of this V2MetricSpec.  # noqa: E501116        :type: V2ExternalMetricSource117        """118 119        self._external = external120 121    @property122    def object(self):123        """Gets the object of this V2MetricSpec.  # noqa: E501124 125 126        :return: The object of this V2MetricSpec.  # noqa: E501127        :rtype: V2ObjectMetricSource128        """129        return self._object130 131    @object.setter132    def object(self, object):133        """Sets the object of this V2MetricSpec.134 135 136        :param object: The object of this V2MetricSpec.  # noqa: E501137        :type: V2ObjectMetricSource138        """139 140        self._object = object141 142    @property143    def pods(self):144        """Gets the pods of this V2MetricSpec.  # noqa: E501145 146 147        :return: The pods of this V2MetricSpec.  # noqa: E501148        :rtype: V2PodsMetricSource149        """150        return self._pods151 152    @pods.setter153    def pods(self, pods):154        """Sets the pods of this V2MetricSpec.155 156 157        :param pods: The pods of this V2MetricSpec.  # noqa: E501158        :type: V2PodsMetricSource159        """160 161        self._pods = pods162 163    @property164    def resource(self):165        """Gets the resource of this V2MetricSpec.  # noqa: E501166 167 168        :return: The resource of this V2MetricSpec.  # noqa: E501169        :rtype: V2ResourceMetricSource170        """171        return self._resource172 173    @resource.setter174    def resource(self, resource):175        """Sets the resource of this V2MetricSpec.176 177 178        :param resource: The resource of this V2MetricSpec.  # noqa: E501179        :type: V2ResourceMetricSource180        """181 182        self._resource = resource183 184    @property185    def type(self):186        """Gets the type of this V2MetricSpec.  # noqa: E501187 188        type is the type of metric source.  It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.  # noqa: E501189 190        :return: The type of this V2MetricSpec.  # noqa: E501191        :rtype: str192        """193        return self._type194 195    @type.setter196    def type(self, type):197        """Sets the type of this V2MetricSpec.198 199        type is the type of metric source.  It should be one of \"ContainerResource\", \"External\", \"Object\", \"Pods\" or \"Resource\", each mapping to a matching field in the object.  # noqa: E501200 201        :param type: The type of this V2MetricSpec.  # noqa: E501202        :type: str203        """204        if self.local_vars_configuration.client_side_validation and type is None:  # noqa: E501205            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501206 207        self._type = type208 209    def to_dict(self):210        """Returns the model properties as a dict"""211        result = {}212 213        for attr, _ in six.iteritems(self.openapi_types):214            value = getattr(self, attr)215            if isinstance(value, list):216                result[attr] = list(map(217                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,218                    value219                ))220            elif hasattr(value, "to_dict"):221                result[attr] = value.to_dict()222            elif isinstance(value, dict):223                result[attr] = dict(map(224                    lambda item: (item[0], item[1].to_dict())225                    if hasattr(item[1], "to_dict") else item,226                    value.items()227                ))228            else:229                result[attr] = value230 231        return result232 233    def to_str(self):234        """Returns the string representation of the model"""235        return pprint.pformat(self.to_dict())236 237    def __repr__(self):238        """For `print` and `pprint`"""239        return self.to_str()240 241    def __eq__(self, other):242        """Returns true if both objects are equal"""243        if not isinstance(other, V2MetricSpec):244            return False245 246        return self.to_dict() == other.to_dict()247 248    def __ne__(self, other):249        """Returns true if both objects are not equal"""250        if not isinstance(other, V2MetricSpec):251            return True252 253        return self.to_dict() != other.to_dict()254 
codekingpro/portable-devtools · Team Ai