proxmox_api/generated/cluster/sdn/ipams/
ipam.rs

1pub mod status;
2pub struct IpamClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> IpamClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str, ipam: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}/{}", parent_path, ipam),
14        }
15    }
16}
17impl<T> IpamClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Delete sdn ipam object configuration."]
22    pub fn delete(&self) -> Result<(), T::Error> {
23        let path = self.path.to_string();
24        self.client.delete(&path, &())
25    }
26}
27impl<T> IpamClient<T>
28where
29    T: crate::client::Client,
30{
31    #[doc = "Read sdn ipam configuration."]
32    pub fn get(&self) -> Result<GetOutput, T::Error> {
33        let path = self.path.to_string();
34        self.client.get(&path, &())
35    }
36}
37impl<T> IpamClient<T>
38where
39    T: crate::client::Client,
40{
41    #[doc = "Update sdn ipam object configuration."]
42    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
43        let path = self.path.to_string();
44        self.client.put(&path, &params)
45    }
46}
47#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
48pub struct GetOutput {
49    #[serde(
50        flatten,
51        default,
52        skip_serializing_if = "::std::collections::HashMap::is_empty"
53    )]
54    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
55}
56#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
57pub struct PutParams {
58    #[serde(skip_serializing_if = "Option::is_none", default)]
59    #[doc = "A list of settings you want to delete."]
60    pub delete: Option<String>,
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
63    pub digest: Option<String>,
64    #[serde(
65        serialize_with = "crate::types::serialize_int_optional",
66        deserialize_with = "crate::types::deserialize_int_optional"
67    )]
68    #[serde(skip_serializing_if = "Option::is_none", default)]
69    pub section: Option<u64>,
70    #[serde(skip_serializing_if = "Option::is_none", default)]
71    pub token: Option<String>,
72    #[serde(skip_serializing_if = "Option::is_none", default)]
73    pub url: Option<String>,
74    #[serde(
75        flatten,
76        default,
77        skip_serializing_if = "::std::collections::HashMap::is_empty"
78    )]
79    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
80}
81impl<T> IpamClient<T>
82where
83    T: crate::client::Client,
84{
85    pub fn status(&self) -> status::StatusClient<T> {
86        status::StatusClient::<T>::new(self.client.clone(), &self.path)
87    }
88}