| 1628 | } |
| 1629 | |
| 1630 | async fn delete_ifttt_integration( |
| 1631 | &self, |
| 1632 | request: Request<api::DeleteIftttIntegrationRequest>, |
| 1633 | ) -> Result<Response<()>, Status> { |
| 1634 | let req = request.get_ref(); |
| 1635 | let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?; |
| 1636 | |
| 1637 | self.validator |
| 1638 | .validate( |
| 1639 | request.extensions(), |
| 1640 | validator::ValidateApplicationAccess::new(validator::Flag::Update, app_id), |
| 1641 | ) |
| 1642 | .await?; |
| 1643 | |
| 1644 | application::delete_integration(&app_id, application::IntegrationKind::Ifttt) |
| 1645 | .await |
| 1646 | .map_err(|e| e.status())?; |
| 1647 | |
| 1648 | let mut resp = Response::new(()); |
| 1649 | resp.metadata_mut() |
| 1650 | .insert("x-log-application_id", req.application_id.parse().unwrap()); |
| 1651 | |
| 1652 | Ok(resp) |
| 1653 | } |
| 1654 | |
| 1655 | async fn create_blynk_integration( |
| 1656 | &self, |