Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1beta2_device_request.py178 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 V1beta2DeviceRequest(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        'exactly': 'V1beta2ExactDeviceRequest',37        'first_available': 'list[V1beta2DeviceSubRequest]',38        'name': 'str'39    }40 41    attribute_map = {42        'exactly': 'exactly',43        'first_available': 'firstAvailable',44        'name': 'name'45    }46 47    def __init__(self, exactly=None, first_available=None, name=None, local_vars_configuration=None):  # noqa: E50148        """V1beta2DeviceRequest - 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._exactly = None54        self._first_available = None55        self._name = None56        self.discriminator = None57 58        if exactly is not None:59            self.exactly = exactly60        if first_available is not None:61            self.first_available = first_available62        self.name = name63 64    @property65    def exactly(self):66        """Gets the exactly of this V1beta2DeviceRequest.  # noqa: E50167 68 69        :return: The exactly of this V1beta2DeviceRequest.  # noqa: E50170        :rtype: V1beta2ExactDeviceRequest71        """72        return self._exactly73 74    @exactly.setter75    def exactly(self, exactly):76        """Sets the exactly of this V1beta2DeviceRequest.77 78 79        :param exactly: The exactly of this V1beta2DeviceRequest.  # noqa: E50180        :type: V1beta2ExactDeviceRequest81        """82 83        self._exactly = exactly84 85    @property86    def first_available(self):87        """Gets the first_available of this V1beta2DeviceRequest.  # noqa: E50188 89        FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used.  DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later.  # noqa: E50190 91        :return: The first_available of this V1beta2DeviceRequest.  # noqa: E50192        :rtype: list[V1beta2DeviceSubRequest]93        """94        return self._first_available95 96    @first_available.setter97    def first_available(self, first_available):98        """Sets the first_available of this V1beta2DeviceRequest.99 100        FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used.  DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later.  # noqa: E501101 102        :param first_available: The first_available of this V1beta2DeviceRequest.  # noqa: E501103        :type: list[V1beta2DeviceSubRequest]104        """105 106        self._first_available = first_available107 108    @property109    def name(self):110        """Gets the name of this V1beta2DeviceRequest.  # noqa: E501111 112        Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.  References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler.  Must be a DNS label.  # noqa: E501113 114        :return: The name of this V1beta2DeviceRequest.  # noqa: E501115        :rtype: str116        """117        return self._name118 119    @name.setter120    def name(self, name):121        """Sets the name of this V1beta2DeviceRequest.122 123        Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.  References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler.  Must be a DNS label.  # noqa: E501124 125        :param name: The name of this V1beta2DeviceRequest.  # noqa: E501126        :type: str127        """128        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501129            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501130 131        self._name = name132 133    def to_dict(self):134        """Returns the model properties as a dict"""135        result = {}136 137        for attr, _ in six.iteritems(self.openapi_types):138            value = getattr(self, attr)139            if isinstance(value, list):140                result[attr] = list(map(141                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,142                    value143                ))144            elif hasattr(value, "to_dict"):145                result[attr] = value.to_dict()146            elif isinstance(value, dict):147                result[attr] = dict(map(148                    lambda item: (item[0], item[1].to_dict())149                    if hasattr(item[1], "to_dict") else item,150                    value.items()151                ))152            else:153                result[attr] = value154 155        return result156 157    def to_str(self):158        """Returns the string representation of the model"""159        return pprint.pformat(self.to_dict())160 161    def __repr__(self):162        """For `print` and `pprint`"""163        return self.to_str()164 165    def __eq__(self, other):166        """Returns true if both objects are equal"""167        if not isinstance(other, V1beta2DeviceRequest):168            return False169 170        return self.to_dict() == other.to_dict()171 172    def __ne__(self, other):173        """Returns true if both objects are not equal"""174        if not isinstance(other, V1beta2DeviceRequest):175            return True176 177        return self.to_dict() != other.to_dict()178 
codekingpro/portable-devtools · Team Ai