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 Drive schema represents a single physical drive for a system, including links to associated volumes.  It also describes the location, such as a slot, socket, or bay, where a unit can be installed, by populating a resource instance with an absent state if a unit is not present.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct Drive {
    #[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(\"#Drive.v1_17_0.Drive\".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::v1_17_0::Actions>,
    #[serde(rename = "Assembly")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub assembly: Option<models::odata_v4::IdRef>,
    /// The user-assigned asset tag for this drive.
    #[serde(rename = "AssetTag")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub asset_tag: Option<String>,
    /// The size, in bytes, of the smallest addressable unit, or block.
    #[serde(rename = "BlockSizeBytes")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub block_size_bytes: Option<i64>,
    /// The speed, in gigabit per second (Gbit/s), at which this drive can communicate to a storage controller in ideal conditions.
    #[serde(rename = "CapableSpeedGbs")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub capable_speed_gbs: Option<f64>,
    /// The size, in bytes, of this drive.
    #[serde(rename = "CapacityBytes")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub capacity_bytes: Option<i64>,
    #[serde(rename = "Certificates")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub certificates: Option<models::odata_v4::IdRef>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    #[serde(rename = "DriveFormFactor")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub drive_form_factor: Option<models::drive::v1_17_0::FormFactor>,
    #[serde(rename = "EncryptionAbility")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption_ability: Option<models::drive::v1_17_0::EncryptionAbility>,
    #[serde(rename = "EncryptionStatus")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption_status: Option<models::drive::v1_17_0::EncryptionStatus>,
    #[serde(rename = "EnvironmentMetrics")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub environment_metrics: Option<models::odata_v4::IdRef>,
    /// An indication of whether this drive currently predicts a failure in the near future.
    #[serde(rename = "FailurePredicted")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub failure_predicted: Option<bool>,
    /// The firmware version for this drive.
    #[serde(rename = "FirmwareVersion")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub firmware_version: Option<String>,
    #[serde(rename = "HotspareReplacementMode")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hotspare_replacement_mode: Option<models::drive::v1_17_0::HotspareReplacementModeType>,
    #[serde(rename = "HotspareType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hotspare_type: Option<models::drive::v1_17_0::HotspareType>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    /// The durable names for the drive.
    #[serde(rename = "Identifiers")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub identifiers: Option<Vec<models::resource::Identifier>>,
    #[serde(rename = "IndicatorLED")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indicator_led: Option<models::resource::IndicatorLED>,
    #[serde(rename = "Links")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links: Option<models::drive::v1_17_0::Links>,
    /// The location of the drive.
    #[serde(rename = "Location")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location: Option<Vec<models::resource::Location>>,
    /// An indicator allowing an operator to physically locate this resource.
    #[serde(rename = "LocationIndicatorActive")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location_indicator_active: Option<bool>,
    /// The manufacturer of this drive.
    #[serde(rename = "Manufacturer")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub manufacturer: Option<String>,
    /// An array of DSP0274-defined measurement blocks.
    #[serde(rename = "Measurements")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub measurements: Option<Vec<models::software_inventory::MeasurementBlock>>,
    #[serde(rename = "MediaType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub media_type: Option<models::drive::v1_17_0::MediaType>,
    #[serde(rename = "Metrics")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metrics: Option<models::odata_v4::IdRef>,
    /// The model number for the drive.
    #[serde(rename = "Model")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    /// An indication of whether the drive is accessible from multiple paths.
    #[serde(rename = "Multipath")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub multipath: Option<bool>,
    #[serde(rename = "Name")]
    #[serde(skip_deserializing)]
    pub name: models::resource::Name,
    /// The speed, in gigabit per second (Gbit/s), at which this drive currently communicates to the storage controller.
    #[serde(rename = "NegotiatedSpeedGbs")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub negotiated_speed_gbs: Option<f64>,
    #[serde(rename = "Oem")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub oem: Option<models::resource::Oem>,
    /// The operations currently running on the Drive.
    #[serde(rename = "Operations")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub operations: Option<Vec<models::drive::v1_17_0::Operations>>,
    /// The part number for this drive.
    #[serde(rename = "PartNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub part_number: Option<String>,
    #[serde(rename = "PhysicalLocation")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub physical_location: Option<models::resource::Location>,
    /// The percentage of reads and writes that are predicted to be available for the media.
    #[serde(rename = "PredictedMediaLifeLeftPercent")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub predicted_media_life_left_percent: Option<f64>,
    #[serde(rename = "Protocol")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub protocol: Option<models::protocol::Protocol>,
    /// An indication of whether the drive is prepared by the system for removal.
    #[serde(rename = "ReadyToRemove")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ready_to_remove: Option<bool>,
    /// The revision of this drive.  For SCSI-based drives, this is the version of the drive from the 'Inquiry' command, which can be the firmware or hardware version.  For other types of drives, this is the hardware version.
    #[serde(rename = "Revision")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub revision: Option<String>,
    /// The rotation speed of this drive, in revolutions per minute (RPM).
    #[serde(rename = "RotationSpeedRPM")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rotation_speed_rpm: Option<f64>,
    /// The SKU for this drive.
    #[serde(rename = "SKU")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sku: Option<String>,
    /// The serial number for this drive.
    #[serde(rename = "SerialNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub serial_number: Option<String>,
    /// The drive protocols capable in this slot.
    #[serde(rename = "SlotCapableProtocols")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub slot_capable_protocols: Option<Vec<models::protocol::Protocol>>,
    #[serde(rename = "SlotFormFactor")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub slot_form_factor: Option<models::drive::v1_17_0::FormFactor>,
    #[serde(rename = "Status")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<models::resource::Status>,
    #[serde(rename = "StatusIndicator")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status_indicator: Option<models::drive::v1_17_0::StatusIndicator>,
    /// An indication of whether the drive write cache is enabled.
    #[serde(rename = "WriteCacheEnabled")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub write_cache_enabled: Option<bool>,
}

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