Skip to content

Commit

Permalink
fix: force passing time_workload for cloud usage as a single float nu…
Browse files Browse the repository at this point in the history
…mber.

This is a workaround against code generation issue #6
  • Loading branch information
demeringo committed Oct 18, 2022
1 parent d164589 commit 75b344d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/usage_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ pub struct UsageCloud {
pub years_life_time: Option<f32>,
#[serde(rename = "hours_electrical_consumption", skip_serializing_if = "Option::is_none")]
pub hours_electrical_consumption: Option<f32>,
// Temporary workaround until better fix: force time_workload as a float (instead of generated code that is not usable)
// In practice, this limits the use of API: we can only query API by passing an average CPU load for the entire duration of the usage.
// See https://github.com/Boavizta/boaviztapi-sdk-rust/issues/6
#[serde(rename = "time_workload", skip_serializing_if = "Option::is_none")]
pub time_workload: Option<Box<crate::models::TimeWorkload>>,
pub time_workload: Option<f32>,
#[serde(rename = "usage_location", skip_serializing_if = "Option::is_none")]
pub usage_location: Option<String>,
#[serde(rename = "gwp_factor", skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 75b344d

Please sign in to comment.