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;

/// This PowerSubsystem schema contains the definition for the power subsystem of a chassis.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[derive(derivative::Derivative)]
#[derivative(Default)]
pub struct PowerSubsystem {
    #[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(\"#PowerSubsystem.v1_1_0.PowerSubsystem\".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_subsystem::v1_1_0::Actions>,
    #[serde(rename = "Allocation")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub allocation: Option<models::power_subsystem::v1_1_0::PowerAllocation>,
    #[serde(rename = "Batteries")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub batteries: Option<models::odata_v4::IdRef>,
    /// The total amount of power that can be allocated to this subsystem.  This value can be either the power supply capacity or the power budget that an upstream chassis assigns to this subsystem.
    #[serde(rename = "CapacityWatts")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub capacity_watts: Option<f64>,
    #[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 = "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 = "PowerSupplies")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub power_supplies: Option<models::odata_v4::IdRef>,
    /// The redundancy information for the set of power supplies in this subsystem.
    #[serde(rename = "PowerSupplyRedundancy")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub power_supply_redundancy: Option<Vec<models::redundancy::RedundantGroup>>,
    #[serde(rename = "Status")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<models::resource::Status>,
}

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