| 1166 | } |
| 1167 | |
| 1168 | async fn delete_aws_sns_integration( |
| 1169 | &self, |
| 1170 | request: Request<api::DeleteAwsSnsIntegrationRequest>, |
| 1171 | ) -> Result<Response<()>, Status> { |
| 1172 | let req = request.get_ref(); |
| 1173 | let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?; |
| 1174 | |
| 1175 | self.validator |
| 1176 | .validate( |
| 1177 | request.extensions(), |
| 1178 | validator::ValidateApplicationAccess::new(validator::Flag::Update, app_id), |
| 1179 | ) |
| 1180 | .await?; |
| 1181 | |
| 1182 | application::delete_integration(&app_id, application::IntegrationKind::AwsSns) |
| 1183 | .await |
| 1184 | .map_err(|e| e.status())?; |
| 1185 | |
| 1186 | let mut resp = Response::new(()); |
| 1187 | resp.metadata_mut() |
| 1188 | .insert("x-log-application_id", req.application_id.parse().unwrap()); |
| 1189 | |
| 1190 | Ok(resp) |
| 1191 | } |
| 1192 | |
| 1193 | async fn create_azure_service_bus_integration( |
| 1194 | &self, |