use serde::{self, Deserialize, Serialize};
pub type r#ParamsNotes = Vec<i64>;
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "notes")]
pub r#notes: Option<r#ParamsNotes>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsNotesItem {
#[serde(rename = "noteid")]
pub r#noteid: Option<i64>,
#[serde(rename = "userid")]
pub r#userid: Option<i64>,
#[serde(rename = "publishstate")]
pub r#publishstate: Option<String>,
#[serde(rename = "courseid")]
pub r#courseid: Option<i64>,
#[serde(rename = "text")]
pub r#text: Option<String>,
#[serde(rename = "format")]
pub r#format: Option<i64>,
}
pub type r#ReturnsNotes = Vec<ReturnsNotesItem>;
#[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 = "notes")]
pub r#notes: Option<r#ReturnsNotes>,
#[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("core_notes_get_notes", 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("core_notes_get_notes", params).await
}