| 718 | } |
| 719 | |
| 720 | async fn delete_things_board_integration( |
| 721 | &self, |
| 722 | request: Request<api::DeleteThingsBoardIntegrationRequest>, |
| 723 | ) -> Result<Response<()>, Status> { |
| 724 | let req = request.get_ref(); |
| 725 | let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?; |
| 726 | |
| 727 | self.validator |
| 728 | .validate( |
| 729 | request.extensions(), |
| 730 | validator::ValidateApplicationAccess::new(validator::Flag::Update, app_id), |
| 731 | ) |
| 732 | .await?; |
| 733 | |
| 734 | application::delete_integration(&app_id, application::IntegrationKind::ThingsBoard) |
| 735 | .await |
| 736 | .map_err(|e| e.status())?; |
| 737 | |
| 738 | let mut resp = Response::new(()); |
| 739 | resp.metadata_mut() |
| 740 | .insert("x-log-application_id", req.application_id.parse().unwrap()); |
| 741 | |
| 742 | Ok(resp) |
| 743 | } |
| 744 | |
| 745 | async fn create_my_devices_integration( |
| 746 | &self, |