metaculus/models/
sub_question_user_list.rs

1/*
2 * Metaculus API
3 *
4 * Welcome to the unofficial Rust client for the Metaculus API
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: Benjamin Manns <opensource@benmanns.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct SubQuestionUserList {
13    #[serde(rename = "active_state", deserialize_with = "Option::deserialize")]
14    pub active_state: Option<serde_json::Value>,
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "resolution", deserialize_with = "Option::deserialize")]
18    pub resolution: Option<f64>,
19    #[serde(rename = "publish_time", skip_serializing_if = "Option::is_none")]
20    pub publish_time: Option<String>,
21    #[serde(rename = "close_time", skip_serializing_if = "Option::is_none")]
22    pub close_time: Option<String>,
23    #[serde(
24        rename = "effected_close_time",
25        deserialize_with = "Option::deserialize"
26    )]
27    pub effected_close_time: Option<String>,
28    #[serde(rename = "resolve_time", skip_serializing_if = "Option::is_none")]
29    pub resolve_time: Option<String>,
30    #[serde(rename = "possibilities", skip_serializing_if = "Option::is_none")]
31    pub possibilities: Option<::std::collections::HashMap<String, serde_json::Value>>,
32    #[serde(rename = "sub_question_label", skip_serializing_if = "Option::is_none")]
33    pub sub_question_label: Option<String>,
34    #[serde(
35        rename = "metaculus_prediction",
36        deserialize_with = "Option::deserialize"
37    )]
38    pub metaculus_prediction: Option<serde_json::Value>,
39    #[serde(
40        rename = "community_prediction",
41        deserialize_with = "Option::deserialize"
42    )]
43    pub community_prediction: Option<serde_json::Value>,
44    #[serde(rename = "conditioned_on_resolution")]
45    pub conditioned_on_resolution: f64,
46    #[serde(rename = "cp_reveal_time", skip_serializing_if = "Option::is_none")]
47    pub cp_reveal_time: Option<String>,
48    #[serde(rename = "my_predictions")]
49    pub my_predictions: Box<crate::models::Prediction>,
50    #[serde(rename = "user_community_vis")]
51    pub user_community_vis: crate::models::UserCommunityVisEnum,
52}
53
54impl SubQuestionUserList {
55    #[must_use]
56    pub fn new(
57        active_state: Option<serde_json::Value>,
58        id: i32,
59        resolution: Option<f64>,
60        effected_close_time: Option<String>,
61        metaculus_prediction: Option<serde_json::Value>,
62        community_prediction: Option<serde_json::Value>,
63        conditioned_on_resolution: f64,
64        my_predictions: crate::models::Prediction,
65        user_community_vis: crate::models::UserCommunityVisEnum,
66    ) -> SubQuestionUserList {
67        SubQuestionUserList {
68            active_state,
69            id,
70            resolution,
71            publish_time: None,
72            close_time: None,
73            effected_close_time,
74            resolve_time: None,
75            possibilities: None,
76            sub_question_label: None,
77            metaculus_prediction,
78            community_prediction,
79            conditioned_on_resolution,
80            cp_reveal_time: None,
81            my_predictions: Box::new(my_predictions),
82            user_community_vis,
83        }
84    }
85}