proxmox_api/generated/nodes/node/qemu/vmid/
feature.rs1pub struct FeatureClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> FeatureClient<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, "/feature"),
13 }
14 }
15}
16impl<T> FeatureClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Check if feature for virtual machine is available."]
21 pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22 let path = self.path.to_string();
23 self.client.get(&path, ¶ms)
24 }
25}
26impl GetOutput {
27 pub fn new(hasfeature: bool, nodes: Vec<String>) -> Self {
28 Self {
29 hasfeature,
30 nodes,
31 additional_properties: Default::default(),
32 }
33 }
34}
35#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
36pub struct GetOutput {
37 #[serde(rename = "hasFeature")]
38 #[serde(
39 serialize_with = "crate::types::serialize_bool",
40 deserialize_with = "crate::types::deserialize_bool"
41 )]
42 pub hasfeature: bool,
43 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
44 pub nodes: Vec<String>,
45 #[serde(
46 flatten,
47 default,
48 skip_serializing_if = "::std::collections::HashMap::is_empty"
49 )]
50 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
51}
52impl GetParams {
53 pub fn new(feature: Feature) -> Self {
54 Self {
55 feature,
56 snapname: Default::default(),
57 additional_properties: Default::default(),
58 }
59 }
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
62pub struct GetParams {
63 #[doc = "Feature to check."]
64 pub feature: Feature,
65 #[serde(skip_serializing_if = "Option::is_none", default)]
66 #[doc = "The name of the snapshot."]
67 pub snapname: Option<String>,
68 #[serde(
69 flatten,
70 default,
71 skip_serializing_if = "::std::collections::HashMap::is_empty"
72 )]
73 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
74}
75#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
76pub enum Feature {
77 #[serde(rename = "clone")]
78 Clone,
79 #[serde(rename = "copy")]
80 Copy,
81 #[serde(rename = "snapshot")]
82 Snapshot,
83}