proxmox_api/generated/nodes/node/lxc/vmid/
pending.rs1#[derive(Debug, Clone)]
2pub struct PendingClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> PendingClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/pending"),
14 }
15 }
16}
17impl<T> PendingClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Get container configuration, including pending changes."]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Audit\"])"]
24 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
25 let path = self.path.to_string();
26 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
27 Ok(optional_vec.unwrap_or_default())
28 }
29}
30impl GetOutputItems {
31 pub fn new(key: String) -> Self {
32 Self {
33 key,
34 delete: ::std::default::Default::default(),
35 pending: ::std::default::Default::default(),
36 value: ::std::default::Default::default(),
37 additional_properties: ::std::default::Default::default(),
38 }
39 }
40}
41#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
42pub struct GetOutputItems {
43 #[serde(skip_serializing_if = "Option::is_none", default)]
44 #[doc = "Indicates a pending delete request if present and not 0."]
45 #[doc = ""]
46 pub delete: Option<DeleteInt>,
47 #[doc = "Configuration option name."]
48 #[doc = ""]
49 pub key: String,
50 #[serde(skip_serializing_if = "Option::is_none", default)]
51 #[doc = "Pending value."]
52 #[doc = ""]
53 pub pending: Option<String>,
54 #[serde(skip_serializing_if = "Option::is_none", default)]
55 #[doc = "Current value."]
56 #[doc = ""]
57 pub value: Option<String>,
58 #[serde(
59 flatten,
60 default,
61 skip_serializing_if = "::std::collections::HashMap::is_empty"
62 )]
63 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
64}
65#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
66pub struct DeleteInt(i128);
67impl crate::types::bounded_integer::BoundedInteger for DeleteInt {
68 const MIN: Option<i128> = Some(0i128);
69 const MAX: Option<i128> = Some(2i128);
70 const DEFAULT: Option<i128> = None::<i128>;
71 const TYPE_DESCRIPTION: &'static str = "an integer between 0 and 2";
72 fn get(&self) -> i128 {
73 self.0
74 }
75 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
76 Self::validate(value)?;
77 Ok(Self(value))
78 }
79}
80impl std::convert::TryFrom<i128> for DeleteInt {
81 type Error = crate::types::bounded_integer::BoundedIntegerError;
82 fn try_from(value: i128) -> Result<Self, Self::Error> {
83 crate::types::bounded_integer::BoundedInteger::new(value)
84 }
85}
86impl ::serde::Serialize for DeleteInt {
87 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
88 where
89 S: ::serde::Serializer,
90 {
91 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
92 }
93}
94impl<'de> ::serde::Deserialize<'de> for DeleteInt {
95 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
96 where
97 D: ::serde::Deserializer<'de>,
98 {
99 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
100 }
101}