use crate::mcp::{GenericMeta, IntoMcpNotification, McpNotification}; use serde::{Deserialize, Serialize};
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ResourceListChangedNotificationParams {
#[serde(rename = "_meta")]
pub meta: Option<GenericMeta>,
}
impl ResourceListChangedNotificationParams {
pub fn new() -> Self {
Self::default()
}
pub fn with_meta(mut self, meta: GenericMeta) -> Self {
self.meta = Some(meta);
self
}
}
impl IntoMcpNotification for ResourceListChangedNotificationParams {
const METHOD: &'static str = "notifications/resources/list_changed";
}
pub type ResourceListChangedNotification = McpNotification<ResourceListChangedNotificationParams>;
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ResourceUpdatedNotificationParams {
#[serde(rename = "_meta")]
pub meta: Option<GenericMeta>,
pub uri: String,
}
impl ResourceUpdatedNotificationParams {
pub fn new(uri: impl Into<String>) -> Self {
Self {
meta: None,
uri: uri.into(),
}
}
pub fn with_meta(mut self, meta: GenericMeta) -> Self {
self.meta = Some(meta);
self
}
}
impl IntoMcpNotification for ResourceUpdatedNotificationParams {
const METHOD: &'static str = "notifications/resources/updated";
}
pub type ResourceUpdatedNotification = McpNotification<ResourceUpdatedNotificationParams>;