# coding: utf-8

"""
    PortainerCE API

    Portainer API is an HTTP API served by Portainer. It is used by the Portainer UI and everything you can do with the UI can be done using the HTTP API. Examples are available at https://documentation.portainer.io/api/api-examples/ You can find out more about Portainer at [http://portainer.io](http://portainer.io) and get some support on [Slack](http://portainer.io/slack/).  # Authentication  Most of the API endpoints require to be authenticated as well as some level of authorization to be used. Portainer API uses JSON Web Token to manage authentication and thus requires you to provide a token in the **Authorization** header of each request with the **Bearer** authentication mechanism.  Example:  ``` Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsInJvbGUiOjEsImV4cCI6MTQ5OTM3NjE1NH0.NJ6vE8FY1WG6jsRQzfMqeatJ4vh2TWAeeYfDhP71YEE ```  # Security  Each API endpoint has an associated access policy, it is documented in the description of each endpoint.  Different access policies are available:  - Public access - Authenticated access - Restricted access - Administrator access  ### Public access  No authentication is required to access the endpoints with this access policy.  ### Authenticated access  Authentication is required to access the endpoints with this access policy.  ### Restricted access  Authentication is required to access the endpoints with this access policy. Extra-checks might be added to ensure access to the resource is granted. Returned data might also be filtered.  ### Administrator access  Authentication as well as an administrator role are required to access the endpoints with this access policy.  # Execute Docker requests  Portainer **DOES NOT** expose specific endpoints to manage your Docker resources (create a container, remove a volume, etc...).  Instead, it acts as a reverse-proxy to the Docker HTTP API. This means that you can execute Docker requests **via** the Portainer HTTP API.  To do so, you can use the `/endpoints/{id}/docker` Portainer API endpoint (which is not documented below due to Swagger limitations). This endpoint has a restricted access policy so you still need to be authenticated to be able to query this endpoint. Any query on this endpoint will be proxied to the Docker API of the associated endpoint (requests and responses objects are the same as documented in the Docker API).  **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://documentation.portainer.io/api/api-examples/).   # noqa: E501

    OpenAPI spec version: 2.6.0
    Contact: info@portainer.io
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from portainer_ce_api.configuration import Configuration


class PortainerLDAPSettings(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 = {
        'anonymous_mode': 'bool',
        'auto_create_users': 'bool',
        'group_search_settings': 'list[PortainerLDAPGroupSearchSettings]',
        'password': 'str',
        'reader_dn': 'str',
        'search_settings': 'list[PortainerLDAPSearchSettings]',
        'start_tls': 'bool',
        'tls_config': 'PortainerTLSConfiguration',
        'url': 'str'
    }

    attribute_map = {
        'anonymous_mode': 'AnonymousMode',
        'auto_create_users': 'AutoCreateUsers',
        'group_search_settings': 'GroupSearchSettings',
        'password': 'Password',
        'reader_dn': 'ReaderDN',
        'search_settings': 'SearchSettings',
        'start_tls': 'StartTLS',
        'tls_config': 'TLSConfig',
        'url': 'URL'
    }

    def __init__(self, anonymous_mode=None, auto_create_users=None, group_search_settings=None, password=None, reader_dn=None, search_settings=None, start_tls=None, tls_config=None, url=None, _configuration=None):  # noqa: E501
        """PortainerLDAPSettings - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._anonymous_mode = None
        self._auto_create_users = None
        self._group_search_settings = None
        self._password = None
        self._reader_dn = None
        self._search_settings = None
        self._start_tls = None
        self._tls_config = None
        self._url = None
        self.discriminator = None

        if anonymous_mode is not None:
            self.anonymous_mode = anonymous_mode
        if auto_create_users is not None:
            self.auto_create_users = auto_create_users
        if group_search_settings is not None:
            self.group_search_settings = group_search_settings
        if password is not None:
            self.password = password
        if reader_dn is not None:
            self.reader_dn = reader_dn
        if search_settings is not None:
            self.search_settings = search_settings
        if start_tls is not None:
            self.start_tls = start_tls
        if tls_config is not None:
            self.tls_config = tls_config
        if url is not None:
            self.url = url

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

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :return: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._anonymous_mode

    @anonymous_mode.setter
    def anonymous_mode(self, anonymous_mode):
        """Sets the anonymous_mode of this PortainerLDAPSettings.

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :param anonymous_mode: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """

        self._anonymous_mode = anonymous_mode

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

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :return: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._auto_create_users

    @auto_create_users.setter
    def auto_create_users(self, auto_create_users):
        """Sets the auto_create_users of this PortainerLDAPSettings.

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :param auto_create_users: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """

        self._auto_create_users = auto_create_users

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


        :return: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPGroupSearchSettings]
        """
        return self._group_search_settings

    @group_search_settings.setter
    def group_search_settings(self, group_search_settings):
        """Sets the group_search_settings of this PortainerLDAPSettings.


        :param group_search_settings: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPGroupSearchSettings]
        """

        self._group_search_settings = group_search_settings

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

        Password of the account that will be used to search users  # noqa: E501

        :return: The password of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """Sets the password of this PortainerLDAPSettings.

        Password of the account that will be used to search users  # noqa: E501

        :param password: The password of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """

        self._password = password

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

        Account that will be used to search for users  # noqa: E501

        :return: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._reader_dn

    @reader_dn.setter
    def reader_dn(self, reader_dn):
        """Sets the reader_dn of this PortainerLDAPSettings.

        Account that will be used to search for users  # noqa: E501

        :param reader_dn: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """

        self._reader_dn = reader_dn

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


        :return: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPSearchSettings]
        """
        return self._search_settings

    @search_settings.setter
    def search_settings(self, search_settings):
        """Sets the search_settings of this PortainerLDAPSettings.


        :param search_settings: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPSearchSettings]
        """

        self._search_settings = search_settings

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

        Whether LDAP connection should use StartTLS  # noqa: E501

        :return: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._start_tls

    @start_tls.setter
    def start_tls(self, start_tls):
        """Sets the start_tls of this PortainerLDAPSettings.

        Whether LDAP connection should use StartTLS  # noqa: E501

        :param start_tls: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """

        self._start_tls = start_tls

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


        :return: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :rtype: PortainerTLSConfiguration
        """
        return self._tls_config

    @tls_config.setter
    def tls_config(self, tls_config):
        """Sets the tls_config of this PortainerLDAPSettings.


        :param tls_config: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :type: PortainerTLSConfiguration
        """

        self._tls_config = tls_config

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

        URL or IP address of the LDAP server  # noqa: E501

        :return: The url of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this PortainerLDAPSettings.

        URL or IP address of the LDAP server  # noqa: E501

        :param url: The url of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """

        self._url = url

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

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

