proxmox_api/generated/cluster/
notifications.rs1pub mod endpoints;
2pub mod matcher_field_values;
3pub mod matcher_fields;
4pub mod matchers;
5pub mod targets;
6#[derive(Debug, Clone)]
7pub struct NotificationsClient<T> {
8 client: T,
9 path: String,
10}
11impl<T> NotificationsClient<T>
12where
13 T: crate::client::Client,
14{
15 pub fn new(client: T, parent_path: &str) -> Self {
16 Self {
17 client,
18 path: format!("{}{}", parent_path, "/notifications"),
19 }
20 }
21}
22impl<T> NotificationsClient<T>
23where
24 T: crate::client::Client,
25{
26 #[doc = "Index for notification-related API endpoints."]
27 #[doc = ""]
28 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
29 let path = self.path.to_string();
30 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
31 Ok(optional_vec.unwrap_or_default())
32 }
33}
34#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
35pub struct GetOutputItems {
36 #[serde(
37 flatten,
38 default,
39 skip_serializing_if = "::std::collections::HashMap::is_empty"
40 )]
41 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
42}
43impl<T> NotificationsClient<T>
44where
45 T: crate::client::Client,
46{
47 pub fn matcher_fields(&self) -> matcher_fields::MatcherFieldsClient<T> {
48 matcher_fields::MatcherFieldsClient::<T>::new(self.client.clone(), &self.path)
49 }
50}
51impl<T> NotificationsClient<T>
52where
53 T: crate::client::Client,
54{
55 pub fn matcher_field_values(&self) -> matcher_field_values::MatcherFieldValuesClient<T> {
56 matcher_field_values::MatcherFieldValuesClient::<T>::new(self.client.clone(), &self.path)
57 }
58}
59impl<T> NotificationsClient<T>
60where
61 T: crate::client::Client,
62{
63 pub fn endpoints(&self) -> endpoints::EndpointsClient<T> {
64 endpoints::EndpointsClient::<T>::new(self.client.clone(), &self.path)
65 }
66}
67impl<T> NotificationsClient<T>
68where
69 T: crate::client::Client,
70{
71 pub fn targets(&self) -> targets::TargetsClient<T> {
72 targets::TargetsClient::<T>::new(self.client.clone(), &self.path)
73 }
74}
75impl<T> NotificationsClient<T>
76where
77 T: crate::client::Client,
78{
79 pub fn matchers(&self) -> matchers::MatchersClient<T> {
80 matchers::MatchersClient::<T>::new(self.client.clone(), &self.path)
81 }
82}