proxmox_api/generated/cluster/notifications/endpoints/sendmail/
name.rs

1pub struct NameClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> NameClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str, name: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}/{}", parent_path, name),
13        }
14    }
15}
16impl<T> NameClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Remove sendmail endpoint"]
21    pub fn delete(&self) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.delete(&path, &())
24    }
25}
26impl<T> NameClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Return a specific sendmail endpoint"]
31    pub fn get(&self) -> Result<GetOutput, T::Error> {
32        let path = self.path.to_string();
33        self.client.get(&path, &())
34    }
35}
36impl<T> NameClient<T>
37where
38    T: crate::client::Client,
39{
40    #[doc = "Update existing sendmail endpoint"]
41    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
42        let path = self.path.to_string();
43        self.client.put(&path, &params)
44    }
45}
46impl GetOutput {
47    pub fn new(name: String) -> Self {
48        Self {
49            name,
50            author: Default::default(),
51            comment: Default::default(),
52            digest: Default::default(),
53            disable: Default::default(),
54            from_address: Default::default(),
55            mailto: Default::default(),
56            mailto_user: Default::default(),
57            additional_properties: Default::default(),
58        }
59    }
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
62pub struct GetOutput {
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    #[doc = "Author of the mail"]
65    pub author: Option<String>,
66    #[serde(skip_serializing_if = "Option::is_none", default)]
67    #[doc = "Comment"]
68    pub comment: Option<String>,
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
71    pub digest: Option<String>,
72    #[serde(
73        serialize_with = "crate::types::serialize_bool_optional",
74        deserialize_with = "crate::types::deserialize_bool_optional"
75    )]
76    #[serde(skip_serializing_if = "Option::is_none", default)]
77    #[doc = "Disable this target"]
78    pub disable: Option<bool>,
79    #[serde(rename = "from-address")]
80    #[serde(skip_serializing_if = "Option::is_none", default)]
81    #[doc = "`From` address for the mail"]
82    pub from_address: Option<String>,
83    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
84    #[doc = "List of email recipients"]
85    pub mailto: Vec<String>,
86    #[serde(rename = "mailto-user")]
87    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
88    #[doc = "List of users"]
89    pub mailto_user: Vec<String>,
90    #[doc = "The name of the endpoint."]
91    pub name: String,
92    #[serde(
93        flatten,
94        default,
95        skip_serializing_if = "::std::collections::HashMap::is_empty"
96    )]
97    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
98}
99#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
100pub struct PutParams {
101    #[serde(skip_serializing_if = "Option::is_none", default)]
102    #[doc = "Author of the mail"]
103    pub author: Option<String>,
104    #[serde(skip_serializing_if = "Option::is_none", default)]
105    #[doc = "Comment"]
106    pub comment: Option<String>,
107    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
108    #[doc = "A list of settings you want to delete."]
109    pub delete: Vec<String>,
110    #[serde(skip_serializing_if = "Option::is_none", default)]
111    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
112    pub digest: Option<String>,
113    #[serde(
114        serialize_with = "crate::types::serialize_bool_optional",
115        deserialize_with = "crate::types::deserialize_bool_optional"
116    )]
117    #[serde(skip_serializing_if = "Option::is_none", default)]
118    #[doc = "Disable this target"]
119    pub disable: Option<bool>,
120    #[serde(rename = "from-address")]
121    #[serde(skip_serializing_if = "Option::is_none", default)]
122    #[doc = "`From` address for the mail"]
123    pub from_address: Option<String>,
124    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
125    #[doc = "List of email recipients"]
126    pub mailto: Vec<String>,
127    #[serde(rename = "mailto-user")]
128    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
129    #[doc = "List of users"]
130    pub mailto_user: Vec<String>,
131    #[serde(
132        flatten,
133        default,
134        skip_serializing_if = "::std::collections::HashMap::is_empty"
135    )]
136    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
137}