(&self, session_id: &str)
| 615 | } |
| 616 | |
| 617 | pub fn share_session(&self, session_id: &str) -> anyhow::Result<ShareResponse> { |
| 618 | let url = format!("{}/session/{}/share", self.base_url, session_id); |
| 619 | let response = self.client.post(&url).send()?; |
| 620 | if !response.status().is_success() { |
| 621 | let status = response.status(); |
| 622 | let text = response.text().unwrap_or_default(); |
| 623 | anyhow::bail!( |
| 624 | "Failed to share session `{}`: {} - {}", |
| 625 | session_id, |
| 626 | status, |
| 627 | text |
| 628 | ); |
| 629 | } |
| 630 | Ok(response.json::<ShareResponse>()?) |
| 631 | } |
| 632 | |
| 633 | pub fn unshare_session(&self, session_id: &str) -> anyhow::Result<bool> { |
| 634 | let url = format!("{}/session/{}/share", self.base_url, session_id); |
no test coverage detected