/*
 * 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.1
 * 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 GetInboxConversationMessages200ResponseMessagesInner {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "conversationId", skip_serializing_if = "Option::is_none")]
    pub conversation_id: 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 = "message", skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[serde(rename = "senderId", skip_serializing_if = "Option::is_none")]
    pub sender_id: Option<String>,
    #[serde(rename = "senderName", skip_serializing_if = "Option::is_none")]
    pub sender_name: Option<String>,
    /// X/Twitter verified badge type. Only present for Twitter/X messages.
    #[serde(rename = "senderVerifiedType", skip_serializing_if = "Option::is_none")]
    pub sender_verified_type: Option<SenderVerifiedType>,
    #[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
    pub direction: Option<Direction>,
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    #[serde(rename = "attachments", skip_serializing_if = "Option::is_none")]
    pub attachments:
        Option<Vec<models::GetInboxConversationMessages200ResponseMessagesInnerAttachmentsInner>>,
    /// Reddit message subject
    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    /// Instagram story reply
    #[serde(rename = "storyReply", skip_serializing_if = "Option::is_none")]
    pub story_reply: Option<bool>,
    /// Instagram story mention
    #[serde(rename = "isStoryMention", skip_serializing_if = "Option::is_none")]
    pub is_story_mention: Option<bool>,
    /// True if the sender has edited this message at least once.
    #[serde(rename = "isEdited", skip_serializing_if = "Option::is_none")]
    pub is_edited: Option<bool>,
    /// When the most recent edit happened.
    #[serde(rename = "editedAt", skip_serializing_if = "Option::is_none")]
    pub edited_at: Option<String>,
    /// Total number of edits applied.
    #[serde(rename = "editCount", skip_serializing_if = "Option::is_none")]
    pub edit_count: Option<i32>,
    /// Every prior version of the message, oldest first.
    #[serde(rename = "editHistory", skip_serializing_if = "Option::is_none")]
    pub edit_history:
        Option<Vec<models::GetInboxConversationMessages200ResponseMessagesInnerEditHistoryInner>>,
    /// True if the sender has deleted (unsent) this message. The original `message` and `attachments` fields remain populated.
    #[serde(rename = "isDeleted", skip_serializing_if = "Option::is_none")]
    pub is_deleted: Option<bool>,
    #[serde(rename = "deletedAt", skip_serializing_if = "Option::is_none")]
    pub deleted_at: Option<String>,
    /// Lifecycle status for outgoing messages. Not all platforms emit every state (see webhook support matrix).
    #[serde(rename = "deliveryStatus", skip_serializing_if = "Option::is_none")]
    pub delivery_status: Option<DeliveryStatus>,
    #[serde(rename = "deliveredAt", skip_serializing_if = "Option::is_none")]
    pub delivered_at: Option<String>,
    #[serde(rename = "readAt", skip_serializing_if = "Option::is_none")]
    pub read_at: Option<String>,
    /// Original send time for outgoing messages (used for Messenger watermark queries).
    #[serde(rename = "sentAt", skip_serializing_if = "Option::is_none")]
    pub sent_at: Option<String>,
    #[serde(rename = "deliveryError", skip_serializing_if = "Option::is_none")]
    pub delivery_error:
        Option<Box<models::GetInboxConversationMessages200ResponseMessagesInnerDeliveryError>>,
}

impl GetInboxConversationMessages200ResponseMessagesInner {
    pub fn new() -> GetInboxConversationMessages200ResponseMessagesInner {
        GetInboxConversationMessages200ResponseMessagesInner {
            id: None,
            conversation_id: None,
            account_id: None,
            platform: None,
            message: None,
            sender_id: None,
            sender_name: None,
            sender_verified_type: None,
            direction: None,
            created_at: None,
            attachments: None,
            subject: None,
            story_reply: None,
            is_story_mention: None,
            is_edited: None,
            edited_at: None,
            edit_count: None,
            edit_history: None,
            is_deleted: None,
            deleted_at: None,
            delivery_status: None,
            delivered_at: None,
            read_at: None,
            sent_at: None,
            delivery_error: None,
        }
    }
}
/// X/Twitter verified badge type. Only present for Twitter/X messages.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SenderVerifiedType {
    #[serde(rename = "blue")]
    Blue,
    #[serde(rename = "government")]
    Government,
    #[serde(rename = "business")]
    Business,
    #[serde(rename = "none")]
    None,
}

impl Default for SenderVerifiedType {
    fn default() -> SenderVerifiedType {
        Self::Blue
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Direction {
    #[serde(rename = "incoming")]
    Incoming,
    #[serde(rename = "outgoing")]
    Outgoing,
}

impl Default for Direction {
    fn default() -> Direction {
        Self::Incoming
    }
}
/// Lifecycle status for outgoing messages. Not all platforms emit every state (see webhook support matrix).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DeliveryStatus {
    #[serde(rename = "sent")]
    Sent,
    #[serde(rename = "delivered")]
    Delivered,
    #[serde(rename = "read")]
    Read,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "deleted")]
    Deleted,
}

impl Default for DeliveryStatus {
    fn default() -> DeliveryStatus {
        Self::Sent
    }
}
