| 1013 | } |
| 1014 | |
| 1015 | async fn delete_gcp_pub_sub_integration( |
| 1016 | &self, |
| 1017 | request: Request<api::DeleteGcpPubSubIntegrationRequest>, |
| 1018 | ) -> Result<Response<()>, Status> { |
| 1019 | let req = request.get_ref(); |
| 1020 | let app_id = Uuid::from_str(&req.application_id).map_err(|e| e.status())?; |
| 1021 | |
| 1022 | self.validator |
| 1023 | .validate( |
| 1024 | request.extensions(), |
| 1025 | validator::ValidateApplicationAccess::new(validator::Flag::Update, app_id), |
| 1026 | ) |
| 1027 | .await?; |
| 1028 | |
| 1029 | application::delete_integration(&app_id, application::IntegrationKind::GcpPubSub) |
| 1030 | .await |
| 1031 | .map_err(|e| e.status())?; |
| 1032 | |
| 1033 | let mut resp = Response::new(()); |
| 1034 | resp.metadata_mut() |
| 1035 | .insert("x-log-application_id", req.application_id.parse().unwrap()); |
| 1036 | |
| 1037 | Ok(resp) |
| 1038 | } |
| 1039 | |
| 1040 | async fn create_aws_sns_integration( |
| 1041 | &self, |