MCPcopy Create free account
hub / github.com/BigBoot/AutoKuma / edit_notification

Method edit_notification

kuma-client/src/client.rs:521–542  ·  view source on GitHub ↗
(
        self: &Arc<Self>,
        notification: &mut Notification,
    )

Source from the content-addressed store, hash-verified

519 }
520
521 pub async fn edit_notification(
522 self: &Arc<Self>,
523 notification: &mut Notification,
524 ) -> Result<()> {
525 let json = serde_json::to_value(notification.clone()).unwrap();
526 let config_json =
527 serde_json::to_value(notification.config.clone().unwrap_or_else(|| json!({}))).unwrap();
528
529 let merge = serde_merge::omerge(config_json, &json).unwrap();
530
531 notification.id = Some(
532 self.call(
533 "addNotification",
534 vec![merge, notification.id.into()],
535 "/id",
536 true,
537 )
538 .await?,
539 );
540
541 Ok(())
542 }
543
544 pub async fn delete_notification(self: &Arc<Self>, notification_id: i32) -> Result<()> {
545 let _: bool = self

Callers 3

add_notificationMethod · 0.80
update_entityMethod · 0.80
handleFunction · 0.80

Calls 1

callMethod · 0.45

Tested by

no test coverage detected