use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct Params {
#[serde(rename = "tourid")]
pub r#tourid: Option<i64>,
#[serde(rename = "context")]
pub r#context: Option<i64>,
#[serde(rename = "pageurl")]
pub r#pageurl: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsTourconfigStepsItem {
#[serde(rename = "title")]
pub r#title: Option<String>,
#[serde(rename = "content")]
pub r#content: Option<String>,
#[serde(rename = "element")]
pub r#element: Option<String>,
#[serde(rename = "placement")]
pub r#placement: Option<String>,
#[serde(rename = "delay")]
pub r#delay: Option<i64>,
#[serde(rename = "backdrop")]
pub r#backdrop: Option<bool>,
#[serde(rename = "reflex")]
pub r#reflex: Option<bool>,
#[serde(rename = "orphan")]
pub r#orphan: Option<bool>,
#[serde(rename = "stepid")]
pub r#stepid: Option<i64>,
}
pub type r#ReturnsTourconfigSteps = Vec<ReturnsTourconfigStepsItem>;
#[derive(Serialize, Deserialize, Debug)]
pub struct ReturnsTourconfig {
#[serde(rename = "name")]
pub r#name: Option<String>,
#[serde(rename = "steps")]
pub r#steps: Option<r#ReturnsTourconfigSteps>,
#[serde(rename = "endtourlabel")]
pub r#endtourlabel: Option<String>,
#[serde(rename = "displaystepnumbers")]
pub r#displaystepnumbers: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Returns {
#[serde(rename = "tourconfig")]
pub r#tourconfig: Option<ReturnsTourconfig>,
}
pub async fn call<'a>(
client: &'a mut moodle_client::MoodleClient,
params: &'a mut Params,
) -> anyhow::Result<Returns> {
let json = client
.post("tool_usertours_fetch_and_start_tour", 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_usertours_fetch_and_start_tour", params)
.await
}