use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
pub struct AnalogOutput {
    // Allowed Values: ao
    pub dev: String,
    pub circuit: String,
    // Allowed Values: Voltage, Current, Resistance
    pub mode: Option<String>,
    // Allowed Values: Voltage, Current, Resistance
    pub modes: Option<Vec<String>>,
    // minimum: 0
    pub glob_dev_id: u32,
    pub value: i32,
    // Allowed Values: V, mA, Ohm
    pub unit: Option<String>,
    pub alias: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct AnalogOutputInput {
    // minimum: 0
    #[serde(skip_serializing_if = "Option::is_none")]
    pub value: Option<i32>,
    // Allowed Values: Voltage, Current, Resistance
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub alias: Option<String>,
}
