Skip to main content

proxmox_api/generated/cluster/
tasks.rs

1#[derive(Debug, Clone)]
2pub struct TasksClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> TasksClient<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, "/tasks"),
14        }
15    }
16}
17impl<T> TasksClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "List recent tasks (cluster wide)."]
22    #[doc = ""]
23    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
24        let path = self.path.to_string();
25        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
26        Ok(optional_vec.unwrap_or_default())
27    }
28}
29impl GetOutputItems {
30    pub fn new(upid: String) -> Self {
31        Self {
32            upid,
33            additional_properties: ::std::default::Default::default(),
34        }
35    }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
38pub struct GetOutputItems {
39    pub upid: String,
40    #[serde(
41        flatten,
42        default,
43        skip_serializing_if = "::std::collections::HashMap::is_empty"
44    )]
45    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
46}