#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CommentUpdate {
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "author", deserialize_with = "Option::deserialize")]
pub author: Option<i32>,
#[serde(rename = "author_name", deserialize_with = "Option::deserialize")]
pub author_name: Option<String>,
#[serde(rename = "author_lvl", deserialize_with = "Option::deserialize")]
pub author_lvl: Option<serde_json::Value>,
#[serde(rename = "author_supporter_lvl")]
pub author_supporter_lvl: i32,
#[serde(rename = "is_deactivated")]
pub is_deactivated: bool,
#[serde(rename = "is_moderator")]
pub is_moderator: bool,
#[serde(rename = "is_admin")]
pub is_admin: bool,
#[serde(rename = "question")]
pub question: String,
#[serde(rename = "comment_html")]
pub comment_html: String,
#[serde(rename = "comment_text")]
pub comment_text: String,
#[serde(rename = "created_time")]
pub created_time: String,
#[serde(rename = "prediction_value", deserialize_with = "Option::deserialize")]
pub prediction_value: Option<::std::collections::HashMap<String, serde_json::Value>>,
#[serde(rename = "submit_type", skip_serializing_if = "Option::is_none")]
pub submit_type: Option<crate::models::SubmitTypeEnum>,
#[serde(rename = "preview", skip_serializing_if = "Option::is_none")]
pub preview: Option<bool>,
#[serde(
rename = "parent",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub parent: Option<Option<i32>>,
#[serde(rename = "num_children")]
pub num_children: i32,
#[serde(rename = "num_likes", deserialize_with = "Option::deserialize")]
pub num_likes: Option<i32>,
#[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
pub deleted: Option<bool>,
#[serde(rename = "parent_author", deserialize_with = "Option::deserialize")]
pub parent_author: Option<String>,
#[serde(rename = "user_like")]
pub user_like: i32,
#[serde(rename = "user_like_at")]
pub user_like_at: String,
#[serde(
rename = "latest_prediction",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub latest_prediction: Option<Option<::std::collections::HashMap<String, serde_json::Value>>>,
#[serde(
rename = "include_latest_prediction",
skip_serializing_if = "Option::is_none"
)]
pub include_latest_prediction: Option<bool>,
#[serde(rename = "edits")]
pub edits: ::std::collections::HashMap<String, serde_json::Value>,
}
impl CommentUpdate {
#[must_use]
pub fn new(
url: String,
id: i32,
author: Option<i32>,
author_name: Option<String>,
author_lvl: Option<serde_json::Value>,
author_supporter_lvl: i32,
is_deactivated: bool,
is_moderator: bool,
is_admin: bool,
question: String,
comment_html: String,
comment_text: String,
created_time: String,
prediction_value: Option<::std::collections::HashMap<String, serde_json::Value>>,
num_children: i32,
num_likes: Option<i32>,
parent_author: Option<String>,
user_like: i32,
user_like_at: String,
edits: ::std::collections::HashMap<String, serde_json::Value>,
) -> CommentUpdate {
CommentUpdate {
url,
id,
author,
author_name,
author_lvl,
author_supporter_lvl,
is_deactivated,
is_moderator,
is_admin,
question,
comment_html,
comment_text,
created_time,
prediction_value,
submit_type: None,
preview: None,
parent: None,
num_children,
num_likes,
deleted: None,
parent_author,
user_like,
user_like_at,
latest_prediction: None,
include_latest_prediction: None,
edits,
}
}
}