#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExtendedPredictionUsername {
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "predictions", skip_serializing_if = "Option::is_none")]
pub predictions: Option<Vec<::std::collections::HashMap<String, serde_json::Value>>>,
#[serde(
rename = "points_won",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub points_won: Option<Option<f64>>,
#[serde(rename = "user", deserialize_with = "Option::deserialize")]
pub user: Option<i32>,
#[serde(rename = "question")]
pub question: i32,
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[serde(rename = "username")]
pub username: String,
#[serde(
rename = "log_score",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub log_score: Option<Option<f64>>,
#[serde(
rename = "absolute_log_score",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub absolute_log_score: Option<Option<f64>>,
#[serde(
rename = "coverage",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub coverage: Option<Option<f64>>,
}
impl ExtendedPredictionUsername {
#[must_use]
pub fn new(
id: i32,
user: Option<i32>,
question: i32,
username: String,
) -> ExtendedPredictionUsername {
ExtendedPredictionUsername {
id,
predictions: None,
points_won: None,
user,
question,
active: None,
username,
log_score: None,
absolute_log_score: None,
coverage: None,
}
}
}