fddd3ec6d537fd19b2d44146df8fd0ceae3e2717
<mask token>


class PortainerLDAPSettings(object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self, anonymous_mode=None, auto_create_users=None,
        group_search_settings=None, password=None, reader_dn=None,
        search_settings=None, start_tls=None, tls_config=None, url=None,
        _configuration=None):
        """PortainerLDAPSettings - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration
        self._anonymous_mode = None
        self._auto_create_users = None
        self._group_search_settings = None
        self._password = None
        self._reader_dn = None
        self._search_settings = None
        self._start_tls = None
        self._tls_config = None
        self._url = None
        self.discriminator = None
        if anonymous_mode is not None:
            self.anonymous_mode = anonymous_mode
        if auto_create_users is not None:
            self.auto_create_users = auto_create_users
        if group_search_settings is not None:
            self.group_search_settings = group_search_settings
        if password is not None:
            self.password = password
        if reader_dn is not None:
            self.reader_dn = reader_dn
        if search_settings is not None:
            self.search_settings = search_settings
        if start_tls is not None:
            self.start_tls = start_tls
        if tls_config is not None:
            self.tls_config = tls_config
        if url is not None:
            self.url = url

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

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :return: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._anonymous_mode
    <mask token>

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

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :return: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._auto_create_users
    <mask token>
    <mask token>

    @group_search_settings.setter
    def group_search_settings(self, group_search_settings):
        """Sets the group_search_settings of this PortainerLDAPSettings.


        :param group_search_settings: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPGroupSearchSettings]
        """
        self._group_search_settings = group_search_settings
    <mask token>
    <mask token>
    <mask token>

    @reader_dn.setter
    def reader_dn(self, reader_dn):
        """Sets the reader_dn of this PortainerLDAPSettings.

        Account that will be used to search for users  # noqa: E501

        :param reader_dn: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._reader_dn = reader_dn

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


        :return: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPSearchSettings]
        """
        return self._search_settings

    @search_settings.setter
    def search_settings(self, search_settings):
        """Sets the search_settings of this PortainerLDAPSettings.


        :param search_settings: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPSearchSettings]
        """
        self._search_settings = search_settings
    <mask token>
    <mask token>
    <mask token>

    @tls_config.setter
    def tls_config(self, tls_config):
        """Sets the tls_config of this PortainerLDAPSettings.


        :param tls_config: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :type: PortainerTLSConfiguration
        """
        self._tls_config = tls_config

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

        URL or IP address of the LDAP server  # noqa: E501

        :return: The url of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._url
    <mask token>

    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(PortainerLDAPSettings, dict):
            for key, value in self.items():
                result[key] = value
        return result
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


class PortainerLDAPSettings(object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self, anonymous_mode=None, auto_create_users=None,
        group_search_settings=None, password=None, reader_dn=None,
        search_settings=None, start_tls=None, tls_config=None, url=None,
        _configuration=None):
        """PortainerLDAPSettings - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration
        self._anonymous_mode = None
        self._auto_create_users = None
        self._group_search_settings = None
        self._password = None
        self._reader_dn = None
        self._search_settings = None
        self._start_tls = None
        self._tls_config = None
        self._url = None
        self.discriminator = None
        if anonymous_mode is not None:
            self.anonymous_mode = anonymous_mode
        if auto_create_users is not None:
            self.auto_create_users = auto_create_users
        if group_search_settings is not None:
            self.group_search_settings = group_search_settings
        if password is not None:
            self.password = password
        if reader_dn is not None:
            self.reader_dn = reader_dn
        if search_settings is not None:
            self.search_settings = search_settings
        if start_tls is not None:
            self.start_tls = start_tls
        if tls_config is not None:
            self.tls_config = tls_config
        if url is not None:
            self.url = url

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

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :return: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._anonymous_mode

    @anonymous_mode.setter
    def anonymous_mode(self, anonymous_mode):
        """Sets the anonymous_mode of this PortainerLDAPSettings.

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :param anonymous_mode: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """
        self._anonymous_mode = anonymous_mode

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

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :return: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._auto_create_users
    <mask token>
    <mask token>

    @group_search_settings.setter
    def group_search_settings(self, group_search_settings):
        """Sets the group_search_settings of this PortainerLDAPSettings.


        :param group_search_settings: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPGroupSearchSettings]
        """
        self._group_search_settings = group_search_settings

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

        Password of the account that will be used to search users  # noqa: E501

        :return: The password of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._password
    <mask token>
    <mask token>

    @reader_dn.setter
    def reader_dn(self, reader_dn):
        """Sets the reader_dn of this PortainerLDAPSettings.

        Account that will be used to search for users  # noqa: E501

        :param reader_dn: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._reader_dn = reader_dn

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


        :return: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPSearchSettings]
        """
        return self._search_settings

    @search_settings.setter
    def search_settings(self, search_settings):
        """Sets the search_settings of this PortainerLDAPSettings.


        :param search_settings: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPSearchSettings]
        """
        self._search_settings = search_settings
    <mask token>
    <mask token>

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


        :return: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :rtype: PortainerTLSConfiguration
        """
        return self._tls_config

    @tls_config.setter
    def tls_config(self, tls_config):
        """Sets the tls_config of this PortainerLDAPSettings.


        :param tls_config: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :type: PortainerTLSConfiguration
        """
        self._tls_config = tls_config

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

        URL or IP address of the LDAP server  # noqa: E501

        :return: The url of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._url
    <mask token>

    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(PortainerLDAPSettings, dict):
            for key, value in self.items():
                result[key] = value
        return result
    <mask token>

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()
    <mask token>
    <mask token>

<mask token>


class PortainerLDAPSettings(object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self, anonymous_mode=None, auto_create_users=None,
        group_search_settings=None, password=None, reader_dn=None,
        search_settings=None, start_tls=None, tls_config=None, url=None,
        _configuration=None):
        """PortainerLDAPSettings - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration
        self._anonymous_mode = None
        self._auto_create_users = None
        self._group_search_settings = None
        self._password = None
        self._reader_dn = None
        self._search_settings = None
        self._start_tls = None
        self._tls_config = None
        self._url = None
        self.discriminator = None
        if anonymous_mode is not None:
            self.anonymous_mode = anonymous_mode
        if auto_create_users is not None:
            self.auto_create_users = auto_create_users
        if group_search_settings is not None:
            self.group_search_settings = group_search_settings
        if password is not None:
            self.password = password
        if reader_dn is not None:
            self.reader_dn = reader_dn
        if search_settings is not None:
            self.search_settings = search_settings
        if start_tls is not None:
            self.start_tls = start_tls
        if tls_config is not None:
            self.tls_config = tls_config
        if url is not None:
            self.url = url

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

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :return: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._anonymous_mode

    @anonymous_mode.setter
    def anonymous_mode(self, anonymous_mode):
        """Sets the anonymous_mode of this PortainerLDAPSettings.

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :param anonymous_mode: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """
        self._anonymous_mode = anonymous_mode

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

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :return: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._auto_create_users
    <mask token>
    <mask token>

    @group_search_settings.setter
    def group_search_settings(self, group_search_settings):
        """Sets the group_search_settings of this PortainerLDAPSettings.


        :param group_search_settings: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPGroupSearchSettings]
        """
        self._group_search_settings = group_search_settings

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

        Password of the account that will be used to search users  # noqa: E501

        :return: The password of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """Sets the password of this PortainerLDAPSettings.

        Password of the account that will be used to search users  # noqa: E501

        :param password: The password of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._password = password

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

        Account that will be used to search for users  # noqa: E501

        :return: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._reader_dn

    @reader_dn.setter
    def reader_dn(self, reader_dn):
        """Sets the reader_dn of this PortainerLDAPSettings.

        Account that will be used to search for users  # noqa: E501

        :param reader_dn: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._reader_dn = reader_dn

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


        :return: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPSearchSettings]
        """
        return self._search_settings

    @search_settings.setter
    def search_settings(self, search_settings):
        """Sets the search_settings of this PortainerLDAPSettings.


        :param search_settings: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPSearchSettings]
        """
        self._search_settings = search_settings

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

        Whether LDAP connection should use StartTLS  # noqa: E501

        :return: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._start_tls

    @start_tls.setter
    def start_tls(self, start_tls):
        """Sets the start_tls of this PortainerLDAPSettings.

        Whether LDAP connection should use StartTLS  # noqa: E501

        :param start_tls: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """
        self._start_tls = start_tls

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


        :return: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :rtype: PortainerTLSConfiguration
        """
        return self._tls_config

    @tls_config.setter
    def tls_config(self, tls_config):
        """Sets the tls_config of this PortainerLDAPSettings.


        :param tls_config: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :type: PortainerTLSConfiguration
        """
        self._tls_config = tls_config

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

        URL or IP address of the LDAP server  # noqa: E501

        :return: The url of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this PortainerLDAPSettings.

        URL or IP address of the LDAP server  # noqa: E501

        :param url: The url of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._url = url

    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(PortainerLDAPSettings, dict):
            for key, value in self.items():
                result[key] = value
        return result
    <mask token>

    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, PortainerLDAPSettings):
            return False
        return self.to_dict() == other.to_dict()
    <mask token>

