proxmox_api/generated/cluster/notifications/
matcher_field_values.rs1#[derive(Debug, Clone)]
2pub struct MatcherFieldValuesClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> MatcherFieldValuesClient<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, "/matcher-field-values"),
14 }
15 }
16}
17impl<T> MatcherFieldValuesClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Returns known notification metadata fields and their known values"]
22 #[doc = ""]
23 #[doc = "Permission check: or(perm(\"/mapping/notifications\", [\"Mapping.Modify\"]), perm(\"/mapping/notifications\", [\"Mapping.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(field: String, value: String) -> Self {
32 Self {
33 field,
34 value,
35 comment: ::std::default::Default::default(),
36 additional_properties: ::std::default::Default::default(),
37 }
38 }
39}
40#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
41pub struct GetOutputItems {
42 #[serde(skip_serializing_if = "Option::is_none", default)]
43 #[doc = "Additional comment for this value."]
44 #[doc = ""]
45 pub comment: Option<String>,
46 #[doc = "Field this value belongs to."]
47 #[doc = ""]
48 pub field: String,
49 #[doc = "Notification metadata value known by the system."]
50 #[doc = ""]
51 pub value: String,
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}