From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id D3EF81FF0C0 for ; Wed, 18 Nov 2026 10:45:20 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 429EF2173B; Wed, 18 Nov 2026 10:44:45 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox v2 16/63] notify: move schema module to api_types Date: Wed, 18 Nov 2026 10:43:00 +0100 Message-ID: <20261118094348.273646-17-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118094348.273646-1-l.wagner@proxmox.com> References: <20261118094348.273646-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794995036861 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.198 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NMGTOAQ4V5H7VNJL6TM3GGOGQTLEFAJ5 X-Message-ID-Hash: NMGTOAQ4V5H7VNJL6TM3GGOGQTLEFAJ5 X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: No functional changes. Signed-off-by: Lukas Wagner --- proxmox-notify/src/api_types/gotify.rs | 3 ++- proxmox-notify/src/api_types/matcher/mod.rs | 3 ++- proxmox-notify/src/api_types/mod.rs | 3 +++ proxmox-notify/src/{ => api_types}/schema.rs | 0 proxmox-notify/src/api_types/sendmail.rs | 3 ++- proxmox-notify/src/api_types/smtp.rs | 3 ++- proxmox-notify/src/api_types/webhook.rs | 2 +- proxmox-notify/src/config.rs | 5 ++--- proxmox-notify/src/lib.rs | 1 - 9 files changed, 14 insertions(+), 9 deletions(-) rename proxmox-notify/src/{ => api_types}/schema.rs (100%) diff --git a/proxmox-notify/src/api_types/gotify.rs b/proxmox-notify/src/api_types/gotify.rs index 433a9fae3..334920145 100644 --- a/proxmox-notify/src/api_types/gotify.rs +++ b/proxmox-notify/src/api_types/gotify.rs @@ -3,7 +3,8 @@ use serde::{Deserialize, Serialize}; use proxmox_schema::{Updater, api, api_types::COMMENT_SCHEMA}; use crate::api_types::Origin; -use crate::schema::ENTITY_NAME_SCHEMA; + +use super::schema::ENTITY_NAME_SCHEMA; pub const GOTIFY_TYPENAME: &str = "gotify"; diff --git a/proxmox-notify/src/api_types/matcher/mod.rs b/proxmox-notify/src/api_types/matcher/mod.rs index 3e8bc4dbe..c88ae09cd 100644 --- a/proxmox-notify/src/api_types/matcher/mod.rs +++ b/proxmox-notify/src/api_types/matcher/mod.rs @@ -10,9 +10,10 @@ use proxmox_schema::Updater; use proxmox_schema::api_types::COMMENT_SCHEMA; use crate::api_types::Origin; -use crate::schema::ENTITY_NAME_SCHEMA; use crate::{Error, Notification}; +use super::schema::ENTITY_NAME_SCHEMA; + pub mod calendar; pub mod expression; pub mod field; diff --git a/proxmox-notify/src/api_types/mod.rs b/proxmox-notify/src/api_types/mod.rs index a72ddbc16..f3b381a8b 100644 --- a/proxmox-notify/src/api_types/mod.rs +++ b/proxmox-notify/src/api_types/mod.rs @@ -24,6 +24,9 @@ pub use smtp::*; mod matcher; pub use matcher::*; +mod schema; +pub use schema::*; + #[api] #[derive(Clone, Debug, Copy, Serialize, Deserialize, PartialEq, Eq, PartialOrd)] #[serde(rename_all = "kebab-case")] diff --git a/proxmox-notify/src/schema.rs b/proxmox-notify/src/api_types/schema.rs similarity index 100% rename from proxmox-notify/src/schema.rs rename to proxmox-notify/src/api_types/schema.rs diff --git a/proxmox-notify/src/api_types/sendmail.rs b/proxmox-notify/src/api_types/sendmail.rs index c3437bc1f..bb843fbfa 100644 --- a/proxmox-notify/src/api_types/sendmail.rs +++ b/proxmox-notify/src/api_types/sendmail.rs @@ -3,7 +3,8 @@ use serde::{Deserialize, Serialize}; use proxmox_schema::{Updater, api, api_types::COMMENT_SCHEMA}; use crate::api_types::Origin; -use crate::schema::{EMAIL_SCHEMA, ENTITY_NAME_SCHEMA, USER_SCHEMA}; + +use super::schema::{EMAIL_SCHEMA, ENTITY_NAME_SCHEMA, USER_SCHEMA}; pub const SENDMAIL_TYPENAME: &str = "sendmail"; diff --git a/proxmox-notify/src/api_types/smtp.rs b/proxmox-notify/src/api_types/smtp.rs index 653c7a50f..5cebbf8ad 100644 --- a/proxmox-notify/src/api_types/smtp.rs +++ b/proxmox-notify/src/api_types/smtp.rs @@ -3,7 +3,8 @@ use serde::{Deserialize, Serialize}; use proxmox_schema::{Updater, api, api_types::COMMENT_SCHEMA}; use crate::api_types::Origin; -use crate::schema::{EMAIL_SCHEMA, ENTITY_NAME_SCHEMA, USER_SCHEMA}; + +use super::schema::{EMAIL_SCHEMA, ENTITY_NAME_SCHEMA, USER_SCHEMA}; pub const SMTP_TYPENAME: &str = "smtp"; diff --git a/proxmox-notify/src/api_types/webhook.rs b/proxmox-notify/src/api_types/webhook.rs index c556d1b3f..4a2430cec 100644 --- a/proxmox-notify/src/api_types/webhook.rs +++ b/proxmox-notify/src/api_types/webhook.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use crate::Error; use crate::api_types::Origin; -use crate::schema::ENTITY_NAME_SCHEMA; +use super::schema::ENTITY_NAME_SCHEMA; /// This will be used as a section type in the public/private configuration file. pub const WEBHOOK_TYPENAME: &str = "webhook"; diff --git a/proxmox-notify/src/config.rs b/proxmox-notify/src/config.rs index 59da68c5e..fcbf568f4 100644 --- a/proxmox-notify/src/config.rs +++ b/proxmox-notify/src/config.rs @@ -7,11 +7,10 @@ use serde_json::Value; use tracing::error; use crate::api_types::{ - GOTIFY_TYPENAME, GotifyConfig, GotifyPrivateConfig, MATCHER_TYPENAME, MatcherConfig, - SENDMAIL_TYPENAME, SMTP_TYPENAME, SendmailConfig, SmtpConfig, SmtpPrivateConfig, + BACKEND_NAME_SCHEMA, GOTIFY_TYPENAME, GotifyConfig, GotifyPrivateConfig, MATCHER_TYPENAME, + MatcherConfig, SENDMAIL_TYPENAME, SMTP_TYPENAME, SendmailConfig, SmtpConfig, SmtpPrivateConfig, WEBHOOK_TYPENAME, WebhookConfig, WebhookPrivateConfig, }; -use crate::schema::BACKEND_NAME_SCHEMA; use crate::{Context, Error}; /// Section config schema for the public config file. diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs index f0d0f3866..925465bf5 100644 --- a/proxmox-notify/src/lib.rs +++ b/proxmox-notify/src/lib.rs @@ -8,7 +8,6 @@ pub mod config; pub mod context; pub mod endpoints; pub mod renderer; -pub mod schema; #[cfg(feature = "send-impl")] pub mod send; -- 2.47.3