redfish-codegen 0.3.1

An unopinionated translation of the Redfish specification into Rust.
Documentation
// Generated by redfish-codegen. Do not modify.

use crate::models;

/// The threshold definition for a sensor.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct Threshold {
    #[serde(rename = "Activation")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub activation: Option<models::sensor::v1_7_0::ThresholdActivation>,
    /// The duration the sensor value must violate the threshold before the threshold is activated.
    #[serde(rename = "DwellTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dwell_time: Option<String>,
    /// The duration the sensor value must not violate the threshold before the threshold is deactivated.
    #[serde(rename = "HysteresisDuration")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hysteresis_duration: Option<String>,
    /// The reading offset from the threshold value required to clear the threshold.
    #[serde(rename = "HysteresisReading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hysteresis_reading: Option<f64>,
    /// The threshold value.
    #[serde(rename = "Reading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading: Option<f64>,
}

impl crate::Metadata<'static> for Threshold {
    const JSON_SCHEMA: &'static str = "Sensor.v1_7_0.json";
}