proxmox_api/generated/cluster/ceph/flags/
flag.rs1pub struct FlagClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> FlagClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str, flag: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}/{}", parent_path, flag),
13 }
14 }
15}
16impl<T> FlagClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Get the status of a specific ceph flag."]
21 pub fn get(&self) -> Result<bool, T::Error> {
22 let path = self.path.to_string();
23 Ok(self.client.get::<_, crate::types::Bool>(&path, &())?.get())
24 }
25}
26impl<T> FlagClient<T>
27where
28 T: crate::client::Client,
29{
30 #[doc = "Set or clear (unset) a specific ceph flag"]
31 pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
32 let path = self.path.to_string();
33 self.client.put(&path, ¶ms)
34 }
35}
36impl PutParams {
37 pub fn new(value: bool) -> Self {
38 Self {
39 value,
40 additional_properties: Default::default(),
41 }
42 }
43}
44#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
45pub struct PutParams {
46 #[serde(
47 serialize_with = "crate::types::serialize_bool",
48 deserialize_with = "crate::types::deserialize_bool"
49 )]
50 #[doc = "The new value of the flag"]
51 pub value: bool,
52 #[serde(
53 flatten,
54 default,
55 skip_serializing_if = "::std::collections::HashMap::is_empty"
56 )]
57 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
58}