use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct ParamsOptions {
#[serde(rename = "includenotapproved")]
pub r#includenotapproved: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "from")]
pub r#from: Option<i64>,
#[serde(rename = "limit")]
pub r#limit: Option<i64>,
#[serde(rename = "options")]
pub r#options: Option<ParamsOptions>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsAuthorsItem {
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "fullname")]
pub r#fullname: Option<String>,
#[serde(rename = "pictureurl")]
pub r#pictureurl: Option<String>,
}
pub type r#ReturnsAuthors = Vec<ReturnsAuthorsItem>;
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsWarningsItem {
#[serde(rename = "item")]
pub r#item: Option<String>,
#[serde(rename = "itemid")]
pub r#itemid: Option<i64>,
#[serde(rename = "warningcode")]
pub r#warningcode: Option<String>,
#[serde(rename = "message")]
pub r#message: Option<String>,
}
pub type r#ReturnsWarnings = Vec<ReturnsWarningsItem>;
#[derive(Serialize, Deserialize, Debug)]
pub struct Returns {
#[serde(rename = "count")]
pub r#count: Option<i64>,
#[serde(rename = "authors")]
pub r#authors: Option<r#ReturnsAuthors>,
#[serde(rename = "warnings")]
pub r#warnings: Option<r#ReturnsWarnings>,
}
pub async fn call<'a>(
client: &'a mut moodle_client::MoodleClient,
params: &'a mut Params,
) -> anyhow::Result<Returns> {
let json = client.post("mod_glossary_get_authors", params).await?;
serde_json::from_value(json).map_err(|e| e.into())
}
pub async fn call_raw<'a>(
client: &'a mut moodle_client::MoodleClient,
params: &'a mut Params,
) -> anyhow::Result<serde_json::Value> {
client.post("mod_glossary_get_authors", params).await
}