Skip to main content

proxmox_api/generated/nodes/node/lxc/vmid/
firewall.rs

1pub mod aliases;
2pub mod ipset;
3pub mod log;
4pub mod options;
5pub mod refs;
6pub mod rules;
7#[derive(Debug, Clone)]
8pub struct FirewallClient<T> {
9    client: T,
10    path: String,
11}
12impl<T> FirewallClient<T>
13where
14    T: crate::client::Client,
15{
16    pub fn new(client: T, parent_path: &str) -> Self {
17        Self {
18            client,
19            path: format!("{}{}", parent_path, "/firewall"),
20        }
21    }
22}
23impl<T> FirewallClient<T>
24where
25    T: crate::client::Client,
26{
27    #[doc = "Directory index."]
28    #[doc = ""]
29    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
30        let path = self.path.to_string();
31        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
32        Ok(optional_vec.unwrap_or_default())
33    }
34}
35#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
36pub struct GetOutputItems {
37    #[serde(
38        flatten,
39        default,
40        skip_serializing_if = "::std::collections::HashMap::is_empty"
41    )]
42    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
43}
44impl<T> FirewallClient<T>
45where
46    T: crate::client::Client,
47{
48    pub fn rules(&self) -> rules::RulesClient<T> {
49        rules::RulesClient::<T>::new(self.client.clone(), &self.path)
50    }
51}
52impl<T> FirewallClient<T>
53where
54    T: crate::client::Client,
55{
56    pub fn aliases(&self) -> aliases::AliasesClient<T> {
57        aliases::AliasesClient::<T>::new(self.client.clone(), &self.path)
58    }
59}
60impl<T> FirewallClient<T>
61where
62    T: crate::client::Client,
63{
64    pub fn ipset(&self) -> ipset::IpsetClient<T> {
65        ipset::IpsetClient::<T>::new(self.client.clone(), &self.path)
66    }
67}
68impl<T> FirewallClient<T>
69where
70    T: crate::client::Client,
71{
72    pub fn options(&self) -> options::OptionsClient<T> {
73        options::OptionsClient::<T>::new(self.client.clone(), &self.path)
74    }
75}
76impl<T> FirewallClient<T>
77where
78    T: crate::client::Client,
79{
80    pub fn log(&self) -> log::LogClient<T> {
81        log::LogClient::<T>::new(self.client.clone(), &self.path)
82    }
83}
84impl<T> FirewallClient<T>
85where
86    T: crate::client::Client,
87{
88    pub fn refs(&self) -> refs::RefsClient<T> {
89        refs::RefsClient::<T>::new(self.client.clone(), &self.path)
90    }
91}