Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_priority_class.py290 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 V1PriorityClass(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        'api_version': 'str',37        'description': 'str',38        'global_default': 'bool',39        'kind': 'str',40        'metadata': 'V1ObjectMeta',41        'preemption_policy': 'str',42        'value': 'int'43    }44 45    attribute_map = {46        'api_version': 'apiVersion',47        'description': 'description',48        'global_default': 'globalDefault',49        'kind': 'kind',50        'metadata': 'metadata',51        'preemption_policy': 'preemptionPolicy',52        'value': 'value'53    }54 55    def __init__(self, api_version=None, description=None, global_default=None, kind=None, metadata=None, preemption_policy=None, value=None, local_vars_configuration=None):  # noqa: E50156        """V1PriorityClass - a model defined in OpenAPI"""  # noqa: E50157        if local_vars_configuration is None:58            local_vars_configuration = Configuration()59        self.local_vars_configuration = local_vars_configuration60 61        self._api_version = None62        self._description = None63        self._global_default = None64        self._kind = None65        self._metadata = None66        self._preemption_policy = None67        self._value = None68        self.discriminator = None69 70        if api_version is not None:71            self.api_version = api_version72        if description is not None:73            self.description = description74        if global_default is not None:75            self.global_default = global_default76        if kind is not None:77            self.kind = kind78        if metadata is not None:79            self.metadata = metadata80        if preemption_policy is not None:81            self.preemption_policy = preemption_policy82        self.value = value83 84    @property85    def api_version(self):86        """Gets the api_version of this V1PriorityClass.  # noqa: E50187 88        APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources  # noqa: E50189 90        :return: The api_version of this V1PriorityClass.  # noqa: E50191        :rtype: str92        """93        return self._api_version94 95    @api_version.setter96    def api_version(self, api_version):97        """Sets the api_version of this V1PriorityClass.98 99        APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources  # noqa: E501100 101        :param api_version: The api_version of this V1PriorityClass.  # noqa: E501102        :type: str103        """104 105        self._api_version = api_version106 107    @property108    def description(self):109        """Gets the description of this V1PriorityClass.  # noqa: E501110 111        description is an arbitrary string that usually provides guidelines on when this priority class should be used.  # noqa: E501112 113        :return: The description of this V1PriorityClass.  # noqa: E501114        :rtype: str115        """116        return self._description117 118    @description.setter119    def description(self, description):120        """Sets the description of this V1PriorityClass.121 122        description is an arbitrary string that usually provides guidelines on when this priority class should be used.  # noqa: E501123 124        :param description: The description of this V1PriorityClass.  # noqa: E501125        :type: str126        """127 128        self._description = description129 130    @property131    def global_default(self):132        """Gets the global_default of this V1PriorityClass.  # noqa: E501133 134        globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.  # noqa: E501135 136        :return: The global_default of this V1PriorityClass.  # noqa: E501137        :rtype: bool138        """139        return self._global_default140 141    @global_default.setter142    def global_default(self, global_default):143        """Sets the global_default of this V1PriorityClass.144 145        globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.  # noqa: E501146 147        :param global_default: The global_default of this V1PriorityClass.  # noqa: E501148        :type: bool149        """150 151        self._global_default = global_default152 153    @property154    def kind(self):155        """Gets the kind of this V1PriorityClass.  # noqa: E501156 157        Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds  # noqa: E501158 159        :return: The kind of this V1PriorityClass.  # noqa: E501160        :rtype: str161        """162        return self._kind163 164    @kind.setter165    def kind(self, kind):166        """Sets the kind of this V1PriorityClass.167 168        Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds  # noqa: E501169 170        :param kind: The kind of this V1PriorityClass.  # noqa: E501171        :type: str172        """173 174        self._kind = kind175 176    @property177    def metadata(self):178        """Gets the metadata of this V1PriorityClass.  # noqa: E501179 180 181        :return: The metadata of this V1PriorityClass.  # noqa: E501182        :rtype: V1ObjectMeta183        """184        return self._metadata185 186    @metadata.setter187    def metadata(self, metadata):188        """Sets the metadata of this V1PriorityClass.189 190 191        :param metadata: The metadata of this V1PriorityClass.  # noqa: E501192        :type: V1ObjectMeta193        """194 195        self._metadata = metadata196 197    @property198    def preemption_policy(self):199        """Gets the preemption_policy of this V1PriorityClass.  # noqa: E501200 201        preemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.  # noqa: E501202 203        :return: The preemption_policy of this V1PriorityClass.  # noqa: E501204        :rtype: str205        """206        return self._preemption_policy207 208    @preemption_policy.setter209    def preemption_policy(self, preemption_policy):210        """Sets the preemption_policy of this V1PriorityClass.211 212        preemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.  # noqa: E501213 214        :param preemption_policy: The preemption_policy of this V1PriorityClass.  # noqa: E501215        :type: str216        """217 218        self._preemption_policy = preemption_policy219 220    @property221    def value(self):222        """Gets the value of this V1PriorityClass.  # noqa: E501223 224        value represents the integer value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.  # noqa: E501225 226        :return: The value of this V1PriorityClass.  # noqa: E501227        :rtype: int228        """229        return self._value230 231    @value.setter232    def value(self, value):233        """Sets the value of this V1PriorityClass.234 235        value represents the integer value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.  # noqa: E501236 237        :param value: The value of this V1PriorityClass.  # noqa: E501238        :type: int239        """240        if self.local_vars_configuration.client_side_validation and value is None:  # noqa: E501241            raise ValueError("Invalid value for `value`, must not be `None`")  # noqa: E501242 243        self._value = value244 245    def to_dict(self):246        """Returns the model properties as a dict"""247        result = {}248 249        for attr, _ in six.iteritems(self.openapi_types):250            value = getattr(self, attr)251            if isinstance(value, list):252                result[attr] = list(map(253                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,254                    value255                ))256            elif hasattr(value, "to_dict"):257                result[attr] = value.to_dict()258            elif isinstance(value, dict):259                result[attr] = dict(map(260                    lambda item: (item[0], item[1].to_dict())261                    if hasattr(item[1], "to_dict") else item,262                    value.items()263                ))264            else:265                result[attr] = value266 267        return result268 269    def to_str(self):270        """Returns the string representation of the model"""271        return pprint.pformat(self.to_dict())272 273    def __repr__(self):274        """For `print` and `pprint`"""275        return self.to_str()276 277    def __eq__(self, other):278        """Returns true if both objects are equal"""279        if not isinstance(other, V1PriorityClass):280            return False281 282        return self.to_dict() == other.to_dict()283 284    def __ne__(self, other):285        """Returns true if both objects are not equal"""286        if not isinstance(other, V1PriorityClass):287            return True288 289        return self.to_dict() != other.to_dict()290 
codekingpro/portable-devtools · Team Ai