use crate::app::Enableable; use crate::config::types::{Password, Topic, Username}; use serde::{Deserialize, Serialize}; use url::Url; /// Configuration for the ntfy notification service #[derive(Debug, Clone, Serialize, Deserialize)] pub struct NtfyConfig { /// Whether to enable the ntfy notification service #[serde(default)] pub enable: bool, /// The URL of the ntfy server pub url: Url, /// The username for authentication (optional) #[serde(default)] pub username: Option, /// The password for authentication (optional) #[serde(default)] pub password: Option, /// The topic to publish notifications to pub topic: Topic, } impl Enableable for NtfyConfig { fn is_enabled(&self) -> bool { self.enable } }