J.A.R.V.I.S-py/app/src/commands/structs.rs

47 lines
810 B
Rust
Raw Normal View History

2023-04-27 00:28:36 +05:00
use serde::Deserialize;
use std::path::PathBuf;
#[derive(Debug)]
pub struct AssistantCommand {
pub path: PathBuf,
pub commands: CommandsList,
}
#[derive(Deserialize, Debug)]
pub struct CommandsList {
pub list: Vec<Config>,
}
#[derive(Deserialize, Debug)]
pub struct Config {
pub command: ConfigCommandSection,
2023-05-01 04:24:06 +05:00
2023-04-27 00:28:36 +05:00
pub voice: ConfigVoiceSection,
2023-05-01 04:24:06 +05:00
2023-04-27 00:28:36 +05:00
pub phrases: Vec<String>,
}
#[derive(Deserialize, Debug)]
pub struct ConfigCommandSection {
pub action: String,
2023-05-01 04:24:06 +05:00
#[serde(default)]
2023-04-27 00:28:36 +05:00
pub exe_path: String,
2023-05-01 04:24:06 +05:00
#[serde(default)]
2023-04-27 00:28:36 +05:00
pub exe_args: Vec<String>,
2023-05-01 04:24:06 +05:00
#[serde(default)]
pub cli_cmd: String,
#[serde(default)]
pub cli_args: Vec<String>
2023-04-27 00:28:36 +05:00
}
#[derive(Deserialize, Debug)]
pub struct ConfigVoiceSection {
2023-05-01 04:24:06 +05:00
#[serde(default)]
2023-04-27 00:28:36 +05:00
pub sounds: Vec<String>,
}