use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "requestid")]
pub r#requestid: Option<i64>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsResultForuser {
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "email")]
pub r#email: Option<String>,
#[serde(rename = "idnumber")]
pub r#idnumber: Option<String>,
#[serde(rename = "phone1")]
pub r#phone1: Option<String>,
#[serde(rename = "phone2")]
pub r#phone2: Option<String>,
#[serde(rename = "department")]
pub r#department: Option<String>,
#[serde(rename = "institution")]
pub r#institution: Option<String>,
#[serde(rename = "fullname")]
pub r#fullname: Option<String>,
#[serde(rename = "identity")]
pub r#identity: Option<String>,
#[serde(rename = "profileurl")]
pub r#profileurl: Option<String>,
#[serde(rename = "profileimageurl")]
pub r#profileimageurl: Option<String>,
#[serde(rename = "profileimageurlsmall")]
pub r#profileimageurlsmall: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsResultRequestedbyuser {
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "email")]
pub r#email: Option<String>,
#[serde(rename = "idnumber")]
pub r#idnumber: Option<String>,
#[serde(rename = "phone1")]
pub r#phone1: Option<String>,
#[serde(rename = "phone2")]
pub r#phone2: Option<String>,
#[serde(rename = "department")]
pub r#department: Option<String>,
#[serde(rename = "institution")]
pub r#institution: Option<String>,
#[serde(rename = "fullname")]
pub r#fullname: Option<String>,
#[serde(rename = "identity")]
pub r#identity: Option<String>,
#[serde(rename = "profileurl")]
pub r#profileurl: Option<String>,
#[serde(rename = "profileimageurl")]
pub r#profileimageurl: Option<String>,
#[serde(rename = "profileimageurlsmall")]
pub r#profileimageurlsmall: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsResultDpouser {
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "email")]
pub r#email: Option<String>,
#[serde(rename = "idnumber")]
pub r#idnumber: Option<String>,
#[serde(rename = "phone1")]
pub r#phone1: Option<String>,
#[serde(rename = "phone2")]
pub r#phone2: Option<String>,
#[serde(rename = "department")]
pub r#department: Option<String>,
#[serde(rename = "institution")]
pub r#institution: Option<String>,
#[serde(rename = "fullname")]
pub r#fullname: Option<String>,
#[serde(rename = "identity")]
pub r#identity: Option<String>,
#[serde(rename = "profileurl")]
pub r#profileurl: Option<String>,
#[serde(rename = "profileimageurl")]
pub r#profileimageurl: Option<String>,
#[serde(rename = "profileimageurlsmall")]
pub r#profileimageurlsmall: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsResult {
#[serde(rename = "type")]
pub r#type: Option<i64>,
#[serde(rename = "comments")]
pub r#comments: Option<String>,
#[serde(rename = "commentsformat")]
pub r#commentsformat: Option<i64>,
#[serde(rename = "userid")]
pub r#userid: Option<i64>,
#[serde(rename = "requestedby")]
pub r#requestedby: Option<i64>,
#[serde(rename = "status")]
pub r#status: Option<i64>,
#[serde(rename = "dpo")]
pub r#dpo: Option<i64>,
#[serde(rename = "dpocomment")]
pub r#dpocomment: Option<String>,
#[serde(rename = "dpocommentformat")]
pub r#dpocommentformat: Option<i64>,
#[serde(rename = "systemapproved")]
pub r#systemapproved: Option<bool>,
#[serde(rename = "creationmethod")]
pub r#creationmethod: Option<i64>,
#[serde(rename = "id")]
pub r#id: Option<i64>,
#[serde(rename = "timecreated")]
pub r#timecreated: Option<i64>,
#[serde(rename = "timemodified")]
pub r#timemodified: Option<i64>,
#[serde(rename = "usermodified")]
pub r#usermodified: Option<i64>,
#[serde(rename = "foruser")]
pub r#foruser: Option<ReturnsResultForuser>,
#[serde(rename = "requestedbyuser")]
pub r#requestedbyuser: Option<ReturnsResultRequestedbyuser>,
#[serde(rename = "dpouser")]
pub r#dpouser: Option<ReturnsResultDpouser>,
#[serde(rename = "messagehtml")]
pub r#messagehtml: Option<String>,
#[serde(rename = "typename")]
pub r#typename: Option<String>,
#[serde(rename = "typenameshort")]
pub r#typenameshort: Option<String>,
#[serde(rename = "statuslabel")]
pub r#statuslabel: Option<String>,
#[serde(rename = "statuslabelclass")]
pub r#statuslabelclass: Option<String>,
#[serde(rename = "canreview")]
pub r#canreview: Option<bool>,
#[serde(rename = "approvedeny")]
pub r#approvedeny: Option<bool>,
#[serde(rename = "canmarkcomplete")]
pub r#canmarkcomplete: Option<bool>,
}
#[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 = "result")]
pub r#result: Option<ReturnsResult>,
#[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_data_request", 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_data_request", params)
.await
}