]> git.proxmox.com Git - proxmox.git/commitdiff
notify: derive `api` for Deleteable*Property
authorLukas Wagner <l.wagner@proxmox.com>
Fri, 19 Apr 2024 14:17:12 +0000 (16:17 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Apr 2024 21:06:52 +0000 (23:06 +0200)
The API endpoints in Proxmox Backup Server require ApiType to be
implemented for any deserialized parameter.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
proxmox-notify/src/endpoints/gotify.rs
proxmox-notify/src/endpoints/sendmail.rs
proxmox-notify/src/endpoints/smtp.rs
proxmox-notify/src/matcher.rs

index afdfabc8c6d515afd06b5f96b98a6ead873f8f9b..ee8ca514337a06d20720b3244fc761990a68db41 100644 (file)
@@ -81,10 +81,13 @@ pub struct GotifyEndpoint {
     pub private_config: GotifyPrivateConfig,
 }
 
+#[api]
 #[derive(Serialize, Deserialize)]
 #[serde(rename_all = "kebab-case")]
 pub enum DeleteableGotifyProperty {
+    /// Delete `comment`
     Comment,
+    /// Delete `disable`
     Disable,
 }
 
index fa0400255eb374574d26f18c42faa5eac122eeab..47901ef16c174e67902bc430f5643132801f3495 100644 (file)
@@ -73,14 +73,21 @@ pub struct SendmailConfig {
     pub origin: Option<Origin>,
 }
 
+#[api]
 #[derive(Serialize, Deserialize)]
 #[serde(rename_all = "kebab-case")]
 pub enum DeleteableSendmailProperty {
+    /// Delete `author`
     Author,
+    /// Delete `comment`
     Comment,
+    /// Delete `disable`
     Disable,
+    /// Delete `from-address`
     FromAddress,
+    /// Delete `mailto`
     Mailto,
+    /// Delete `mailto-user`
     MailtoUser,
 }
 
index ded5baf8e41f81433e0bdac2745eb9c280a56f1e..f04583ae24c82639f460f2a9a67c81dbfea131c1 100644 (file)
@@ -104,16 +104,25 @@ pub struct SmtpConfig {
     pub origin: Option<Origin>,
 }
 
+#[api]
 #[derive(Serialize, Deserialize)]
 #[serde(rename_all = "kebab-case")]
 pub enum DeleteableSmtpProperty {
+    /// Delete `author`
     Author,
+    /// Delete `comment`
     Comment,
+    /// Delete `disable`
     Disable,
+    /// Delete `mailto`
     Mailto,
+    /// Delete `mailto-user`
     MailtoUser,
+    /// Delete `password`
     Password,
+    /// Delete `port`
     Port,
+    /// Delete `username`
     Username,
 }
 
index b387fefe9e515017c1bf98a393940733aaa16e2c..2d303782278491b543cfc9f96155c6d6650f22fc 100644 (file)
@@ -412,16 +412,25 @@ impl FromStr for CalendarMatcher {
     }
 }
 
+#[api]
 #[derive(Serialize, Deserialize)]
 #[serde(rename_all = "kebab-case")]
 pub enum DeleteableMatcherProperty {
+    /// Delete `comment`
     Comment,
+    /// Delete `disable`
     Disable,
+    /// Delete `invert-match`
     InvertMatch,
+    /// Delete `match-calendar`
     MatchCalendar,
+    /// Delete `match-field`
     MatchField,
+    /// Delete `match-severity`
     MatchSeverity,
+    /// Delete `mode`
     Mode,
+    /// Delete `target`
     Target,
 }