proxmox_api/generated/cluster/firewall/ipset/name/
cidr.rs1pub struct CidrClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> CidrClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str, cidr: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}/{}", parent_path, cidr),
13 }
14 }
15}
16impl<T> CidrClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Remove IP or Network from IPSet."]
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> CidrClient<T>
27where
28 T: crate::client::Client,
29{
30 #[doc = "Read IP or Network settings from IPSet."]
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> CidrClient<T>
37where
38 T: crate::client::Client,
39{
40 #[doc = "Update IP or Network settings"]
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}
67#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
68pub struct PutParams {
69 #[serde(skip_serializing_if = "Option::is_none", default)]
70 pub comment: Option<String>,
71 #[serde(skip_serializing_if = "Option::is_none", default)]
72 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
73 pub digest: Option<String>,
74 #[serde(
75 serialize_with = "crate::types::serialize_bool_optional",
76 deserialize_with = "crate::types::deserialize_bool_optional"
77 )]
78 #[serde(skip_serializing_if = "Option::is_none", default)]
79 pub nomatch: Option<bool>,
80 #[serde(
81 flatten,
82 default,
83 skip_serializing_if = "::std::collections::HashMap::is_empty"
84 )]
85 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
86}