Retrieves information about a specific notification identified by its ID.
(&self, notification_id: i32)
| 1576 | |
| 1577 | /// Retrieves information about a specific notification identified by its ID. |
| 1578 | pub async fn get_notification(&self, notification_id: i32) -> Result<Notification> { |
| 1579 | self.get_notifications().await.and_then(|notifications| { |
| 1580 | notifications |
| 1581 | .into_iter() |
| 1582 | .find(|notification| notification.id == Some(notification_id)) |
| 1583 | .ok_or_else(|| Error::IdNotFound("Notification".to_owned(), notification_id)) |
| 1584 | }) |
| 1585 | } |
| 1586 | |
| 1587 | /// Adds a new notification to Uptime Kuma. |
| 1588 | pub async fn add_notification(&self, mut notification: Notification) -> Result<Notification> { |
no test coverage detected