| 1462 | } |
| 1463 | |
| 1464 | async fn delete_pilot_things_integration( |
| 1465 | &self, |
| 1466 | request: Request<api::DeletePilotThingsIntegrationRequest>, |
| 1467 | ) -> Result<Response<()>, Status> { |
| 1468 | let req = request.get_ref(); |
| 1469 | let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?; |
| 1470 | |
| 1471 | self.validator |
| 1472 | .validate( |
| 1473 | request.extensions(), |
| 1474 | validator::ValidateApplicationAccess::new(validator::Flag::Update, app_id), |
| 1475 | ) |
| 1476 | .await?; |
| 1477 | |
| 1478 | application::delete_integration(&app_id, application::IntegrationKind::PilotThings) |
| 1479 | .await |
| 1480 | .map_err(|e| e.status())?; |
| 1481 | |
| 1482 | let mut resp = Response::new(()); |
| 1483 | resp.metadata_mut() |
| 1484 | .insert("x-log-application_id", req.application_id.parse().unwrap()); |
| 1485 | |
| 1486 | Ok(resp) |
| 1487 | } |
| 1488 | |
| 1489 | async fn create_ifttt_integration( |
| 1490 | &self, |