(&self, session_id: &str)
| 278 | } |
| 279 | |
| 280 | pub fn get_session(&self, session_id: &str) -> anyhow::Result<SessionInfo> { |
| 281 | let url = format!("{}/session/{}", self.base_url, session_id); |
| 282 | |
| 283 | let response = self.client.get(&url).send()?; |
| 284 | |
| 285 | if !response.status().is_success() { |
| 286 | let status = response.status(); |
| 287 | let text = response.text().unwrap_or_default(); |
| 288 | anyhow::bail!("Failed to get session: {} - {}", status, text); |
| 289 | } |
| 290 | |
| 291 | let session: SessionInfo = response.json()?; |
| 292 | Ok(session) |
| 293 | } |
| 294 | |
| 295 | pub fn list_sessions(&self) -> anyhow::Result<Vec<SessionInfo>> { |
| 296 | self.list_sessions_filtered(None, None) |
no test coverage detected