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 PowerSupply schema describes a power supply unit.  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 PowerSupply {
    #[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(\"#PowerSupply.v1_5_1.PowerSupply\".to_string())"))]
    pub odata_type: models::odata_v4::Type,
    #[serde(rename = "Actions")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub actions: Option<models::power_supply::v1_5_1::Actions>,
    #[serde(rename = "Assembly")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub assembly: Option<models::odata_v4::IdRef>,
    #[serde(rename = "Description")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<models::resource::Description>,
    /// The efficiency ratings of this power supply.
    #[serde(rename = "EfficiencyRatings")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub efficiency_ratings: Option<Vec<models::power_supply::v1_5_1::EfficiencyRating>>,
    /// The URIs of the management interfaces for the upstream electrical source connections for this power supply.
    #[serde(rename = "ElectricalSourceManagerURIs")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub electrical_source_manager_ur_is: Option<Vec<String>>,
    /// The names of the upstream electrical sources, such as circuits or outlets, connected to this power supply.
    #[serde(rename = "ElectricalSourceNames")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub electrical_source_names: Option<Vec<String>>,
    /// The firmware version for this power supply.
    #[serde(rename = "FirmwareVersion")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub firmware_version: Option<String>,
    /// An indication of whether this device can be inserted or removed while the equipment is in operation.
    #[serde(rename = "HotPluggable")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hot_pluggable: Option<bool>,
    #[serde(rename = "Id")]
    #[serde(skip_deserializing)]
    pub id: models::resource::Id,
    #[serde(rename = "InputNominalVoltageType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub input_nominal_voltage_type: Option<models::circuit::NominalVoltageType>,
    /// The input ranges that the power supply can use.
    #[serde(rename = "InputRanges")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub input_ranges: Option<Vec<models::power_supply::v1_5_1::InputRange>>,
    #[serde(rename = "LineInputStatus")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line_input_status: Option<models::power_supply::v1_5_1::LineStatus>,
    #[serde(rename = "Links")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links: Option<models::power_supply::v1_5_1::Links>,
    #[serde(rename = "Location")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location: Option<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 power supply.
    #[serde(rename = "Manufacturer")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub manufacturer: Option<String>,
    #[serde(rename = "Metrics")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metrics: Option<models::odata_v4::IdRef>,
    /// The model number for this power supply.
    #[serde(rename = "Model")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub model: Option<String>,
    #[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>,
    #[serde(rename = "OutputNominalVoltageType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub output_nominal_voltage_type: Option<models::circuit::NominalVoltageType>,
    /// The output power rails provided by this power supply.
    #[serde(rename = "OutputRails")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub output_rails: Option<Vec<models::power_supply::v1_5_1::OutputRail>>,
    /// The part number for this power supply.
    #[serde(rename = "PartNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub part_number: Option<String>,
    #[serde(rename = "PhaseWiringType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub phase_wiring_type: Option<models::circuit::PhaseWiringType>,
    #[serde(rename = "PlugType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub plug_type: Option<models::circuit::PlugType>,
    /// The maximum capacity of this power supply.
    #[serde(rename = "PowerCapacityWatts")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub power_capacity_watts: Option<f64>,
    #[serde(rename = "PowerSupplyType")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub power_supply_type: Option<models::power_supply::v1_5_1::PowerSupplyType>,
    /// The production or manufacturing date of this power supply.
    #[serde(rename = "ProductionDate")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub production_date: Option<String>,
    /// An indication of whether this component can be independently replaced as allowed by the vendor's replacement policy.
    #[serde(rename = "Replaceable")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replaceable: Option<bool>,
    /// The serial number for this power supply.
    #[serde(rename = "SerialNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub serial_number: Option<String>,
    /// The spare part number for this power supply.
    #[serde(rename = "SparePartNumber")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub spare_part_number: Option<String>,
    #[serde(rename = "Status")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<models::resource::Status>,
    /// The hardware version of this power supply.
    #[serde(rename = "Version")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

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