diff options
Diffstat (limited to 'src/client.rs')
-rw-r--r-- | src/client.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client.rs b/src/client.rs index d5d264a..67c153f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -16,7 +16,7 @@ use crate::{ error::Error, - group::GroupFetcher, + group::{GroupFetcher, GroupMembersFetcher}, item::ItemBuilder, abook::AbookFetcher, abconfig::ABConfigFetcher, @@ -37,6 +37,7 @@ pub const ZOTAPI_ABCONFIG_PATH : &str = "/api/z/1.0/abconfig"; pub const ZOTAPI_CHANNEL_STREAM_PATH : &str = "/api/z/1.0/channel/stream"; pub const ZOTAPI_NETWORK_STREAM_PATH : &str = "/api/z/1.0/network/stream"; pub const ZOTAPI_GROUP_PATH : &str = "/api/z/1.0/group"; +pub const ZOTAPI_GROUP_MEMBERS_PATH : &str = "/api/z/1.0/group_members"; pub const ZOTAPI_ITEM_UPDATE_PATH : &str = "/api/z/1.0/item/update"; pub const ZOTAPI_XCHAN_PATH : &str = "/api/z/1.0/xchan"; @@ -77,6 +78,10 @@ impl Client { GroupFetcher::new(self) } + pub fn group_members(&self) -> GroupMembersFetcher { + GroupMembersFetcher::new(self) + } + pub fn item(&self) -> ItemBuilder { ItemBuilder::new(self) } @@ -100,7 +105,7 @@ impl Client { pub fn fetch_stream<T>(&self, path: &str, args: &T) -> Result<String, Error> where T: Serialize { - let url = self.url(path, args); + let url = dbg!(self.url(path, args)); let mut res = self.inner.get(&url) .header(ACCEPT, "application/json") .basic_auth(self.user.clone(), Some(self.pw.clone())) |