proxmox_api/generated/access/domains/realm/
sync.rs

1pub struct SyncClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> SyncClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/sync"),
13        }
14    }
15}
16impl<T> SyncClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Syncs users and/or groups from the configured LDAP to user.cfg. NOTE: Synced groups will have the name 'name-$realm', so make sure those groups do not exist to prevent overwriting."]
21    pub fn post(&self, params: PostParams) -> Result<String, T::Error> {
22        let path = self.path.to_string();
23        self.client.post(&path, &params)
24    }
25}
26#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
27pub struct PostParams {
28    #[serde(rename = "dry-run")]
29    #[serde(
30        serialize_with = "crate::types::serialize_bool_optional",
31        deserialize_with = "crate::types::deserialize_bool_optional"
32    )]
33    #[serde(skip_serializing_if = "Option::is_none", default)]
34    #[doc = "If set, does not write anything."]
35    pub dry_run: Option<bool>,
36    #[serde(rename = "enable-new")]
37    #[serde(skip_serializing_if = "Option::is_none", default)]
38    #[doc = "Enable newly synced users immediately."]
39    pub enable_new: Option<()>,
40    #[serde(
41        serialize_with = "crate::types::serialize_bool_optional",
42        deserialize_with = "crate::types::deserialize_bool_optional"
43    )]
44    #[serde(skip_serializing_if = "Option::is_none", default)]
45    #[doc = "DEPRECATED: use 'remove-vanished' instead. If set, uses the LDAP Directory as source of truth, deleting users or groups not returned from the sync and removing all locally modified properties of synced users. If not set, only syncs information which is present in the synced data, and does not delete or modify anything else."]
46    pub full: Option<bool>,
47    #[serde(
48        serialize_with = "crate::types::serialize_bool_optional",
49        deserialize_with = "crate::types::deserialize_bool_optional"
50    )]
51    #[serde(skip_serializing_if = "Option::is_none", default)]
52    #[doc = "DEPRECATED: use 'remove-vanished' instead. Remove ACLs for users or groups which were removed from the config during a sync."]
53    pub purge: Option<bool>,
54    #[serde(rename = "remove-vanished")]
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    #[doc = "A semicolon-seperated list of things to remove when they or the user vanishes during a sync. The following values are possible: 'entry' removes the user/group when not returned from the sync. 'properties' removes the set properties on existing user/group that do not appear in the source (even custom ones). 'acl' removes acls when the user/group is not returned from the sync. Instead of a list it also can be 'none' (the default)."]
57    pub remove_vanished: Option<String>,
58    #[serde(skip_serializing_if = "Option::is_none", default)]
59    #[doc = "Select what to sync."]
60    pub scope: Option<Scope>,
61    #[serde(
62        flatten,
63        default,
64        skip_serializing_if = "::std::collections::HashMap::is_empty"
65    )]
66    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
67}
68#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
69pub enum Scope {
70    #[serde(rename = "both")]
71    Both,
72    #[serde(rename = "groups")]
73    Groups,
74    #[serde(rename = "users")]
75    Users,
76}