late 0.0.1055

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.104.0
 * 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 {
    /// The platform's own message id: the `wamid` on WhatsApp, the `mid` on Instagram and Facebook Messenger. This is what `metadata.quotedMessageId` points at, the value to pass as `replyTo` on the platforms that support quote-replies, and the `{messageId}` segment of the attachment-resolve URL. Webhooks deliver the same value as `message.platformMessageId`; this response has no field by that name.
    #[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",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sender_name: Option<Option<String>>,
    /// X verified badge type. Only present for X messages.
    #[serde(
        rename = "senderVerifiedType",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sender_verified_type: Option<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",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub subject: Option<Option<String>>,
    #[serde(rename = "storyReply", skip_serializing_if = "Option::is_none")]
    pub story_reply:
        Option<Box<models::GetInboxConversationMessages200ResponseMessagesInnerStoryReply>>,
    /// Instagram only. True when the message is the user mentioning the account in their own story. The story itself is the `share` attachment with `originalType: \"story_mention\"`. Also set on imported history, read off Meta's `story.mention`.
    #[serde(rename = "isStoryMention", skip_serializing_if = "Option::is_none")]
    pub is_story_mention: Option<bool>,
    /// Instagram and Facebook Messenger only. True when Meta withholds the content of this message from the API (its `is_unsupported` flag): `message` is empty, `attachments` is empty, and there is nothing to fetch, now or later. Distinguishes such a message from an ordinary empty one such as a story reply with no text. Absent on other platforms.
    #[serde(
        rename = "noRenderableContent",
        skip_serializing_if = "Option::is_none"
    )]
    pub no_renderable_content: 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",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub edited_at: Option<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::InboxMessageEditHistoryEntry>>,
    /// 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",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub deleted_at: Option<Option<String>>,
    /// Lifecycle status for outgoing messages. Not all platforms emit every state (see webhook support matrix).
    #[serde(
        rename = "deliveryStatus",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub delivery_status: Option<Option<DeliveryStatus>>,
    #[serde(
        rename = "deliveredAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub delivered_at: Option<Option<String>>,
    #[serde(
        rename = "readAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub read_at: Option<Option<String>>,
    /// Original send time for outgoing messages (used for Messenger watermark queries).
    #[serde(
        rename = "sentAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sent_at: Option<Option<String>>,
    #[serde(rename = "deliveryError", skip_serializing_if = "Option::is_none")]
    pub delivery_error:
        Option<Box<models::GetInboxConversationMessages200ResponseMessagesInnerDeliveryError>>,
    /// Emoji reactions on this message (WhatsApp / Telegram). At most one per party in a 1:1 thread.
    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
    pub reactions:
        Option<Vec<models::GetInboxConversationMessages200ResponseMessagesInnerReactionsInner>>,
    /// Platform-specific extras. Free-form, but commonly includes: `quotedMessageId` (the `id` of the message this one replies to, delivered as `message.platformMessageId` on webhooks), `waInteractive` (a compact descriptor of WhatsApp interactive content sent: buttons / list / cta_url / flow / location_request), `metaInteractive` (outgoing Instagram/Facebook buttons, quickReplies and template, as sent), and for inbound interactive taps `interactiveType` / `interactiveId`. It can also carry `source` (`whatsapp_business_app` / `coexistence_history` on a WhatsApp Coexistence number, `bulk-api` on a POST /v1/whatsapp/bulk send), which is where the message reached us from rather than who produced it: read `sentVia` for that.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Which Zernio surface produced this outgoing message: `human` (an operator in the Zernio inbox), `api` (a call to this API), `broadcast`, `sequence`, `workflow`, `comment_automation`, or `bulk-api` (POST /v1/whatsapp/bulk). Same vocabulary as the `source` filter on the inbox analytics endpoints.  Always present, and `null` whenever the lineage is unknown: every incoming message, any outgoing message sent from the platform's own app, and every message stored before this field shipped (2026-08). Existing messages are NOT backfilled, so treat `null` as \"unknown\", never as \"sent by a human\".
    #[serde(
        rename = "sentVia",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sent_via: Option<Option<SentVia>>,
}

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,
            no_renderable_content: 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,
            reactions: None,
            metadata: None,
            sent_via: None,
        }
    }
}
/// X verified badge type. Only present for 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
    }
}
/// Which Zernio surface produced this outgoing message: `human` (an operator in the Zernio inbox), `api` (a call to this API), `broadcast`, `sequence`, `workflow`, `comment_automation`, or `bulk-api` (POST /v1/whatsapp/bulk). Same vocabulary as the `source` filter on the inbox analytics endpoints.  Always present, and `null` whenever the lineage is unknown: every incoming message, any outgoing message sent from the platform's own app, and every message stored before this field shipped (2026-08). Existing messages are NOT backfilled, so treat `null` as \"unknown\", never as \"sent by a human\".
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SentVia {
    #[serde(rename = "human")]
    Human,
    #[serde(rename = "api")]
    Api,
    #[serde(rename = "broadcast")]
    Broadcast,
    #[serde(rename = "sequence")]
    Sequence,
    #[serde(rename = "workflow")]
    Workflow,
    #[serde(rename = "comment_automation")]
    CommentAutomation,
    #[serde(rename = "bulk-api")]
    BulkApi,
}

impl Default for SentVia {
    fn default() -> SentVia {
        Self::Human
    }
}