<mask token>


class PortainerLDAPSettings(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 = {'anonymous_mode': 'bool', 'auto_create_users': 'bool',
        'group_search_settings': 'list[PortainerLDAPGroupSearchSettings]',
        'password': 'str', 'reader_dn': 'str', 'search_settings':
        'list[PortainerLDAPSearchSettings]', 'start_tls': 'bool',
        'tls_config': 'PortainerTLSConfiguration', 'url': 'str'}
    attribute_map = {'anonymous_mode': 'AnonymousMode', 'auto_create_users':
        'AutoCreateUsers', 'group_search_settings': 'GroupSearchSettings',
        'password': 'Password', 'reader_dn': 'ReaderDN', 'search_settings':
        'SearchSettings', 'start_tls': 'StartTLS', 'tls_config':
        'TLSConfig', 'url': 'URL'}

    def __init__(self, anonymous_mode=None, auto_create_users=None,
        group_search_settings=None, password=None, reader_dn=None,
        search_settings=None, start_tls=None, tls_config=None, url=None,
        _configuration=None):
        """PortainerLDAPSettings - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration
        self._anonymous_mode = None
        self._auto_create_users = None
        self._group_search_settings = None
        self._password = None
        self._reader_dn = None
        self._search_settings = None
        self._start_tls = None
        self._tls_config = None
        self._url = None
        self.discriminator = None
        if anonymous_mode is not None:
            self.anonymous_mode = anonymous_mode
        if auto_create_users is not None:
            self.auto_create_users = auto_create_users
        if group_search_settings is not None:
            self.group_search_settings = group_search_settings
        if password is not None:
            self.password = password
        if reader_dn is not None:
            self.reader_dn = reader_dn
        if search_settings is not None:
            self.search_settings = search_settings
        if start_tls is not None:
            self.start_tls = start_tls
        if tls_config is not None:
            self.tls_config = tls_config
        if url is not None:
            self.url = url

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

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :return: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._anonymous_mode

    @anonymous_mode.setter
    def anonymous_mode(self, anonymous_mode):
        """Sets the anonymous_mode of this PortainerLDAPSettings.

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :param anonymous_mode: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """
        self._anonymous_mode = anonymous_mode

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

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :return: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._auto_create_users

    @auto_create_users.setter
    def auto_create_users(self, auto_create_users):
        """Sets the auto_create_users of this PortainerLDAPSettings.

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :param auto_create_users: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """
        self._auto_create_users = auto_create_users

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


        :return: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPGroupSearchSettings]
        """
        return self._group_search_settings

    @group_search_settings.setter
    def group_search_settings(self, group_search_settings):
        """Sets the group_search_settings of this PortainerLDAPSettings.


        :param group_search_settings: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPGroupSearchSettings]
        """
        self._group_search_settings = group_search_settings

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

        Password of the account that will be used to search users  # noqa: E501

        :return: The password of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """Sets the password of this PortainerLDAPSettings.

        Password of the account that will be used to search users  # noqa: E501

        :param password: The password of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._password = password

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

        Account that will be used to search for users  # noqa: E501

        :return: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._reader_dn

    @reader_dn.setter
    def reader_dn(self, reader_dn):
        """Sets the reader_dn of this PortainerLDAPSettings.

        Account that will be used to search for users  # noqa: E501

        :param reader_dn: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._reader_dn = reader_dn

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


        :return: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPSearchSettings]
        """
        return self._search_settings

    @search_settings.setter
    def search_settings(self, search_settings):
        """Sets the search_settings of this PortainerLDAPSettings.


        :param search_settings: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPSearchSettings]
        """
        self._search_settings = search_settings

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

        Whether LDAP connection should use StartTLS  # noqa: E501

        :return: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._start_tls

    @start_tls.setter
    def start_tls(self, start_tls):
        """Sets the start_tls of this PortainerLDAPSettings.

        Whether LDAP connection should use StartTLS  # noqa: E501

        :param start_tls: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """
        self._start_tls = start_tls

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


        :return: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :rtype: PortainerTLSConfiguration
        """
        return self._tls_config

    @tls_config.setter
    def tls_config(self, tls_config):
        """Sets the tls_config of this PortainerLDAPSettings.


        :param tls_config: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :type: PortainerTLSConfiguration
        """
        self._tls_config = tls_config

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

        URL or IP address of the LDAP server  # noqa: E501

        :return: The url of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this PortainerLDAPSettings.

        URL or IP address of the LDAP server  # noqa: E501

        :param url: The url of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """
        self._url = url

    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(PortainerLDAPSettings, 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, PortainerLDAPSettings):
            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, PortainerLDAPSettings):
            return True
        return self.to_dict() != other.to_dict()

# coding: utf-8

"""
    PortainerCE API

    Portainer API is an HTTP API served by Portainer. It is used by the Portainer UI and everything you can do with the UI can be done using the HTTP API. Examples are available at https://documentation.portainer.io/api/api-examples/ You can find out more about Portainer at [http://portainer.io](http://portainer.io) and get some support on [Slack](http://portainer.io/slack/).  # Authentication  Most of the API endpoints require to be authenticated as well as some level of authorization to be used. Portainer API uses JSON Web Token to manage authentication and thus requires you to provide a token in the **Authorization** header of each request with the **Bearer** authentication mechanism.  Example:  ``` Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsInJvbGUiOjEsImV4cCI6MTQ5OTM3NjE1NH0.NJ6vE8FY1WG6jsRQzfMqeatJ4vh2TWAeeYfDhP71YEE ```  # Security  Each API endpoint has an associated access policy, it is documented in the description of each endpoint.  Different access policies are available:  - Public access - Authenticated access - Restricted access - Administrator access  ### Public access  No authentication is required to access the endpoints with this access policy.  ### Authenticated access  Authentication is required to access the endpoints with this access policy.  ### Restricted access  Authentication is required to access the endpoints with this access policy. Extra-checks might be added to ensure access to the resource is granted. Returned data might also be filtered.  ### Administrator access  Authentication as well as an administrator role are required to access the endpoints with this access policy.  # Execute Docker requests  Portainer **DOES NOT** expose specific endpoints to manage your Docker resources (create a container, remove a volume, etc...).  Instead, it acts as a reverse-proxy to the Docker HTTP API. This means that you can execute Docker requests **via** the Portainer HTTP API.  To do so, you can use the `/endpoints/{id}/docker` Portainer API endpoint (which is not documented below due to Swagger limitations). This endpoint has a restricted access policy so you still need to be authenticated to be able to query this endpoint. Any query on this endpoint will be proxied to the Docker API of the associated endpoint (requests and responses objects are the same as documented in the Docker API).  **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://documentation.portainer.io/api/api-examples/).   # noqa: E501

    OpenAPI spec version: 2.6.0
    Contact: info@portainer.io
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from portainer_ce_api.configuration import Configuration


