Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_endpoint_slice.py263 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 V1EndpointSlice(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        'address_type': 'str',37        'api_version': 'str',38        'endpoints': 'list[V1Endpoint]',39        'kind': 'str',40        'metadata': 'V1ObjectMeta',41        'ports': 'list[DiscoveryV1EndpointPort]'42    }43 44    attribute_map = {45        'address_type': 'addressType',46        'api_version': 'apiVersion',47        'endpoints': 'endpoints',48        'kind': 'kind',49        'metadata': 'metadata',50        'ports': 'ports'51    }52 53    def __init__(self, address_type=None, api_version=None, endpoints=None, kind=None, metadata=None, ports=None, local_vars_configuration=None):  # noqa: E50154        """V1EndpointSlice - 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._address_type = None60        self._api_version = None61        self._endpoints = None62        self._kind = None63        self._metadata = None64        self._ports = None65        self.discriminator = None66 67        self.address_type = address_type68        if api_version is not None:69            self.api_version = api_version70        self.endpoints = endpoints71        if kind is not None:72            self.kind = kind73        if metadata is not None:74            self.metadata = metadata75        if ports is not None:76            self.ports = ports77 78    @property79    def address_type(self):80        """Gets the address_type of this V1EndpointSlice.  # noqa: E50181 82        addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.  # noqa: E50183 84        :return: The address_type of this V1EndpointSlice.  # noqa: E50185        :rtype: str86        """87        return self._address_type88 89    @address_type.setter90    def address_type(self, address_type):91        """Sets the address_type of this V1EndpointSlice.92 93        addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.  # noqa: E50194 95        :param address_type: The address_type of this V1EndpointSlice.  # noqa: E50196        :type: str97        """98        if self.local_vars_configuration.client_side_validation and address_type is None:  # noqa: E50199            raise ValueError("Invalid value for `address_type`, must not be `None`")  # noqa: E501100 101        self._address_type = address_type102 103    @property104    def api_version(self):105        """Gets the api_version of this V1EndpointSlice.  # noqa: E501106 107        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: E501108 109        :return: The api_version of this V1EndpointSlice.  # noqa: E501110        :rtype: str111        """112        return self._api_version113 114    @api_version.setter115    def api_version(self, api_version):116        """Sets the api_version of this V1EndpointSlice.117 118        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: E501119 120        :param api_version: The api_version of this V1EndpointSlice.  # noqa: E501121        :type: str122        """123 124        self._api_version = api_version125 126    @property127    def endpoints(self):128        """Gets the endpoints of this V1EndpointSlice.  # noqa: E501129 130        endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.  # noqa: E501131 132        :return: The endpoints of this V1EndpointSlice.  # noqa: E501133        :rtype: list[V1Endpoint]134        """135        return self._endpoints136 137    @endpoints.setter138    def endpoints(self, endpoints):139        """Sets the endpoints of this V1EndpointSlice.140 141        endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.  # noqa: E501142 143        :param endpoints: The endpoints of this V1EndpointSlice.  # noqa: E501144        :type: list[V1Endpoint]145        """146        if self.local_vars_configuration.client_side_validation and endpoints is None:  # noqa: E501147            raise ValueError("Invalid value for `endpoints`, must not be `None`")  # noqa: E501148 149        self._endpoints = endpoints150 151    @property152    def kind(self):153        """Gets the kind of this V1EndpointSlice.  # noqa: E501154 155        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: E501156 157        :return: The kind of this V1EndpointSlice.  # noqa: E501158        :rtype: str159        """160        return self._kind161 162    @kind.setter163    def kind(self, kind):164        """Sets the kind of this V1EndpointSlice.165 166        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: E501167 168        :param kind: The kind of this V1EndpointSlice.  # noqa: E501169        :type: str170        """171 172        self._kind = kind173 174    @property175    def metadata(self):176        """Gets the metadata of this V1EndpointSlice.  # noqa: E501177 178 179        :return: The metadata of this V1EndpointSlice.  # noqa: E501180        :rtype: V1ObjectMeta181        """182        return self._metadata183 184    @metadata.setter185    def metadata(self, metadata):186        """Sets the metadata of this V1EndpointSlice.187 188 189        :param metadata: The metadata of this V1EndpointSlice.  # noqa: E501190        :type: V1ObjectMeta191        """192 193        self._metadata = metadata194 195    @property196    def ports(self):197        """Gets the ports of this V1EndpointSlice.  # noqa: E501198 199        ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.  # noqa: E501200 201        :return: The ports of this V1EndpointSlice.  # noqa: E501202        :rtype: list[DiscoveryV1EndpointPort]203        """204        return self._ports205 206    @ports.setter207    def ports(self, ports):208        """Sets the ports of this V1EndpointSlice.209 210        ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.  # noqa: E501211 212        :param ports: The ports of this V1EndpointSlice.  # noqa: E501213        :type: list[DiscoveryV1EndpointPort]214        """215 216        self._ports = ports217 218    def to_dict(self):219        """Returns the model properties as a dict"""220        result = {}221 222        for attr, _ in six.iteritems(self.openapi_types):223            value = getattr(self, attr)224            if isinstance(value, list):225                result[attr] = list(map(226                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,227                    value228                ))229            elif hasattr(value, "to_dict"):230                result[attr] = value.to_dict()231            elif isinstance(value, dict):232                result[attr] = dict(map(233                    lambda item: (item[0], item[1].to_dict())234                    if hasattr(item[1], "to_dict") else item,235                    value.items()236                ))237            else:238                result[attr] = value239 240        return result241 242    def to_str(self):243        """Returns the string representation of the model"""244        return pprint.pformat(self.to_dict())245 246    def __repr__(self):247        """For `print` and `pprint`"""248        return self.to_str()249 250    def __eq__(self, other):251        """Returns true if both objects are equal"""252        if not isinstance(other, V1EndpointSlice):253            return False254 255        return self.to_dict() == other.to_dict()256 257    def __ne__(self, other):258        """Returns true if both objects are not equal"""259        if not isinstance(other, V1EndpointSlice):260            return True261 262        return self.to_dict() != other.to_dict()263 
codekingpro/portable-devtools · Team Ai