/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LdapConfigResponse {
    #[serde(rename = "admin_group_dn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub admin_group_dn: Option<Option<String>>,
    #[serde(rename = "bind_dn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bind_dn: Option<Option<String>>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "display_name_attribute")]
    pub display_name_attribute: String,
    #[serde(rename = "email_attribute")]
    pub email_attribute: String,
    #[serde(rename = "group_base_dn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub group_base_dn: Option<Option<String>>,
    #[serde(rename = "group_filter", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub group_filter: Option<Option<String>>,
    #[serde(rename = "groups_attribute")]
    pub groups_attribute: String,
    #[serde(rename = "has_bind_password")]
    pub has_bind_password: bool,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "is_enabled")]
    pub is_enabled: bool,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "priority")]
    pub priority: i32,
    #[serde(rename = "server_url")]
    pub server_url: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "use_starttls")]
    pub use_starttls: bool,
    #[serde(rename = "user_base_dn")]
    pub user_base_dn: String,
    #[serde(rename = "user_filter")]
    pub user_filter: String,
    #[serde(rename = "username_attribute")]
    pub username_attribute: String,
}

impl LdapConfigResponse {
    pub fn new(created_at: String, display_name_attribute: String, email_attribute: String, groups_attribute: String, has_bind_password: bool, id: uuid::Uuid, is_enabled: bool, name: String, priority: i32, server_url: String, updated_at: String, use_starttls: bool, user_base_dn: String, user_filter: String, username_attribute: String) -> LdapConfigResponse {
        LdapConfigResponse {
            admin_group_dn: None,
            bind_dn: None,
            created_at,
            display_name_attribute,
            email_attribute,
            group_base_dn: None,
            group_filter: None,
            groups_attribute,
            has_bind_password,
            id,
            is_enabled,
            name,
            priority,
            server_url,
            updated_at,
            use_starttls,
            user_base_dn,
            user_filter,
            username_attribute,
        }
    }
}

