Skip to main content

proxmox_api/generated/cluster/
firewall.rs

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