Skip to main content

proxmox_api/generated/nodes/node/replication/
id.rs

1pub mod log;
2pub mod schedule_now;
3pub mod status;
4#[derive(Debug, Clone)]
5pub struct IdClient<T> {
6    client: T,
7    path: String,
8}
9impl<T> IdClient<T>
10where
11    T: crate::client::Client,
12{
13    pub fn new(client: T, parent_path: &str, id: &str) -> Self {
14        Self {
15            client,
16            path: format!("{}/{}", parent_path, id),
17        }
18    }
19}
20impl<T> IdClient<T>
21where
22    T: crate::client::Client,
23{
24    #[doc = "Directory index."]
25    #[doc = ""]
26    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
27        let path = self.path.to_string();
28        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
29        Ok(optional_vec.unwrap_or_default())
30    }
31}
32#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
33pub struct GetOutputItems {
34    #[serde(
35        flatten,
36        default,
37        skip_serializing_if = "::std::collections::HashMap::is_empty"
38    )]
39    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
40}
41impl<T> IdClient<T>
42where
43    T: crate::client::Client,
44{
45    pub fn status(&self) -> status::StatusClient<T> {
46        status::StatusClient::<T>::new(self.client.clone(), &self.path)
47    }
48}
49impl<T> IdClient<T>
50where
51    T: crate::client::Client,
52{
53    pub fn log(&self) -> log::LogClient<T> {
54        log::LogClient::<T>::new(self.client.clone(), &self.path)
55    }
56}
57impl<T> IdClient<T>
58where
59    T: crate::client::Client,
60{
61    pub fn schedule_now(&self) -> schedule_now::ScheduleNowClient<T> {
62        schedule_now::ScheduleNowClient::<T>::new(self.client.clone(), &self.path)
63    }
64}