proxmox_api/generated/nodes/node/qemu/vmid/firewall/
aliases.rs1pub mod name;
2pub struct AliasesClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> AliasesClient<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, "/aliases"),
14 }
15 }
16}
17impl<T> AliasesClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "List aliases"]
22 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl<T> AliasesClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Create IP or Network Alias."]
32 pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
33 let path = self.path.to_string();
34 self.client.post(&path, ¶ms)
35 }
36}
37impl GetOutputItems {
38 pub fn new(cidr: String, digest: String, name: String) -> Self {
39 Self {
40 cidr,
41 digest,
42 name,
43 comment: Default::default(),
44 additional_properties: Default::default(),
45 }
46 }
47}
48#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
49pub struct GetOutputItems {
50 pub cidr: String,
51 #[serde(skip_serializing_if = "Option::is_none", default)]
52 pub comment: Option<String>,
53 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
54 pub digest: String,
55 pub name: String,
56 #[serde(
57 flatten,
58 default,
59 skip_serializing_if = "::std::collections::HashMap::is_empty"
60 )]
61 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
62}
63impl PostParams {
64 pub fn new(cidr: String, name: String) -> Self {
65 Self {
66 cidr,
67 name,
68 comment: Default::default(),
69 additional_properties: Default::default(),
70 }
71 }
72}
73#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
74pub struct PostParams {
75 #[doc = "Network/IP specification in CIDR format."]
76 pub cidr: String,
77 #[serde(skip_serializing_if = "Option::is_none", default)]
78 pub comment: Option<String>,
79 #[doc = "Alias name."]
80 pub name: String,
81 #[serde(
82 flatten,
83 default,
84 skip_serializing_if = "::std::collections::HashMap::is_empty"
85 )]
86 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
87}
88impl<T> AliasesClient<T>
89where
90 T: crate::client::Client,
91{
92 pub fn name(&self, name: &str) -> name::NameClient<T> {
93 name::NameClient::<T>::new(self.client.clone(), &self.path, name)
94 }
95}