proxmox_api/generated/nodes/node/lxc/vmid/
feature.rs

1pub 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, &params)
24    }
25}
26impl GetOutput {
27    pub fn new(hasfeature: bool) -> Self {
28        Self {
29            hasfeature,
30            additional_properties: Default::default(),
31        }
32    }
33}
34#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
35pub struct GetOutput {
36    #[serde(rename = "hasFeature")]
37    #[serde(
38        serialize_with = "crate::types::serialize_bool",
39        deserialize_with = "crate::types::deserialize_bool"
40    )]
41    pub hasfeature: bool,
42    #[serde(
43        flatten,
44        default,
45        skip_serializing_if = "::std::collections::HashMap::is_empty"
46    )]
47    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
48}
49impl GetParams {
50    pub fn new(feature: Feature) -> Self {
51        Self {
52            feature,
53            snapname: Default::default(),
54            additional_properties: Default::default(),
55        }
56    }
57}
58#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
59pub struct GetParams {
60    #[doc = "Feature to check."]
61    pub feature: Feature,
62    #[serde(skip_serializing_if = "Option::is_none", default)]
63    #[doc = "The name of the snapshot."]
64    pub snapname: Option<String>,
65    #[serde(
66        flatten,
67        default,
68        skip_serializing_if = "::std::collections::HashMap::is_empty"
69    )]
70    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
71}
72#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
73pub enum Feature {
74    #[serde(rename = "clone")]
75    Clone,
76    #[serde(rename = "copy")]
77    Copy,
78    #[serde(rename = "snapshot")]
79    Snapshot,
80}