proxmox_api/generated/nodes/node/qemu/vmid/
unlink.rs

1pub struct UnlinkClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> UnlinkClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/unlink"),
13        }
14    }
15}
16impl<T> UnlinkClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Unlink/delete disk images."]
21    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.put(&path, &params)
24    }
25}
26impl PutParams {
27    pub fn new(idlist: String) -> Self {
28        Self {
29            idlist,
30            force: Default::default(),
31            additional_properties: Default::default(),
32        }
33    }
34}
35#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
36pub struct PutParams {
37    #[serde(
38        serialize_with = "crate::types::serialize_bool_optional",
39        deserialize_with = "crate::types::deserialize_bool_optional"
40    )]
41    #[serde(skip_serializing_if = "Option::is_none", default)]
42    #[doc = "Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal."]
43    pub force: Option<bool>,
44    #[doc = "A list of disk IDs you want to delete."]
45    pub idlist: String,
46    #[serde(
47        flatten,
48        default,
49        skip_serializing_if = "::std::collections::HashMap::is_empty"
50    )]
51    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
52}