fastcomments_sdk/client/src/models/
save_comment_response.rs

1/*
2 * fastcomments
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::client::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SaveCommentResponse {
16    #[serde(rename = "status")]
17    pub status: models::ApiStatus,
18    #[serde(rename = "comment")]
19    pub comment: Box<models::FComment>,
20    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
21    pub user: Option<Box<models::UserSessionInfo>>,
22    /// Construct a type with a set of properties K of type T
23    #[serde(rename = "moduleData", skip_serializing_if = "Option::is_none")]
24    pub module_data: Option<std::collections::HashMap<String, serde_json::Value>>,
25}
26
27impl SaveCommentResponse {
28    pub fn new(status: models::ApiStatus, comment: models::FComment, user: Option<models::UserSessionInfo>) -> SaveCommentResponse {
29        SaveCommentResponse {
30            status,
31            comment: Box::new(comment),
32            user: if let Some(x) = user {Some(Box::new(x))} else {None},
33            module_data: None,
34        }
35    }
36}
37