pve/cluster/
backup_info.rs

1pub mod not_backed_up;
2
3#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
4pub struct GetResponseItem {
5    #[doc = "API sub-directory endpoint"]
6    pub subdir: String,
7}
8
9#[derive(Debug, Clone)]
10pub struct BackupInfoClient<T> {
11    client: T,
12    path: String,
13}
14
15impl<T> BackupInfoClient<T>
16where
17    T: Clone,
18{
19    pub fn new(client: T, parent_path: &str) -> Self {
20        Self {
21            client,
22            path: format!("{}/{}", parent_path, "backup-info"),
23        }
24    }
25
26    pub fn not_backed_up(&self) -> not_backed_up::NotBackedUpClient<T> {
27        not_backed_up::NotBackedUpClient::<T>::new(self.client.clone(), &self.path)
28    }
29}
30impl<T> BackupInfoClient<T>
31where
32    T: crate::client::HttpClient,
33{
34    #[doc = "Index for backup info related endpoints"]
35    pub fn get(&self) -> Result<Vec<GetResponseItem>, T::Error> {
36        self.client.get(&self.path, &())
37    }
38}
39#[derive(Debug, Clone)]
40pub struct AsyncBackupInfoClient<T> {
41    client: T,
42    path: String,
43}
44
45impl<T> AsyncBackupInfoClient<T>
46where
47    T: Clone,
48{
49    pub fn new(client: T, parent_path: &str) -> Self {
50        Self {
51            client,
52            path: format!("{}/{}", parent_path, "backup-info"),
53        }
54    }
55
56    pub fn not_backed_up(&self) -> not_backed_up::AsyncNotBackedUpClient<T> {
57        not_backed_up::AsyncNotBackedUpClient::<T>::new(self.client.clone(), &self.path)
58    }
59}
60impl<T> AsyncBackupInfoClient<T>
61where
62    T: crate::client::AsyncHttpClient,
63{
64    #[doc = "Index for backup info related endpoints"]
65    pub async fn get(&self) -> Result<Vec<GetResponseItem>, T::Error> {
66        self.client.get(&self.path, &()).await
67    }
68}