use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "component")]
pub r#component: Option<String>,
#[serde(rename = "itemtype")]
pub r#itemtype: Option<String>,
#[serde(rename = "itemid")]
pub r#itemid: Option<String>,
#[serde(rename = "value")]
pub r#value: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsEditicon {
#[serde(rename = "key")]
pub r#key: Option<String>,
#[serde(rename = "component")]
pub r#component: Option<String>,
#[serde(rename = "title")]
pub r#title: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Returns {
#[serde(rename = "displayvalue")]
pub r#displayvalue: Option<String>,
#[serde(rename = "component")]
pub r#component: Option<String>,
#[serde(rename = "itemtype")]
pub r#itemtype: Option<String>,
#[serde(rename = "value")]
pub r#value: Option<String>,
#[serde(rename = "itemid")]
pub r#itemid: Option<String>,
#[serde(rename = "edithint")]
pub r#edithint: Option<String>,
#[serde(rename = "editlabel")]
pub r#editlabel: Option<String>,
#[serde(rename = "editicon")]
pub r#editicon: Option<ReturnsEditicon>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(rename = "options")]
pub r#options: Option<String>,
#[serde(rename = "linkeverything")]
pub r#linkeverything: Option<i64>,
}
pub async fn call<'a>(
client: &'a mut moodle_client::MoodleClient,
params: &'a mut Params,
) -> anyhow::Result<Returns> {
let json = client.post("core_update_inplace_editable", 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_update_inplace_editable", params).await
}