Skip to content

Commit e9ab88a

Browse files
feat: replace strings with enums for co2eIntensityThroughput
1 parent f36e55b commit e9ab88a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

gen/src/lib.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,19 @@ pub struct Toc {
110110
pub co2e_intensity_wtw: WrappedDecimal,
111111
#[serde(rename = "co2eIntensityTTW")]
112112
pub co2e_intensity_ttw: WrappedDecimal,
113-
pub co2e_intensity_throughput: String,
113+
pub co2e_intensity_throughput: TocCo2eIntensityThroughput,
114114
#[serde(skip_serializing_if = "Option::is_none")]
115115
pub glec_data_quality_index: Option<GlecDataQualityIndex>,
116116
}
117117

118+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, PartialEq)]
119+
#[serde(rename_all = "camelCase")]
120+
pub enum TocCo2eIntensityThroughput {
121+
#[serde(rename = "TEUkm")]
122+
TEUkm,
123+
Tkm,
124+
}
125+
118126
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, PartialEq)]
119127
#[serde(rename_all = "camelCase")]
120128
pub enum TemperatureControl {
@@ -180,6 +188,14 @@ pub struct Hoc {
180188
pub co2e_intensity_throughput: String,
181189
}
182190

191+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, PartialEq)]
192+
#[serde(rename_all = "camelCase")]
193+
pub enum HocCo2eIntensityThroughput {
194+
#[serde(rename = "TEU")]
195+
TEU,
196+
Tonnes,
197+
}
198+
183199
#[derive(Debug, Serialize, Deserialize, JsonSchema, PartialEq, Clone)]
184200
#[serde(rename_all = "camelCase")]
185201
pub enum HubType {

0 commit comments

Comments
 (0)