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 Sensor schema describes a sensor and its properties.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct Sensor {
    #[serde(rename = "@odata.context")]
    #[serde(skip_deserializing)]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub odata_context: Option<models::odata_v4::Context>,
    #[serde(rename = "@odata.etag")]
    #[serde(skip_deserializing)]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub odata_etag: Option<models::odata_v4::Etag>,
    #[serde(rename = "@odata.id")]
    #[serde(skip_deserializing)]
    pub odata_id: models::odata_v4::Id,
    #[serde(rename = "@odata.type")]
    #[serde(skip_deserializing)]
    #[derivative(Default(value = "models::odata_v4::Type(\"#Sensor.v1_7_0.Sensor\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    /// The estimated percent error of measured versus actual values.
    #[serde(rename = "Accuracy")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub accuracy: Option<f64>,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::sensor::v1_7_0::Actions>,
    /// The adjusted maximum allowable operating value for this equipment based on the environmental conditions.
    #[serde(rename = "AdjustedMaxAllowableOperatingValue")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub adjusted_max_allowable_operating_value: Option<f64>,
    /// The adjusted minimum allowable operating value for this equipment based on the environmental conditions.
    #[serde(rename = "AdjustedMinAllowableOperatingValue")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub adjusted_min_allowable_operating_value: Option<f64>,
    /// The product of voltage and current for an AC circuit, in volt-ampere units.
    #[serde(rename = "ApparentVA")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub apparent_va: Option<f64>,
    /// Apparent energy (kVAh).
    #[serde(rename = "ApparentkVAh")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub apparentk_v_ah: Option<f64>,
    /// The average sensor value.
    #[serde(rename = "AverageReading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub average_reading: Option<f64>,
    /// The interval over which the average sensor value is calculated.
    #[serde(rename = "AveragingInterval")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub averaging_interval: Option<String>,
    /// Indicates that enough readings were collected to calculate the average sensor reading over the averaging interval time.
    #[serde(rename = "AveragingIntervalAchieved")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub averaging_interval_achieved: Option<bool>,
    /// The calibration offset applied to the Reading.
    #[serde(rename = "Calibration")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub calibration: Option<f64>,
    /// The date and time that the sensor was last calibrated.
    #[serde(rename = "CalibrationTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub calibration_time: Option<String>,
    /// The crest factor for this sensor.
    #[serde(rename = "CrestFactor")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub crest_factor: Option<f64>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    #[serde(rename = "ElectricalContext")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub electrical_context: Option<models::sensor::ElectricalContext>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    #[serde(rename = "Implementation")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub implementation: Option<models::sensor::v1_7_0::ImplementationType>,
    /// The total accumulation value for this sensor.
    #[serde(rename = "LifetimeReading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lifetime_reading: Option<f64>,
    #[serde(rename = "Links")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links: Option<models::sensor::v1_7_0::Links>,
    /// The power load utilization for this sensor.
    #[serde(rename = "LoadPercent")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub load_percent: Option<f64>,
    #[serde(rename = "Location")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location: Option<models::resource::Location>,
    /// The lowest sensor value.
    #[serde(rename = "LowestReading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lowest_reading: Option<f64>,
    /// The time when the lowest sensor value occurred.
    #[serde(rename = "LowestReadingTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lowest_reading_time: Option<String>,
    /// The maximum allowable operating value for this equipment.
    #[serde(rename = "MaxAllowableOperatingValue")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub max_allowable_operating_value: Option<f64>,
    /// The minimum allowable operating value for this equipment.
    #[serde(rename = "MinAllowableOperatingValue")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub min_allowable_operating_value: Option<f64>,
    #[serde(rename = "Name")]
    #[serde(skip_deserializing)]
    pub name: models::resource::Name,
    #[serde(rename = "Oem")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem: Option<models::resource::Oem>,
    /// The peak sensor value.
    #[serde(rename = "PeakReading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub peak_reading: Option<f64>,
    /// The time when the peak sensor value occurred.
    #[serde(rename = "PeakReadingTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub peak_reading_time: Option<String>,
    /// The phase angle (degrees) between the current and voltage waveforms.
    #[serde(rename = "PhaseAngleDegrees")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub phase_angle_degrees: Option<f64>,
    #[serde(rename = "PhysicalContext")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub physical_context: Option<models::physical_context::PhysicalContext>,
    #[serde(rename = "PhysicalSubContext")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub physical_sub_context: Option<models::physical_context::PhysicalSubContext>,
    /// The power factor for this sensor.
    #[serde(rename = "PowerFactor")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub power_factor: Option<f64>,
    /// The number of significant digits in the reading.
    #[serde(rename = "Precision")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub precision: Option<f64>,
    /// The square root of the difference term of squared apparent VA and squared power (Reading) for a circuit, in VAR units.
    #[serde(rename = "ReactiveVAR")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reactive_var: Option<f64>,
    /// Reactive energy (kVARh).
    #[serde(rename = "ReactivekVARh")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reactivek_va_rh: Option<f64>,
    /// The sensor value.
    #[serde(rename = "Reading")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading: Option<f64>,
    #[serde(rename = "ReadingBasis")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading_basis: Option<models::sensor::v1_7_0::ReadingBasisType>,
    /// The maximum possible value for this sensor.
    #[serde(rename = "ReadingRangeMax")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading_range_max: Option<f64>,
    /// The minimum possible value for this sensor.
    #[serde(rename = "ReadingRangeMin")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading_range_min: Option<f64>,
    /// The date and time that the reading was acquired from the sensor.
    #[serde(rename = "ReadingTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading_time: Option<String>,
    #[serde(rename = "ReadingType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading_type: Option<models::sensor::v1_7_0::ReadingType>,
    /// The units of the reading and thresholds.
    #[serde(rename = "ReadingUnits")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reading_units: Option<String>,
    /// An array of links to resources or objects that this sensor services.
    #[serde(rename = "RelatedItem")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub related_item: Option<Vec<models::odata_v4::IdRef>>,
    #[serde(rename = "RelatedItem@odata.count")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub related_item_odata_count: Option<models::odata_v4::Count>,
    /// The time interval between readings of the physical sensor.
    #[serde(rename = "SensingFrequency")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sensing_frequency: Option<f64>,
    /// The time interval between readings of the sensor.
    #[serde(rename = "SensingInterval")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sensing_interval: Option<String>,
    #[serde(rename = "SensorGroup")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sensor_group: Option<models::redundancy::RedundantGroup>,
    /// The date and time when the time-based properties were last reset.
    #[serde(rename = "SensorResetTime")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sensor_reset_time: Option<String>,
    /// The rotational speed.
    #[serde(rename = "SpeedRPM")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub speed_rpm: Option<f64>,
    #[serde(rename = "Status")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<models::resource::Status>,
    /// The total harmonic distortion (THD).
    #[serde(rename = "THDPercent")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub thd_percent: Option<f64>,
    #[serde(rename = "Thresholds")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub thresholds: Option<models::sensor::v1_7_0::Thresholds>,
    #[serde(rename = "VoltageType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub voltage_type: Option<models::sensor::VoltageType>,
}

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