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 usage and health statistics for a drive.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct DriveMetrics {
    #[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(\"#DriveMetrics.v1_0_0.DriveMetrics\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::drive_metrics::v1_0_0::Actions>,
    /// The total number of bad blocks reported by the drive.
    #[serde(rename = "BadBlockCount")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bad_block_count: Option<i64>,
    /// The number of the correctable read errors for the lifetime of the drive.
    #[serde(rename = "CorrectableIOReadErrorCount")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub correctable_io_read_error_count: Option<i64>,
    /// The number of the correctable write errors for the lifetime of the drive.
    #[serde(rename = "CorrectableIOWriteErrorCount")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub correctable_io_write_error_count: Option<i64>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    #[serde(rename = "NVMeSMART")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub nvme_smart: Option<models::storage_controller_metrics::NVMeSMARTMetrics>,
    #[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 number of power-on hours for the lifetime of the drive.
    #[serde(rename = "PowerOnHours")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub power_on_hours: Option<f64>,
    /// The number of the uncorrectable read errors for the lifetime of the drive.
    #[serde(rename = "UncorrectableIOReadErrorCount")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uncorrectable_io_read_error_count: Option<i64>,
    /// The number of the uncorrectable write errors for the lifetime of the drive.
    #[serde(rename = "UncorrectableIOWriteErrorCount")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uncorrectable_io_write_error_count: Option<i64>,
}

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