use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "pageid")]
pub r#pageid: Option<i64>,
#[serde(rename = "section")]
pub r#section: Option<String>,
#[serde(rename = "lockonly")]
pub r#lockonly: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsPagesectionWarningsItem {
#[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#ReturnsPagesectionWarnings = Vec<ReturnsPagesectionWarningsItem>;
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsPagesection {
#[serde(rename = "content")]
pub r#content: Option<String>,
#[serde(rename = "contentformat")]
pub r#contentformat: Option<String>,
#[serde(rename = "version")]
pub r#version: Option<i64>,
#[serde(rename = "warnings")]
pub r#warnings: Option<r#ReturnsPagesectionWarnings>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Returns {
#[serde(rename = "pagesection")]
pub r#pagesection: Option<ReturnsPagesection>,
}
pub async fn call<'a>(
client: &'a mut moodle_client::MoodleClient,
params: &'a mut Params,
) -> anyhow::Result<Returns> {
let json = client.post("mod_wiki_get_page_for_editing", 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_wiki_get_page_for_editing", params).await
}