aboutsummaryrefslogtreecommitdiffstats
path: root/src/zotapi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/zotapi.rs')
-rw-r--r--src/zotapi.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/zotapi.rs b/src/zotapi.rs
index 2d50ef3..5a2f5cc 100644
--- a/src/zotapi.rs
+++ b/src/zotapi.rs
@@ -60,6 +60,31 @@ impl ZotApi {
Ok(self.get("version").send().await?.text().await?)
}
+ /**
+ * Returns the list of channels for this account.
+ */
+ pub async fn channel_list(&self) -> Result<Vec<String>, Box<dyn std::error::Error>> {
+ let json = self.get("channel/list")
+ .send().await?
+ .text().await?;
+ Ok(serde_json::from_str(&json)?)
+ }
+
+ /**
+ * Return the channel stream as json.
+ */
+ pub async fn channel_stream(&self) -> Result<String, Box<dyn std::error::Error>> {
+ Ok(self.get("channel/stream").send().await?.text().await?)
+ }
+
+ /**
+ * Return all data from channel for export.
+ */
+ pub async fn channel_export(&self) -> Result<String, Box<dyn std::error::Error>> {
+ Ok(self.get("channel/export/basic").send().await?.text().await?)
+ }
+
+
/// Return a RequestBuilder object that's set up with the correct
/// path and headers for performing a zot api request.