redfish_codegen/models/battery/v1_2_1/
battery.rs

1// Generated by redfish-codegen. Do not modify.
2
3use crate::models;
4
5/// The Battery schema describes a battery unit, such as those used to provide systems with power during a power loss event.  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.
6#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
7#[derive(derivative::Derivative)]
8#[derivative(Default)]
9pub struct Battery {
10    #[serde(rename = "@odata.context")]
11    #[serde(skip_deserializing)]
12    #[serde(default, skip_serializing_if = "Option::is_none")]
13    pub odata_context: Option<models::odata_v4::Context>,
14    #[serde(rename = "@odata.etag")]
15    #[serde(skip_deserializing)]
16    #[serde(default, skip_serializing_if = "Option::is_none")]
17    pub odata_etag: Option<models::odata_v4::Etag>,
18    #[serde(rename = "@odata.id")]
19    #[serde(skip_deserializing)]
20    pub odata_id: models::odata_v4::Id,
21    #[serde(rename = "@odata.type")]
22    #[serde(skip_deserializing)]
23    #[derivative(Default(value = "models::odata_v4::Type(\"#Battery.v1_2_1.Battery\".to_string())"))]
24    pub odata_type: models::odata_v4::Type,
25    #[serde(rename = "Actions")]
26    #[serde(default, skip_serializing_if = "Option::is_none")]
27    pub actions: Option<models::battery::v1_2_1::Actions>,
28    #[serde(rename = "Assembly")]
29    #[serde(default, skip_serializing_if = "Option::is_none")]
30    pub assembly: Option<models::odata_v4::IdRef>,
31    /// The actual maximum capacity of this battery in amp-hours.
32    #[serde(rename = "CapacityActualAmpHours")]
33    #[serde(default, skip_serializing_if = "Option::is_none")]
34    pub capacity_actual_amp_hours: Option<f64>,
35    /// The actual maximum capacity of this battery in watt-hours.
36    #[serde(rename = "CapacityActualWattHours")]
37    #[serde(default, skip_serializing_if = "Option::is_none")]
38    pub capacity_actual_watt_hours: Option<f64>,
39    /// The rated maximum capacity of this battery in amp-hours.
40    #[serde(rename = "CapacityRatedAmpHours")]
41    #[serde(default, skip_serializing_if = "Option::is_none")]
42    pub capacity_rated_amp_hours: Option<f64>,
43    /// The rated maximum capacity of this battery in watt-hours.
44    #[serde(rename = "CapacityRatedWattHours")]
45    #[serde(default, skip_serializing_if = "Option::is_none")]
46    pub capacity_rated_watt_hours: Option<f64>,
47    #[serde(rename = "ChargeState")]
48    #[serde(default, skip_serializing_if = "Option::is_none")]
49    pub charge_state: Option<models::battery::v1_2_1::ChargeState>,
50    #[serde(rename = "Description")]
51    #[serde(default, skip_serializing_if = "Option::is_none")]
52    pub description: Option<models::resource::Description>,
53    /// The firmware version for this battery.
54    #[serde(rename = "FirmwareVersion")]
55    #[serde(default, skip_serializing_if = "Option::is_none")]
56    pub firmware_version: Option<String>,
57    /// An indication of whether this device can be inserted or removed while the equipment is in operation.
58    #[serde(rename = "HotPluggable")]
59    #[serde(default, skip_serializing_if = "Option::is_none")]
60    pub hot_pluggable: Option<bool>,
61    #[serde(rename = "Id")]
62    #[serde(skip_deserializing)]
63    pub id: models::resource::Id,
64    #[serde(rename = "Links")]
65    #[serde(default, skip_serializing_if = "Option::is_none")]
66    pub links: Option<models::battery::v1_2_1::Links>,
67    #[serde(rename = "Location")]
68    #[serde(default, skip_serializing_if = "Option::is_none")]
69    pub location: Option<models::resource::Location>,
70    /// An indicator allowing an operator to physically locate this resource.
71    #[serde(rename = "LocationIndicatorActive")]
72    #[serde(default, skip_serializing_if = "Option::is_none")]
73    pub location_indicator_active: Option<bool>,
74    /// The manufacturer of this battery.
75    #[serde(rename = "Manufacturer")]
76    #[serde(default, skip_serializing_if = "Option::is_none")]
77    pub manufacturer: Option<String>,
78    /// The maximum charge rate of this battery in amps.
79    #[serde(rename = "MaxChargeRateAmps")]
80    #[serde(default, skip_serializing_if = "Option::is_none")]
81    pub max_charge_rate_amps: Option<f64>,
82    /// The maximum charge voltage of this battery.
83    #[serde(rename = "MaxChargeVoltage")]
84    #[serde(default, skip_serializing_if = "Option::is_none")]
85    pub max_charge_voltage: Option<f64>,
86    /// The maximum discharge rate of this battery in amps.
87    #[serde(rename = "MaxDischargeRateAmps")]
88    #[serde(default, skip_serializing_if = "Option::is_none")]
89    pub max_discharge_rate_amps: Option<f64>,
90    #[serde(rename = "Metrics")]
91    #[serde(default, skip_serializing_if = "Option::is_none")]
92    pub metrics: Option<models::odata_v4::IdRef>,
93    /// The model number for this battery.
94    #[serde(rename = "Model")]
95    #[serde(default, skip_serializing_if = "Option::is_none")]
96    pub model: Option<String>,
97    #[serde(rename = "Name")]
98    #[serde(skip_deserializing)]
99    pub name: models::resource::Name,
100    #[serde(rename = "Oem")]
101    #[serde(default, skip_serializing_if = "Option::is_none")]
102    pub oem: Option<models::resource::Oem>,
103    /// The part number for this battery.
104    #[serde(rename = "PartNumber")]
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub part_number: Option<String>,
107    /// The production or manufacturing date of this battery.
108    #[serde(rename = "ProductionDate")]
109    #[serde(default, skip_serializing_if = "Option::is_none")]
110    pub production_date: Option<String>,
111    /// An indication of whether this component can be independently replaced as allowed by the vendor's replacement policy.
112    #[serde(rename = "Replaceable")]
113    #[serde(default, skip_serializing_if = "Option::is_none")]
114    pub replaceable: Option<bool>,
115    /// The serial number for this battery.
116    #[serde(rename = "SerialNumber")]
117    #[serde(default, skip_serializing_if = "Option::is_none")]
118    pub serial_number: Option<String>,
119    /// The spare part number for this battery.
120    #[serde(rename = "SparePartNumber")]
121    #[serde(default, skip_serializing_if = "Option::is_none")]
122    pub spare_part_number: Option<String>,
123    #[serde(rename = "StateOfHealthPercent")]
124    #[serde(default, skip_serializing_if = "Option::is_none")]
125    pub state_of_health_percent: Option<models::sensor::SensorExcerpt>,
126    #[serde(rename = "Status")]
127    #[serde(default, skip_serializing_if = "Option::is_none")]
128    pub status: Option<models::resource::Status>,
129    /// The hardware version of this battery.
130    #[serde(rename = "Version")]
131    #[serde(default, skip_serializing_if = "Option::is_none")]
132    pub version: Option<String>,
133}
134
135impl crate::Metadata<'static> for Battery {
136    const JSON_SCHEMA: &'static str = "Battery.v1_2_1.json";
137}