# coding: utf-8

"""
    apig

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: common-version
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from volcenginesdkcore.configuration import Configuration


class UpdateUpstreamRequest(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'circuit_breaking_settings': 'CircuitBreakingSettingsForUpdateUpstreamInput',
        'comments': 'str',
        'connection_pool_settings': 'ConnectionPoolSettingsForUpdateUpstreamInput',
        'id': 'str',
        'load_balancer_settings': 'LoadBalancerSettingsForUpdateUpstreamInput',
        'name': 'str',
        'protocol': 'str',
        'source_type': 'str',
        'tls_settings': 'TlsSettingsForUpdateUpstreamInput',
        'upstream_spec': 'UpstreamSpecForUpdateUpstreamInput'
    }

    attribute_map = {
        'circuit_breaking_settings': 'CircuitBreakingSettings',
        'comments': 'Comments',
        'connection_pool_settings': 'ConnectionPoolSettings',
        'id': 'Id',
        'load_balancer_settings': 'LoadBalancerSettings',
        'name': 'Name',
        'protocol': 'Protocol',
        'source_type': 'SourceType',
        'tls_settings': 'TlsSettings',
        'upstream_spec': 'UpstreamSpec'
    }

    def __init__(self, circuit_breaking_settings=None, comments=None, connection_pool_settings=None, id=None, load_balancer_settings=None, name=None, protocol=None, source_type=None, tls_settings=None, upstream_spec=None, _configuration=None):  # noqa: E501
        """UpdateUpstreamRequest - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._circuit_breaking_settings = None
        self._comments = None
        self._connection_pool_settings = None
        self._id = None
        self._load_balancer_settings = None
        self._name = None
        self._protocol = None
        self._source_type = None
        self._tls_settings = None
        self._upstream_spec = None
        self.discriminator = None

        if circuit_breaking_settings is not None:
            self.circuit_breaking_settings = circuit_breaking_settings
        if comments is not None:
            self.comments = comments
        if connection_pool_settings is not None:
            self.connection_pool_settings = connection_pool_settings
        self.id = id
        if load_balancer_settings is not None:
            self.load_balancer_settings = load_balancer_settings
        self.name = name
        if protocol is not None:
            self.protocol = protocol
        self.source_type = source_type
        if tls_settings is not None:
            self.tls_settings = tls_settings
        if upstream_spec is not None:
            self.upstream_spec = upstream_spec

    @property
    def circuit_breaking_settings(self):
        """Gets the circuit_breaking_settings of this UpdateUpstreamRequest.  # noqa: E501


        :return: The circuit_breaking_settings of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: CircuitBreakingSettingsForUpdateUpstreamInput
        """
        return self._circuit_breaking_settings

    @circuit_breaking_settings.setter
    def circuit_breaking_settings(self, circuit_breaking_settings):
        """Sets the circuit_breaking_settings of this UpdateUpstreamRequest.


        :param circuit_breaking_settings: The circuit_breaking_settings of this UpdateUpstreamRequest.  # noqa: E501
        :type: CircuitBreakingSettingsForUpdateUpstreamInput
        """

        self._circuit_breaking_settings = circuit_breaking_settings

    @property
    def comments(self):
        """Gets the comments of this UpdateUpstreamRequest.  # noqa: E501


        :return: The comments of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: str
        """
        return self._comments

    @comments.setter
    def comments(self, comments):
        """Sets the comments of this UpdateUpstreamRequest.


        :param comments: The comments of this UpdateUpstreamRequest.  # noqa: E501
        :type: str
        """

        self._comments = comments

    @property
    def connection_pool_settings(self):
        """Gets the connection_pool_settings of this UpdateUpstreamRequest.  # noqa: E501


        :return: The connection_pool_settings of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: ConnectionPoolSettingsForUpdateUpstreamInput
        """
        return self._connection_pool_settings

    @connection_pool_settings.setter
    def connection_pool_settings(self, connection_pool_settings):
        """Sets the connection_pool_settings of this UpdateUpstreamRequest.


        :param connection_pool_settings: The connection_pool_settings of this UpdateUpstreamRequest.  # noqa: E501
        :type: ConnectionPoolSettingsForUpdateUpstreamInput
        """

        self._connection_pool_settings = connection_pool_settings

    @property
    def id(self):
        """Gets the id of this UpdateUpstreamRequest.  # noqa: E501


        :return: The id of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this UpdateUpstreamRequest.


        :param id: The id of this UpdateUpstreamRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

    @property
    def load_balancer_settings(self):
        """Gets the load_balancer_settings of this UpdateUpstreamRequest.  # noqa: E501


        :return: The load_balancer_settings of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: LoadBalancerSettingsForUpdateUpstreamInput
        """
        return self._load_balancer_settings

    @load_balancer_settings.setter
    def load_balancer_settings(self, load_balancer_settings):
        """Sets the load_balancer_settings of this UpdateUpstreamRequest.


        :param load_balancer_settings: The load_balancer_settings of this UpdateUpstreamRequest.  # noqa: E501
        :type: LoadBalancerSettingsForUpdateUpstreamInput
        """

        self._load_balancer_settings = load_balancer_settings

    @property
    def name(self):
        """Gets the name of this UpdateUpstreamRequest.  # noqa: E501


        :return: The name of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this UpdateUpstreamRequest.


        :param name: The name of this UpdateUpstreamRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

    @property
    def protocol(self):
        """Gets the protocol of this UpdateUpstreamRequest.  # noqa: E501


        :return: The protocol of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: str
        """
        return self._protocol

    @protocol.setter
    def protocol(self, protocol):
        """Sets the protocol of this UpdateUpstreamRequest.


        :param protocol: The protocol of this UpdateUpstreamRequest.  # noqa: E501
        :type: str
        """

        self._protocol = protocol

    @property
    def source_type(self):
        """Gets the source_type of this UpdateUpstreamRequest.  # noqa: E501


        :return: The source_type of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: str
        """
        return self._source_type

    @source_type.setter
    def source_type(self, source_type):
        """Sets the source_type of this UpdateUpstreamRequest.


        :param source_type: The source_type of this UpdateUpstreamRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and source_type is None:
            raise ValueError("Invalid value for `source_type`, must not be `None`")  # noqa: E501

        self._source_type = source_type

    @property
    def tls_settings(self):
        """Gets the tls_settings of this UpdateUpstreamRequest.  # noqa: E501


        :return: The tls_settings of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: TlsSettingsForUpdateUpstreamInput
        """
        return self._tls_settings

    @tls_settings.setter
    def tls_settings(self, tls_settings):
        """Sets the tls_settings of this UpdateUpstreamRequest.


        :param tls_settings: The tls_settings of this UpdateUpstreamRequest.  # noqa: E501
        :type: TlsSettingsForUpdateUpstreamInput
        """

        self._tls_settings = tls_settings

    @property
    def upstream_spec(self):
        """Gets the upstream_spec of this UpdateUpstreamRequest.  # noqa: E501


        :return: The upstream_spec of this UpdateUpstreamRequest.  # noqa: E501
        :rtype: UpstreamSpecForUpdateUpstreamInput
        """
        return self._upstream_spec

    @upstream_spec.setter
    def upstream_spec(self, upstream_spec):
        """Sets the upstream_spec of this UpdateUpstreamRequest.


        :param upstream_spec: The upstream_spec of this UpdateUpstreamRequest.  # noqa: E501
        :type: UpstreamSpecForUpdateUpstreamInput
        """

        self._upstream_spec = upstream_spec

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(UpdateUpstreamRequest, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, UpdateUpstreamRequest):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, UpdateUpstreamRequest):
            return True

        return self.to_dict() != other.to_dict()
