From: Lukas Wagner Date: Fri, 19 Apr 2024 14:17:12 +0000 (+0200) Subject: notify: derive `api` for Deleteable*Property X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;ds=sidebyside;h=1a40d34083b0003b019766988731c774adbaac17;p=proxmox.git notify: derive `api` for Deleteable*Property The API endpoints in Proxmox Backup Server require ApiType to be implemented for any deserialized parameter. Signed-off-by: Lukas Wagner Reviewed-by: Fiona Ebner --- diff --git a/proxmox-notify/src/endpoints/gotify.rs b/proxmox-notify/src/endpoints/gotify.rs index afdfabc8..ee8ca514 100644 --- a/proxmox-notify/src/endpoints/gotify.rs +++ b/proxmox-notify/src/endpoints/gotify.rs @@ -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, } diff --git a/proxmox-notify/src/endpoints/sendmail.rs b/proxmox-notify/src/endpoints/sendmail.rs index fa040025..47901ef1 100644 --- a/proxmox-notify/src/endpoints/sendmail.rs +++ b/proxmox-notify/src/endpoints/sendmail.rs @@ -73,14 +73,21 @@ pub struct SendmailConfig { pub origin: Option, } +#[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, } diff --git a/proxmox-notify/src/endpoints/smtp.rs b/proxmox-notify/src/endpoints/smtp.rs index ded5baf8..f04583ae 100644 --- a/proxmox-notify/src/endpoints/smtp.rs +++ b/proxmox-notify/src/endpoints/smtp.rs @@ -104,16 +104,25 @@ pub struct SmtpConfig { pub origin: Option, } +#[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, } diff --git a/proxmox-notify/src/matcher.rs b/proxmox-notify/src/matcher.rs index b387fefe..2d303782 100644 --- a/proxmox-notify/src/matcher.rs +++ b/proxmox-notify/src/matcher.rs @@ -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, }