def _set(self, opts):
    if (opts.authentication_enabled == '1'):
        opts.authentication_enabled = 'true'
    elif (opts.authentication_enabled == '0'):
        opts.authentication_enabled = 'false'
    if (opts.authorization_enabled == '1'):
        opts.authorization_enabled = 'true'
    elif (opts.authorization_enabled == '0'):
        opts.authorization_enabled = 'false'
    if (opts.server_cert_val == '1'):
        opts.server_cert_val = 'true'
    elif (opts.server_cert_val == '0'):
        opts.server_cert_val = 'false'
    if ((opts.server_cert_val == 'false') and (opts.cacert_ldap is not None)):
        _exit_if_errors(['--server-cert-validation 0 and --ldap-cert can not be used together'])
    if (opts.cacert_ldap is not None):
        opts.cacert_ldap = _exit_on_file_read_failure(opts.cacert_ldap)
    if (opts.encryption == 'tls'):
        opts.encryption = 'TLS'
    elif (opts.encryption == 'startTLS'):
        opts.encryption = 'StartTLSExtension'
    elif (opts.encryption == 'none'):
        opts.encryption = 'None'
    if (opts.nested_groups == '1'):
        opts.nested_groups = 'true'
    elif (opts.nested_groups == '0'):
        opts.nested_groups = 'false'
    if ((opts.user_dn_query is not None) and (opts.user_dn_template is not None)):
        _exit_if_errors(['--user-dn-query and --user-dn-template can not be used together'])
    mapping = None
    if (opts.user_dn_query is not None):
        mapping = f'{{"query": "{opts.user_dn_query}"}}'
    if (opts.user_dn_template is not None):
        mapping = f'{{"template": "{opts.user_dn_template}"}}'
    if ((opts.client_cert and (not opts.client_key)) or ((not opts.client_cert) and opts.client_key)):
        _exit_if_errors(['--client-cert and --client--key have to be used together'])
    if (opts.client_cert is not None):
        opts.client_cert = _exit_on_file_read_failure(opts.client_cert)
    if (opts.client_key is not None):
        opts.client_key = _exit_on_file_read_failure(opts.client_key)
    (_, errors) = self.rest.ldap_settings(opts.authentication_enabled, opts.authorization_enabled, opts.hosts, opts.port, opts.encryption, mapping, opts.timeout, opts.max_parallel, opts.max_cache_size, opts.cache_value_lifetime, opts.bind_dn, opts.bind_password, opts.client_cert, opts.client_key, opts.group_query, opts.nested_groups, opts.nested_max_depth, opts.server_cert_val, opts.cacert_ldap)
    _exit_if_errors(errors)
    _success('LDAP settings modified')
def _set(self, opts):
    if (opts.authentication_enabled == '1'):
        opts.authentication_enabled = 'true'
    elif (opts.authentication_enabled == '0'):
        opts.authentication_enabled = 'false'
    if (opts.authorization_enabled == '1'):
        opts.authorization_enabled = 'true'
    elif (opts.authorization_enabled == '0'):
        opts.authorization_enabled = 'false'
    if (opts.server_cert_val == '1'):
        opts.server_cert_val = 'true'
    elif (opts.server_cert_val == '0'):
        opts.server_cert_val = 'false'
    if ((opts.server_cert_val == 'false') and (opts.cacert_ldap is not None)):
        _exit_if_errors(['--server-cert-validation 0 and --ldap-cert can not be used together'])
    if (opts.cacert_ldap is not None):
        opts.cacert_ldap = _exit_on_file_read_failure(opts.cacert_ldap)
    if (opts.encryption == 'tls'):
        opts.encryption = 'TLS'
    elif (opts.encryption == 'startTLS'):
        opts.encryption = 'StartTLSExtension'
    elif (opts.encryption == 'none'):
        opts.encryption = 'None'
    if (opts.nested_groups == '1'):
        opts.nested_groups = 'true'
    elif (opts.nested_groups == '0'):
        opts.nested_groups = 'false'
    if ((opts.user_dn_query is not None) and (opts.user_dn_template is not None)):
        _exit_if_errors(['--user-dn-query and --user-dn-template can not be used together'])
    mapping = None
    if (opts.user_dn_query is not None):
        mapping = f'{{"query": "{opts.user_dn_query}"}}'
    if (opts.user_dn_template is not None):
        mapping = f'{{"template": "{opts.user_dn_template}"}}'
    if ((opts.client_cert and (not opts.client_key)) or ((not opts.client_cert) and opts.client_key)):
        _exit_if_errors(['--client-cert and --client--key have to be used together'])
    if (opts.client_cert is not None):
        opts.client_cert = _exit_on_file_read_failure(opts.client_cert)
    if (opts.client_key is not None):
        opts.client_key = _exit_on_file_read_failure(opts.client_key)
    (_, errors) = self.rest.ldap_settings(opts.authentication_enabled, opts.authorization_enabled, opts.hosts, opts.port, opts.encryption, mapping, opts.timeout, opts.max_parallel, opts.max_cache_size, opts.cache_value_lifetime, opts.bind_dn, opts.bind_password, opts.client_cert, opts.client_key, opts.group_query, opts.nested_groups, opts.nested_max_depth, opts.server_cert_val, opts.cacert_ldap)
    _exit_if_errors(errors)
    _success('LDAP settings modified')