# coding: utf-8

"""
    Nexus Repository Manager REST API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 3.20.1-01
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from nexus_api_python_client.configuration import Configuration


class HttpClientConnectionAttributes(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'retries': 'int',
        'user_agent_suffix': 'str',
        'timeout': 'int',
        'enable_circular_redirects': 'bool',
        'enable_cookies': 'bool'
    }

    attribute_map = {
        'retries': 'retries',
        'user_agent_suffix': 'userAgentSuffix',
        'timeout': 'timeout',
        'enable_circular_redirects': 'enableCircularRedirects',
        'enable_cookies': 'enableCookies'
    }

    def __init__(self, retries=None, user_agent_suffix=None, timeout=None, enable_circular_redirects=None, enable_cookies=None, local_vars_configuration=None):  # noqa: E501
        """HttpClientConnectionAttributes - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._retries = None
        self._user_agent_suffix = None
        self._timeout = None
        self._enable_circular_redirects = None
        self._enable_cookies = None
        self.discriminator = None

        if retries is not None:
            self.retries = retries
        if user_agent_suffix is not None:
            self.user_agent_suffix = user_agent_suffix
        if timeout is not None:
            self.timeout = timeout
        if enable_circular_redirects is not None:
            self.enable_circular_redirects = enable_circular_redirects
        if enable_cookies is not None:
            self.enable_cookies = enable_cookies

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

        Total retries if the initial connection attempt suffers a timeout  # noqa: E501

        :return: The retries of this HttpClientConnectionAttributes.  # noqa: E501
        :rtype: int
        """
        return self._retries

    @retries.setter
    def retries(self, retries):
        """Sets the retries of this HttpClientConnectionAttributes.

        Total retries if the initial connection attempt suffers a timeout  # noqa: E501

        :param retries: The retries of this HttpClientConnectionAttributes.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                retries is not None and retries > 10):  # noqa: E501
            raise ValueError("Invalid value for `retries`, must be a value less than or equal to `10`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                retries is not None and retries < 0):  # noqa: E501
            raise ValueError("Invalid value for `retries`, must be a value greater than or equal to `0`")  # noqa: E501

        self._retries = retries

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

        Custom fragment to append to User-Agent header in HTTP requests  # noqa: E501

        :return: The user_agent_suffix of this HttpClientConnectionAttributes.  # noqa: E501
        :rtype: str
        """
        return self._user_agent_suffix

    @user_agent_suffix.setter
    def user_agent_suffix(self, user_agent_suffix):
        """Sets the user_agent_suffix of this HttpClientConnectionAttributes.

        Custom fragment to append to User-Agent header in HTTP requests  # noqa: E501

        :param user_agent_suffix: The user_agent_suffix of this HttpClientConnectionAttributes.  # noqa: E501
        :type: str
        """

        self._user_agent_suffix = user_agent_suffix

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

        Seconds to wait for activity before stopping and retrying the connection  # noqa: E501

        :return: The timeout of this HttpClientConnectionAttributes.  # noqa: E501
        :rtype: int
        """
        return self._timeout

    @timeout.setter
    def timeout(self, timeout):
        """Sets the timeout of this HttpClientConnectionAttributes.

        Seconds to wait for activity before stopping and retrying the connection  # noqa: E501

        :param timeout: The timeout of this HttpClientConnectionAttributes.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                timeout is not None and timeout > 3600):  # noqa: E501
            raise ValueError("Invalid value for `timeout`, must be a value less than or equal to `3600`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                timeout is not None and timeout < 1):  # noqa: E501
            raise ValueError("Invalid value for `timeout`, must be a value greater than or equal to `1`")  # noqa: E501

        self._timeout = timeout

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

        Whether to enable redirects to the same location (may be required by some servers)  # noqa: E501

        :return: The enable_circular_redirects of this HttpClientConnectionAttributes.  # noqa: E501
        :rtype: bool
        """
        return self._enable_circular_redirects

    @enable_circular_redirects.setter
    def enable_circular_redirects(self, enable_circular_redirects):
        """Sets the enable_circular_redirects of this HttpClientConnectionAttributes.

        Whether to enable redirects to the same location (may be required by some servers)  # noqa: E501

        :param enable_circular_redirects: The enable_circular_redirects of this HttpClientConnectionAttributes.  # noqa: E501
        :type: bool
        """

        self._enable_circular_redirects = enable_circular_redirects

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

        Whether to allow cookies to be stored and used  # noqa: E501

        :return: The enable_cookies of this HttpClientConnectionAttributes.  # noqa: E501
        :rtype: bool
        """
        return self._enable_cookies

    @enable_cookies.setter
    def enable_cookies(self, enable_cookies):
        """Sets the enable_cookies of this HttpClientConnectionAttributes.

        Whether to allow cookies to be stored and used  # noqa: E501

        :param enable_cookies: The enable_cookies of this HttpClientConnectionAttributes.  # noqa: E501
        :type: bool
        """

        self._enable_cookies = enable_cookies

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

        for attr, _ in six.iteritems(self.openapi_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

        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, HttpClientConnectionAttributes):
            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, HttpClientConnectionAttributes):
            return True

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