proxmox_api/generated/cluster/jobs/
realm_sync.rs

1pub mod id;
2pub struct RealmSyncClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> RealmSyncClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}{}", parent_path, "/realm-sync"),
14        }
15    }
16}
17impl<T> RealmSyncClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "List configured realm-sync-jobs."]
22    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23        let path = self.path.to_string();
24        self.client.get(&path, &())
25    }
26}
27impl GetOutputItems {
28    pub fn new(enabled: bool, id: String, realm: String, schedule: String) -> Self {
29        Self {
30            enabled,
31            id,
32            realm,
33            schedule,
34            comment: Default::default(),
35            last_run: Default::default(),
36            next_run: Default::default(),
37            remove_vanished: Default::default(),
38            scope: Default::default(),
39            additional_properties: Default::default(),
40        }
41    }
42}
43#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
44pub struct GetOutputItems {
45    #[serde(skip_serializing_if = "Option::is_none", default)]
46    #[doc = "A comment for the job."]
47    pub comment: Option<String>,
48    #[serde(
49        serialize_with = "crate::types::serialize_bool",
50        deserialize_with = "crate::types::deserialize_bool"
51    )]
52    #[doc = "If the job is enabled or not."]
53    pub enabled: bool,
54    #[doc = "The ID of the entry."]
55    pub id: String,
56    #[serde(rename = "last-run")]
57    #[serde(
58        serialize_with = "crate::types::serialize_int_optional",
59        deserialize_with = "crate::types::deserialize_int_optional"
60    )]
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    #[doc = "Last execution time of the job in seconds since the beginning of the UNIX epoch"]
63    pub last_run: Option<u64>,
64    #[serde(rename = "next-run")]
65    #[serde(
66        serialize_with = "crate::types::serialize_int_optional",
67        deserialize_with = "crate::types::deserialize_int_optional"
68    )]
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    #[doc = "Next planned execution time of the job in seconds since the beginning of the UNIX epoch."]
71    pub next_run: Option<u64>,
72    #[doc = "Authentication domain ID"]
73    pub realm: String,
74    #[serde(rename = "remove-vanished")]
75    #[serde(skip_serializing_if = "Option::is_none", default)]
76    #[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)."]
77    pub remove_vanished: Option<String>,
78    #[doc = "The configured sync schedule."]
79    pub schedule: String,
80    #[serde(skip_serializing_if = "Option::is_none", default)]
81    #[doc = "Select what to sync."]
82    pub scope: Option<Scope>,
83    #[serde(
84        flatten,
85        default,
86        skip_serializing_if = "::std::collections::HashMap::is_empty"
87    )]
88    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
89}
90#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
91pub enum Scope {
92    #[serde(rename = "both")]
93    Both,
94    #[serde(rename = "groups")]
95    Groups,
96    #[serde(rename = "users")]
97    Users,
98}
99impl<T> RealmSyncClient<T>
100where
101    T: crate::client::Client,
102{
103    pub fn id(&self, id: &str) -> id::IdClient<T> {
104        id::IdClient::<T>::new(self.client.clone(), &self.path, id)
105    }
106}