| 861 | } |
| 862 | |
| 863 | async fn delete_my_devices_integration( |
| 864 | &self, |
| 865 | request: Request<api::DeleteMyDevicesIntegrationRequest>, |
| 866 | ) -> Result<Response<()>, Status> { |
| 867 | let req = request.get_ref(); |
| 868 | let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?; |
| 869 | |
| 870 | self.validator |
| 871 | .validate( |
| 872 | request.extensions(), |
| 873 | validator::ValidateApplicationAccess::new(validator::Flag::Update, app_id), |
| 874 | ) |
| 875 | .await?; |
| 876 | |
| 877 | application::delete_integration(&app_id, application::IntegrationKind::MyDevices) |
| 878 | .await |
| 879 | .map_err(|e| e.status())?; |
| 880 | |
| 881 | let mut resp = Response::new(()); |
| 882 | resp.metadata_mut() |
| 883 | .insert("x-log-application_id", req.application_id.parse().unwrap()); |
| 884 | |
| 885 | Ok(resp) |
| 886 | } |
| 887 | |
| 888 | async fn create_gcp_pub_sub_integration( |
| 889 | &self, |