clientapi-pve 2026.5.24

Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
Documentation
/*
 * Proxmox Virtual Environment API
 *
 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
 *
 * The version of the OpenAPI document: 9.x
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PveRealmLdapConfig {

    /// Server IP address (or DNS name)
    #[serde(rename = "server1")]
    pub server1: String,

    /// Fallback Server IP address (or DNS name)
    #[serde(rename = "server2", skip_serializing_if = "Option::is_none")]
    pub server2: Option<String>,

    /// LDAP base domain name
    #[serde(rename = "base_dn")]
    pub base_dn: String,

    /// LDAP bind domain name
    #[serde(rename = "bind_dn", skip_serializing_if = "Option::is_none")]
    pub bind_dn: Option<String>,

    /// LDAP bind password. Will be stored in '/etc/pve/priv/realm/<REALM>.pw'.
    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,

    /// LDAP user attribute name
    #[serde(rename = "user_attr")]
    pub user_attr: String,

    /// Server port.
    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
    pub port: Option<i32>,

    /// Use secure LDAPS protocol. DEPRECATED: use 'mode' instead.
    #[serde(rename = "secure", skip_serializing_if = "Option::is_none")]
    pub secure: Option<models::PveBoolean>,

    /// LDAPS TLS/SSL version. It's not recommended to use version older than 1.2!
    #[serde(rename = "sslversion", skip_serializing_if = "Option::is_none")]
    pub sslversion: Option<models::PveSslversionEnum>,

    /// Use this as default realm
    #[serde(rename = "default", skip_serializing_if = "Option::is_none")]
    pub default: Option<models::PveBoolean>,

    /// Description.
    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
    pub comment: Option<String>,

    /// Use Two-factor authentication.
    #[serde(rename = "tfa", skip_serializing_if = "Option::is_none")]
    pub tfa: Option<String>,

    /// Verify the server's SSL certificate
    #[serde(rename = "verify", skip_serializing_if = "Option::is_none")]
    pub verify: Option<models::PveBoolean>,

    /// Path to the CA certificate store
    #[serde(rename = "capath", skip_serializing_if = "Option::is_none")]
    pub capath: Option<String>,

    /// Path to the client certificate
    #[serde(rename = "cert", skip_serializing_if = "Option::is_none")]
    pub cert: Option<String>,

    /// Path to the client certificate key
    #[serde(rename = "certkey", skip_serializing_if = "Option::is_none")]
    pub certkey: Option<String>,

    /// LDAP filter for user sync.
    #[serde(rename = "filter", skip_serializing_if = "Option::is_none")]
    pub filter: Option<String>,

    /// Comma separated list of key=value pairs for specifying which LDAP attributes map to which PVE user field. For example, to map the LDAP attribute 'mail' to PVEs 'email', write  'email=mail'. By default, each PVE user field is represented  by an LDAP attribute of the same name.
    #[serde(rename = "sync_attributes", skip_serializing_if = "Option::is_none")]
    pub sync_attributes: Option<String>,

    /// The objectclasses for users.
    #[serde(rename = "user_classes", skip_serializing_if = "Option::is_none")]
    pub user_classes: Option<String>,

    /// LDAP base domain name for group sync. If not set, the base_dn will be used.
    #[serde(rename = "group_dn", skip_serializing_if = "Option::is_none")]
    pub group_dn: Option<String>,

    /// LDAP attribute representing a groups name. If not set or found, the first value of the DN will be used as name.
    #[serde(rename = "group_name_attr", skip_serializing_if = "Option::is_none")]
    pub group_name_attr: Option<String>,

    /// LDAP filter for group sync.
    #[serde(rename = "group_filter", skip_serializing_if = "Option::is_none")]
    pub group_filter: Option<String>,

    /// The objectclasses for groups.
    #[serde(rename = "group_classes", skip_serializing_if = "Option::is_none")]
    pub group_classes: Option<String>,

    /// The default options for behavior of synchronizations.
    #[serde(rename = "sync-defaults-options", skip_serializing_if = "Option::is_none")]
    pub sync_defaults_options: Option<String>,

    /// LDAP protocol mode.
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<models::PveModeEnum>,

    /// username is case-sensitive
    #[serde(rename = "case-sensitive", skip_serializing_if = "Option::is_none")]
    pub case_sensitive: Option<models::PveBoolean>,

    #[serde(rename = "type")]
    pub r#type: Type,


}

impl PveRealmLdapConfig {
    pub fn new(server1: String, base_dn: String, user_attr: String, r#type: Type) -> PveRealmLdapConfig {
        PveRealmLdapConfig {
            
            server1,
            
            server2: None,
            
            base_dn,
            
            bind_dn: None,
            
            password: None,
            
            user_attr,
            
            port: None,
            
            secure: None,
            
            sslversion: None,
            
            default: None,
            
            comment: None,
            
            tfa: None,
            
            verify: None,
            
            capath: None,
            
            cert: None,
            
            certkey: None,
            
            filter: None,
            
            sync_attributes: None,
            
            user_classes: None,
            
            group_dn: None,
            
            group_name_attr: None,
            
            group_filter: None,
            
            group_classes: None,
            
            sync_defaults_options: None,
            
            mode: None,
            
            case_sensitive: None,
            
            r#type,
            
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "ldap")]
    Ldap,
}

impl Default for Type {
    fn default() -> Type {
        Self::Ldap
    }
}