Skip to main content

proxmox_api/generated/cluster/firewall/
macros.rs

1#[derive(Debug, Clone)]
2pub struct MacrosClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> MacrosClient<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, "/macros"),
14        }
15    }
16}
17impl<T> MacrosClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "List available macros"]
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(descr: String, macro_def: String) -> Self {
31        Self {
32            descr,
33            macro_def,
34            additional_properties: ::std::default::Default::default(),
35        }
36    }
37}
38#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
39pub struct GetOutputItems {
40    #[doc = "More verbose description (if available)."]
41    #[doc = ""]
42    pub descr: String,
43    #[serde(rename = "macro")]
44    #[doc = "Macro name."]
45    #[doc = ""]
46    pub macro_def: String,
47    #[serde(
48        flatten,
49        default,
50        skip_serializing_if = "::std::collections::HashMap::is_empty"
51    )]
52    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
53}