(&self, session_id: &str)
| 651 | } |
| 652 | |
| 653 | pub fn compact_session(&self, session_id: &str) -> anyhow::Result<CompactResponse> { |
| 654 | let url = format!("{}/session/{}/compact", self.base_url, session_id); |
| 655 | let response = self.client.post(&url).send()?; |
| 656 | if !response.status().is_success() { |
| 657 | let status = response.status(); |
| 658 | let text = response.text().unwrap_or_default(); |
| 659 | anyhow::bail!( |
| 660 | "Failed to compact session `{}`: {} - {}", |
| 661 | session_id, |
| 662 | status, |
| 663 | text |
| 664 | ); |
| 665 | } |
| 666 | Ok(response.json::<CompactResponse>()?) |
| 667 | } |
| 668 | |
| 669 | pub fn revert_session( |
| 670 | &self, |
no test coverage detected