proxmox_api/generated/nodes/node/qemu/vmid/snapshot/
snapname.rs1pub mod config;
2pub mod rollback;
3pub struct SnapnameClient<T> {
4 client: T,
5 path: String,
6}
7impl<T> SnapnameClient<T>
8where
9 T: crate::client::Client,
10{
11 pub fn new(client: T, parent_path: &str, snapname: &str) -> Self {
12 Self {
13 client,
14 path: format!("{}/{}", parent_path, snapname),
15 }
16 }
17}
18impl<T> SnapnameClient<T>
19where
20 T: crate::client::Client,
21{
22 #[doc = "Delete a VM snapshot."]
23 pub fn delete(&self, params: DeleteParams) -> Result<String, T::Error> {
24 let path = self.path.to_string();
25 self.client.delete(&path, ¶ms)
26 }
27}
28impl<T> SnapnameClient<T>
29where
30 T: crate::client::Client,
31{
32 #[doc = ""]
33 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
34 let path = self.path.to_string();
35 self.client.get(&path, &())
36 }
37}
38#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
39pub struct DeleteParams {
40 #[serde(
41 serialize_with = "crate::types::serialize_bool_optional",
42 deserialize_with = "crate::types::deserialize_bool_optional"
43 )]
44 #[serde(skip_serializing_if = "Option::is_none", default)]
45 #[doc = "For removal from config file, even if removing disk snapshots fails."]
46 pub force: Option<bool>,
47 #[serde(
48 flatten,
49 default,
50 skip_serializing_if = "::std::collections::HashMap::is_empty"
51 )]
52 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
53}
54#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
55pub struct GetOutputItems {
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<T> SnapnameClient<T>
64where
65 T: crate::client::Client,
66{
67 pub fn config(&self) -> config::ConfigClient<T> {
68 config::ConfigClient::<T>::new(self.client.clone(), &self.path)
69 }
70}
71impl<T> SnapnameClient<T>
72where
73 T: crate::client::Client,
74{
75 pub fn rollback(&self) -> rollback::RollbackClient<T> {
76 rollback::RollbackClient::<T>::new(self.client.clone(), &self.path)
77 }
78}