use crate::client::{Client, decode_response};
use crate::errors::Error;
use crate::types::*;
impl Client {
pub async fn list_users(&self, opts: Option<&QueryOptions>) -> Result<UserPrefsArray, Error> {
let path = "/search/users";
let resp = self.send_get(&path, opts).await?;
decode_response(resp).await
}
pub async fn get_authenticated(&self) -> Result<User, Error> {
let path = "/user";
let resp = self.send_get(&path, None).await?;
decode_response(resp).await
}
pub async fn get_users(&self, account_id: f64) -> Result<User, Error> {
let path = format!("/user/{}", account_id);
let resp = self.send_get(&path, None).await?;
decode_response(resp).await
}
pub async fn get_by_username(&self, username: &str) -> Result<User, Error> {
let path = format!("/users/{}", username);
let resp = self.send_get(&path, None).await?;
decode_response(resp).await
}
}