#[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize, Default)] #[serde(default)] pub struct Machine { /// Name of the machine, should not be null #[serde(rename = "MachineName")] pub machine_name: String, /// technical identifier of the machine, should not be null #[serde(rename = "MachineIdentifier")] pub machine_identifier: i32, /// Date of the last update of this machine #[serde(with = "chrono::naive::serde::ts_microseconds")] #[serde(rename = "UpdateDate")] pub update_date: chrono::NaiveDateTime, /// Content is null when the machine structure has not been validated #[serde(rename = "Content")] pub content: crate::com::my_site::machines::MachineContent, } impl Machine {} #[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize, Default)] #[serde(default)] pub struct MachineContent { #[serde(rename = "Description")] pub description: Option, #[serde(rename = "Length")] pub length: Option, #[serde(rename = "Width")] pub width: Option, #[serde(rename = "Height")] pub height: Option, #[serde(rename = "Parameters")] pub parameters: Option>, #[serde(rename = "Subsets")] pub subsets: Option>, } impl MachineContent {} #[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize, Default)] pub enum OverrideMode { #[default] Locked, WithPermission, Free, } #[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize, Default)] #[serde(default)] pub struct Parameter { #[serde(rename = "Tag")] pub tag: Option, #[serde(rename = "Name")] pub name: String, /// Parameter technical identfier #[serde(rename = "Identifier")] pub identifier: i32, #[serde(rename = "UnitOfMeasurement")] #[serde(default = "Parameter::default_unit_of_measurement")] pub unit_of_measurement: Option, /// Contains the value of the parameter in double type #[serde(rename = "Value")] pub value: Option, #[serde(rename = "OverrideMode")] pub override_mode: crate::com::my_site::machines::OverrideMode, } impl Parameter { #[inline(always)] pub fn default_unit_of_measurement() -> Option { None } } #[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize, Default)] #[serde(default)] pub struct Subset { #[serde(rename = "Name")] pub name: String, /// Technical identifier, unique in the structure of the machine. #[serde(rename = "Identifier")] pub identifier: Option, #[serde(rename = "Parameters")] pub parameters: Option>, #[serde(rename = "Subsets")] pub subsets: Option>, } impl Subset {}