codekingpro/portable-devtools
114k
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 DiscoveryV1EndpointPort(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 'app_protocol': 'str',37 'name': 'str',38 'port': 'int',39 'protocol': 'str'40 }41 42 attribute_map = {43 'app_protocol': 'appProtocol',44 'name': 'name',45 'port': 'port',46 'protocol': 'protocol'47 }48 49 def __init__(self, app_protocol=None, name=None, port=None, protocol=None, local_vars_configuration=None): # noqa: E50150 """DiscoveryV1EndpointPort - a model defined in OpenAPI""" # noqa: E50151 if local_vars_configuration is None:52 local_vars_configuration = Configuration()53 self.local_vars_configuration = local_vars_configuration54 55 self._app_protocol = None56 self._name = None57 self._port = None58 self._protocol = None59 self.discriminator = None60 61 if app_protocol is not None:62 self.app_protocol = app_protocol63 if name is not None:64 self.name = name65 if port is not None:66 self.port = port67 if protocol is not None:68 self.protocol = protocol69 70 @property71 def app_protocol(self):72 """Gets the app_protocol of this DiscoveryV1EndpointPort. # noqa: E50173 74 The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. # noqa: E50175 76 :return: The app_protocol of this DiscoveryV1EndpointPort. # noqa: E50177 :rtype: str78 """79 return self._app_protocol80 81 @app_protocol.setter82 def app_protocol(self, app_protocol):83 """Sets the app_protocol of this DiscoveryV1EndpointPort.84 85 The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. # noqa: E50186 87 :param app_protocol: The app_protocol of this DiscoveryV1EndpointPort. # noqa: E50188 :type: str89 """90 91 self._app_protocol = app_protocol92 93 @property94 def name(self):95 """Gets the name of this DiscoveryV1EndpointPort. # noqa: E50196 97 name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E50198 99 :return: The name of this DiscoveryV1EndpointPort. # noqa: E501100 :rtype: str101 """102 return self._name103 104 @name.setter105 def name(self, name):106 """Sets the name of this DiscoveryV1EndpointPort.107 108 name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501109 110 :param name: The name of this DiscoveryV1EndpointPort. # noqa: E501111 :type: str112 """113 114 self._name = name115 116 @property117 def port(self):118 """Gets the port of this DiscoveryV1EndpointPort. # noqa: E501119 120 port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port. # noqa: E501121 122 :return: The port of this DiscoveryV1EndpointPort. # noqa: E501123 :rtype: int124 """125 return self._port126 127 @port.setter128 def port(self, port):129 """Sets the port of this DiscoveryV1EndpointPort.130 131 port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port. # noqa: E501132 133 :param port: The port of this DiscoveryV1EndpointPort. # noqa: E501134 :type: int135 """136 137 self._port = port138 139 @property140 def protocol(self):141 """Gets the protocol of this DiscoveryV1EndpointPort. # noqa: E501142 143 protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. # noqa: E501144 145 :return: The protocol of this DiscoveryV1EndpointPort. # noqa: E501146 :rtype: str147 """148 return self._protocol149 150 @protocol.setter151 def protocol(self, protocol):152 """Sets the protocol of this DiscoveryV1EndpointPort.153 154 protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. # noqa: E501155 156 :param protocol: The protocol of this DiscoveryV1EndpointPort. # noqa: E501157 :type: str158 """159 160 self._protocol = protocol161 162 def to_dict(self):163 """Returns the model properties as a dict"""164 result = {}165 166 for attr, _ in six.iteritems(self.openapi_types):167 value = getattr(self, attr)168 if isinstance(value, list):169 result[attr] = list(map(170 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,171 value172 ))173 elif hasattr(value, "to_dict"):174 result[attr] = value.to_dict()175 elif isinstance(value, dict):176 result[attr] = dict(map(177 lambda item: (item[0], item[1].to_dict())178 if hasattr(item[1], "to_dict") else item,179 value.items()180 ))181 else:182 result[attr] = value183 184 return result185 186 def to_str(self):187 """Returns the string representation of the model"""188 return pprint.pformat(self.to_dict())189 190 def __repr__(self):191 """For `print` and `pprint`"""192 return self.to_str()193 194 def __eq__(self, other):195 """Returns true if both objects are equal"""196 if not isinstance(other, DiscoveryV1EndpointPort):197 return False198 199 return self.to_dict() == other.to_dict()200 201 def __ne__(self, other):202 """Returns true if both objects are not equal"""203 if not isinstance(other, DiscoveryV1EndpointPort):204 return True205 206 return self.to_dict() != other.to_dict()207 