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