add tests to api
This commit is contained in:
@@ -11,25 +11,25 @@ pub struct CommandParameterDefinition {
|
||||
pub data_type: DataType,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CommandDefinition {
|
||||
pub name: String,
|
||||
pub parameters: Vec<CommandParameterDefinition>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CommandHeader {
|
||||
pub timestamp: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Command {
|
||||
#[serde(flatten)]
|
||||
pub header: CommandHeader,
|
||||
pub parameters: HashMap<String, DataValue>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[derive(Debug, PartialEq, Eq, Error)]
|
||||
pub enum IntoCommandDefinitionError {
|
||||
#[error("Parameter Missing: {0}")]
|
||||
ParameterMissing(String),
|
||||
|
||||
Reference in New Issue
Block a user