Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_port_status.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 V1PortStatus(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        'error': 'str',37        'port': 'int',38        'protocol': 'str'39    }40 41    attribute_map = {42        'error': 'error',43        'port': 'port',44        'protocol': 'protocol'45    }46 47    def __init__(self, error=None, port=None, protocol=None, local_vars_configuration=None):  # noqa: E50148        """V1PortStatus - 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._error = None54        self._port = None55        self._protocol = None56        self.discriminator = None57 58        if error is not None:59            self.error = error60        self.port = port61        self.protocol = protocol62 63    @property64    def error(self):65        """Gets the error of this V1PortStatus.  # noqa: E50166 67        Error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use   CamelCase names - cloud provider specific error values must have names that comply with the   format foo.example.com/CamelCase.  # noqa: E50168 69        :return: The error of this V1PortStatus.  # noqa: E50170        :rtype: str71        """72        return self._error73 74    @error.setter75    def error(self, error):76        """Sets the error of this V1PortStatus.77 78        Error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use   CamelCase names - cloud provider specific error values must have names that comply with the   format foo.example.com/CamelCase.  # noqa: E50179 80        :param error: The error of this V1PortStatus.  # noqa: E50181        :type: str82        """83 84        self._error = error85 86    @property87    def port(self):88        """Gets the port of this V1PortStatus.  # noqa: E50189 90        Port is the port number of the service port of which status is recorded here  # noqa: E50191 92        :return: The port of this V1PortStatus.  # noqa: E50193        :rtype: int94        """95        return self._port96 97    @port.setter98    def port(self, port):99        """Sets the port of this V1PortStatus.100 101        Port is the port number of the service port of which status is recorded here  # noqa: E501102 103        :param port: The port of this V1PortStatus.  # noqa: E501104        :type: int105        """106        if self.local_vars_configuration.client_side_validation and port is None:  # noqa: E501107            raise ValueError("Invalid value for `port`, must not be `None`")  # noqa: E501108 109        self._port = port110 111    @property112    def protocol(self):113        """Gets the protocol of this V1PortStatus.  # noqa: E501114 115        Protocol is the protocol of the service port of which status is recorded here The supported values are: \"TCP\", \"UDP\", \"SCTP\"  # noqa: E501116 117        :return: The protocol of this V1PortStatus.  # noqa: E501118        :rtype: str119        """120        return self._protocol121 122    @protocol.setter123    def protocol(self, protocol):124        """Sets the protocol of this V1PortStatus.125 126        Protocol is the protocol of the service port of which status is recorded here The supported values are: \"TCP\", \"UDP\", \"SCTP\"  # noqa: E501127 128        :param protocol: The protocol of this V1PortStatus.  # noqa: E501129        :type: str130        """131        if self.local_vars_configuration.client_side_validation and protocol is None:  # noqa: E501132            raise ValueError("Invalid value for `protocol`, must not be `None`")  # noqa: E501133 134        self._protocol = protocol135 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, V1PortStatus):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, V1PortStatus):178            return True179 180        return self.to_dict() != other.to_dict()181 
codekingpro/portable-devtools · Team Ai