use crate::api_client::ApiClient;
use crate::error::ResultApi;
use crate::model::SubscriptionsResponse;
impl ApiClient {
pub async fn get_user_subscriptions(
&self,
limit: Option<u32>,
with_follow: Option<bool>,
) -> ResultApi<SubscriptionsResponse> {
let mut path = "user/subscriptions".to_string();
let mut params = Vec::new();
if let Some(l) = limit {
params.push(format!("limit={l}"));
}
if let Some(f) = with_follow {
params.push(format!("with_follow={f}"));
}
if !params.is_empty() {
path.push('?');
path.push_str(¶ms.join("&"));
}
let response = self.get_request(&path).await?;
let response = self.handle_response(&path, response).await?;
self.parse_json(response).await
}
}