Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_workload_reference.py181 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 V1WorkloadReference(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        'name': 'str',37        'pod_group': 'str',38        'pod_group_replica_key': 'str'39    }40 41    attribute_map = {42        'name': 'name',43        'pod_group': 'podGroup',44        'pod_group_replica_key': 'podGroupReplicaKey'45    }46 47    def __init__(self, name=None, pod_group=None, pod_group_replica_key=None, local_vars_configuration=None):  # noqa: E50148        """V1WorkloadReference - 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._name = None54        self._pod_group = None55        self._pod_group_replica_key = None56        self.discriminator = None57 58        self.name = name59        self.pod_group = pod_group60        if pod_group_replica_key is not None:61            self.pod_group_replica_key = pod_group_replica_key62 63    @property64    def name(self):65        """Gets the name of this V1WorkloadReference.  # noqa: E50166 67        Name defines the name of the Workload object this Pod belongs to. Workload must be in the same namespace as the Pod. If it doesn't match any existing Workload, the Pod will remain unschedulable until a Workload object is created and observed by the kube-scheduler. It must be a DNS subdomain.  # noqa: E50168 69        :return: The name of this V1WorkloadReference.  # noqa: E50170        :rtype: str71        """72        return self._name73 74    @name.setter75    def name(self, name):76        """Sets the name of this V1WorkloadReference.77 78        Name defines the name of the Workload object this Pod belongs to. Workload must be in the same namespace as the Pod. If it doesn't match any existing Workload, the Pod will remain unschedulable until a Workload object is created and observed by the kube-scheduler. It must be a DNS subdomain.  # noqa: E50179 80        :param name: The name of this V1WorkloadReference.  # noqa: E50181        :type: str82        """83        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E50184            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E50185 86        self._name = name87 88    @property89    def pod_group(self):90        """Gets the pod_group of this V1WorkloadReference.  # noqa: E50191 92        PodGroup is the name of the PodGroup within the Workload that this Pod belongs to. If it doesn't match any existing PodGroup within the Workload, the Pod will remain unschedulable until the Workload object is recreated and observed by the kube-scheduler. It must be a DNS label.  # noqa: E50193 94        :return: The pod_group of this V1WorkloadReference.  # noqa: E50195        :rtype: str96        """97        return self._pod_group98 99    @pod_group.setter100    def pod_group(self, pod_group):101        """Sets the pod_group of this V1WorkloadReference.102 103        PodGroup is the name of the PodGroup within the Workload that this Pod belongs to. If it doesn't match any existing PodGroup within the Workload, the Pod will remain unschedulable until the Workload object is recreated and observed by the kube-scheduler. It must be a DNS label.  # noqa: E501104 105        :param pod_group: The pod_group of this V1WorkloadReference.  # noqa: E501106        :type: str107        """108        if self.local_vars_configuration.client_side_validation and pod_group is None:  # noqa: E501109            raise ValueError("Invalid value for `pod_group`, must not be `None`")  # noqa: E501110 111        self._pod_group = pod_group112 113    @property114    def pod_group_replica_key(self):115        """Gets the pod_group_replica_key of this V1WorkloadReference.  # noqa: E501116 117        PodGroupReplicaKey specifies the replica key of the PodGroup to which this Pod belongs. It is used to distinguish pods belonging to different replicas of the same pod group. The pod group policy is applied separately to each replica. When set, it must be a DNS label.  # noqa: E501118 119        :return: The pod_group_replica_key of this V1WorkloadReference.  # noqa: E501120        :rtype: str121        """122        return self._pod_group_replica_key123 124    @pod_group_replica_key.setter125    def pod_group_replica_key(self, pod_group_replica_key):126        """Sets the pod_group_replica_key of this V1WorkloadReference.127 128        PodGroupReplicaKey specifies the replica key of the PodGroup to which this Pod belongs. It is used to distinguish pods belonging to different replicas of the same pod group. The pod group policy is applied separately to each replica. When set, it must be a DNS label.  # noqa: E501129 130        :param pod_group_replica_key: The pod_group_replica_key of this V1WorkloadReference.  # noqa: E501131        :type: str132        """133 134        self._pod_group_replica_key = pod_group_replica_key135 136    def to_dict(self):137        """Returns the model properties as a dict"""138        result = {}139 140        for attr, _ in six.iteritems(self.openapi_types):141            value = getattr(self, attr)142            if isinstance(value, list):143                result[attr] = list(map(144                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,145                    value146                ))147            elif hasattr(value, "to_dict"):148                result[attr] = value.to_dict()149            elif isinstance(value, dict):150                result[attr] = dict(map(151                    lambda item: (item[0], item[1].to_dict())152                    if hasattr(item[1], "to_dict") else item,153                    value.items()154                ))155            else:156                result[attr] = value157 158        return result159 160    def to_str(self):161        """Returns the string representation of the model"""162        return pprint.pformat(self.to_dict())163 164    def __repr__(self):165        """For `print` and `pprint`"""166        return self.to_str()167 168    def __eq__(self, other):169        """Returns true if both objects are equal"""170        if not isinstance(other, V1WorkloadReference):171            return False172 173        return self.to_dict() == other.to_dict()174 175    def __ne__(self, other):176        """Returns true if both objects are not equal"""177        if not isinstance(other, V1WorkloadReference):178            return True179 180        return self.to_dict() != other.to_dict()181 
codekingpro/portable-devtools · Team Ai