//! # Conversation refresh result //! //! Note : this structure is now deprecated and should no longer be used for further developments //! //! @author Pierre Hubert use std::collections::HashMap; use serde::Serialize; use crate::api_data::conversation_message_api::ConversationMessageAPI; use crate::data::conversation_message::ConversationMessage; #[derive(Serialize)] #[allow(non_snake_case)] pub struct ConversationRefreshResultAPI { #[serde(flatten)] list: HashMap>, } impl ConversationRefreshResultAPI { /// Create a new list pub fn new(list: HashMap>) -> ConversationRefreshResultAPI { let list = list .iter() .map(|v| ( format!("conversation-{}", v.0), ConversationMessageAPI::for_list(v.1) )) .collect(); ConversationRefreshResultAPI { list } } }