Skip to main content

proxmox_api/generated/cluster/notifications/
endpoints.rs

1pub mod gotify;
2pub mod sendmail;
3pub mod smtp;
4pub mod webhook;
5#[derive(Debug, Clone)]
6pub struct EndpointsClient<T> {
7    client: T,
8    path: String,
9}
10impl<T> EndpointsClient<T>
11where
12    T: crate::client::Client,
13{
14    pub fn new(client: T, parent_path: &str) -> Self {
15        Self {
16            client,
17            path: format!("{}{}", parent_path, "/endpoints"),
18        }
19    }
20}
21impl<T> EndpointsClient<T>
22where
23    T: crate::client::Client,
24{
25    #[doc = "Index for all available endpoint types."]
26    #[doc = ""]
27    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
28        let path = self.path.to_string();
29        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
30        Ok(optional_vec.unwrap_or_default())
31    }
32}
33#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
34pub struct GetOutputItems {
35    #[serde(
36        flatten,
37        default,
38        skip_serializing_if = "::std::collections::HashMap::is_empty"
39    )]
40    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
41}
42impl<T> EndpointsClient<T>
43where
44    T: crate::client::Client,
45{
46    pub fn sendmail(&self) -> sendmail::SendmailClient<T> {
47        sendmail::SendmailClient::<T>::new(self.client.clone(), &self.path)
48    }
49}
50impl<T> EndpointsClient<T>
51where
52    T: crate::client::Client,
53{
54    pub fn gotify(&self) -> gotify::GotifyClient<T> {
55        gotify::GotifyClient::<T>::new(self.client.clone(), &self.path)
56    }
57}
58impl<T> EndpointsClient<T>
59where
60    T: crate::client::Client,
61{
62    pub fn smtp(&self) -> smtp::SmtpClient<T> {
63        smtp::SmtpClient::<T>::new(self.client.clone(), &self.path)
64    }
65}
66impl<T> EndpointsClient<T>
67where
68    T: crate::client::Client,
69{
70    pub fn webhook(&self) -> webhook::WebhookClient<T> {
71        webhook::WebhookClient::<T>::new(self.client.clone(), &self.path)
72    }
73}