class PortainerLDAPSettings(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 = {
        'anonymous_mode': 'bool',
        'auto_create_users': 'bool',
        'group_search_settings': 'list[PortainerLDAPGroupSearchSettings]',
        'password': 'str',
        'reader_dn': 'str',
        'search_settings': 'list[PortainerLDAPSearchSettings]',
        'start_tls': 'bool',
        'tls_config': 'PortainerTLSConfiguration',
        'url': 'str'
    }

    attribute_map = {
        'anonymous_mode': 'AnonymousMode',
        'auto_create_users': 'AutoCreateUsers',
        'group_search_settings': 'GroupSearchSettings',
        'password': 'Password',
        'reader_dn': 'ReaderDN',
        'search_settings': 'SearchSettings',
        'start_tls': 'StartTLS',
        'tls_config': 'TLSConfig',
        'url': 'URL'
    }

    def __init__(self, anonymous_mode=None, auto_create_users=None, group_search_settings=None, password=None, reader_dn=None, search_settings=None, start_tls=None, tls_config=None, url=None, _configuration=None):  # noqa: E501
        """PortainerLDAPSettings - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._anonymous_mode = None
        self._auto_create_users = None
        self._group_search_settings = None
        self._password = None
        self._reader_dn = None
        self._search_settings = None
        self._start_tls = None
        self._tls_config = None
        self._url = None
        self.discriminator = None

        if anonymous_mode is not None:
            self.anonymous_mode = anonymous_mode
        if auto_create_users is not None:
            self.auto_create_users = auto_create_users
        if group_search_settings is not None:
            self.group_search_settings = group_search_settings
        if password is not None:
            self.password = password
        if reader_dn is not None:
            self.reader_dn = reader_dn
        if search_settings is not None:
            self.search_settings = search_settings
        if start_tls is not None:
            self.start_tls = start_tls
        if tls_config is not None:
            self.tls_config = tls_config
        if url is not None:
            self.url = url

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

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :return: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._anonymous_mode

    @anonymous_mode.setter
    def anonymous_mode(self, anonymous_mode):
        """Sets the anonymous_mode of this PortainerLDAPSettings.

        Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used  # noqa: E501

        :param anonymous_mode: The anonymous_mode of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """

        self._anonymous_mode = anonymous_mode

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

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :return: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._auto_create_users

    @auto_create_users.setter
    def auto_create_users(self, auto_create_users):
        """Sets the auto_create_users of this PortainerLDAPSettings.

        Automatically provision users and assign them to matching LDAP group names  # noqa: E501

        :param auto_create_users: The auto_create_users of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """

        self._auto_create_users = auto_create_users

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


        :return: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPGroupSearchSettings]
        """
        return self._group_search_settings

    @group_search_settings.setter
    def group_search_settings(self, group_search_settings):
        """Sets the group_search_settings of this PortainerLDAPSettings.


        :param group_search_settings: The group_search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPGroupSearchSettings]
        """

        self._group_search_settings = group_search_settings

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

        Password of the account that will be used to search users  # noqa: E501

        :return: The password of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """Sets the password of this PortainerLDAPSettings.

        Password of the account that will be used to search users  # noqa: E501

        :param password: The password of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """

        self._password = password

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

        Account that will be used to search for users  # noqa: E501

        :return: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._reader_dn

    @reader_dn.setter
    def reader_dn(self, reader_dn):
        """Sets the reader_dn of this PortainerLDAPSettings.

        Account that will be used to search for users  # noqa: E501

        :param reader_dn: The reader_dn of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """

        self._reader_dn = reader_dn

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


        :return: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :rtype: list[PortainerLDAPSearchSettings]
        """
        return self._search_settings

    @search_settings.setter
    def search_settings(self, search_settings):
        """Sets the search_settings of this PortainerLDAPSettings.


        :param search_settings: The search_settings of this PortainerLDAPSettings.  # noqa: E501
        :type: list[PortainerLDAPSearchSettings]
        """

        self._search_settings = search_settings

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

        Whether LDAP connection should use StartTLS  # noqa: E501

        :return: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :rtype: bool
        """
        return self._start_tls

    @start_tls.setter
    def start_tls(self, start_tls):
        """Sets the start_tls of this PortainerLDAPSettings.

        Whether LDAP connection should use StartTLS  # noqa: E501

        :param start_tls: The start_tls of this PortainerLDAPSettings.  # noqa: E501
        :type: bool
        """

        self._start_tls = start_tls

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


        :return: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :rtype: PortainerTLSConfiguration
        """
        return self._tls_config

    @tls_config.setter
    def tls_config(self, tls_config):
        """Sets the tls_config of this PortainerLDAPSettings.


        :param tls_config: The tls_config of this PortainerLDAPSettings.  # noqa: E501
        :type: PortainerTLSConfiguration
        """

        self._tls_config = tls_config

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

        URL or IP address of the LDAP server  # noqa: E501

        :return: The url of this PortainerLDAPSettings.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this PortainerLDAPSettings.

        URL or IP address of the LDAP server  # noqa: E501

        :param url: The url of this PortainerLDAPSettings.  # noqa: E501
        :type: str
        """

        self._url = url

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

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