use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "includeinherit")]
pub r#includeinherit: Option<bool>,
#[serde(rename = "includenotset")]
pub r#includenotset: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsOptionsItem {
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "name")]
pub r#name: Option<String>,
}
pub type r#ReturnsOptions = Vec<ReturnsOptionsItem>;
#[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 = "options")]
pub r#options: Option<r#ReturnsOptions>,
#[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("tool_dataprivacy_get_purpose_options", 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("tool_dataprivacy_get_purpose_options", params)
.await
}