/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListInboxConversationAnalytics200ResponseItemsInner {
    /// The platformConversationId (the same identity used by metadata.conversationId)
    #[serde(rename = "conversationId", skip_serializing_if = "Option::is_none")]
    pub conversation_id: Option<String>,
    /// The Conversation document _id, when a matching doc exists
    #[serde(
        rename = "mongoId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mongo_id: Option<Option<String>>,
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(
        rename = "participantName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_name: Option<Option<String>>,
    #[serde(
        rename = "participantUsername",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_username: Option<Option<String>>,
    #[serde(
        rename = "participantPicture",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_picture: Option<Option<String>>,
    /// Cached preview from the Conversation doc
    #[serde(
        rename = "lastMessage",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_message: Option<Option<String>>,
    #[serde(rename = "totalMessages", skip_serializing_if = "Option::is_none")]
    pub total_messages: Option<i32>,
    #[serde(rename = "received", skip_serializing_if = "Option::is_none")]
    pub received: Option<i32>,
    #[serde(rename = "sent", skip_serializing_if = "Option::is_none")]
    pub sent: Option<i32>,
    #[serde(rename = "read", skip_serializing_if = "Option::is_none")]
    pub read: Option<i32>,
    #[serde(rename = "failed", skip_serializing_if = "Option::is_none")]
    pub failed: Option<i32>,
    #[serde(rename = "firstMessageAt", skip_serializing_if = "Option::is_none")]
    pub first_message_at: Option<String>,
    #[serde(rename = "lastMessageAt", skip_serializing_if = "Option::is_none")]
    pub last_message_at: Option<String>,
}

impl ListInboxConversationAnalytics200ResponseItemsInner {
    pub fn new() -> ListInboxConversationAnalytics200ResponseItemsInner {
        ListInboxConversationAnalytics200ResponseItemsInner {
            conversation_id: None,
            mongo_id: None,
            account_id: None,
            platform: None,
            participant_name: None,
            participant_username: None,
            participant_picture: None,
            last_message: None,
            total_messages: None,
            received: None,
            sent: None,
            read: None,
            failed: None,
            first_message_at: None,
            last_message_at: None,
        }
    }
}
