1use crate::command::InstructionInfo;
3use serde::{Deserialize, Serialize};
4
5#[derive(Deserialize, Serialize, Debug, Clone)]
6pub struct Definition {
7 pub r#type: super::CommandType,
8 pub data: Data,
9 pub sources: Vec<Source>,
10 pub targets: Vec<Target>,
11 #[serde(default)]
12 pub permissions: Permissions,
13}
14
15#[derive(Deserialize, Serialize, Debug, Clone, Default)]
16pub struct Permissions {
17 #[serde(default)]
18 pub user_tokens: bool,
19}
20
21#[derive(Deserialize, Serialize, Debug, Clone)]
22pub struct Data {
23 pub node_id: String,
24 pub instruction_info: Option<InstructionInfo>,
25}
26
27#[derive(Deserialize, Serialize, Debug, Clone)]
28pub struct Source {
29 pub name: String,
30 pub r#type: super::ValueType,
31 #[serde(default = "value::default::bool_false")]
32 pub optional: bool,
33}
34
35#[derive(Deserialize, Serialize, Debug, Clone)]
36pub struct Target {
37 pub name: String,
38 pub type_bounds: Vec<super::ValueType>,
39 pub required: bool,
40 pub passthrough: bool,
41}