use crate::runtime::{self, Error};
pub struct SharedLinksAppItemsManager {
session: std::sync::Arc<runtime::Client>,
}
impl SharedLinksAppItemsManager {
pub(crate) fn new(session: std::sync::Arc<runtime::Client>) -> Self {
Self { session }
}
pub async fn get_shared_items_app_items(
&self,
boxapi: String,
) -> Result<crate::models::schemas::AppItem, Error> {
let mut url = self.session.base_url("api");
url.push_str("/shared_items");
let mut req = self.session.new_request("GET", &url);
req = runtime::with_header(req, "boxapi", &boxapi);
let resp = self.session.fetch(req).await?;
let data = runtime::response_bytes(&resp)?;
Ok(serde_json::from_slice(&data)?)
}
}