late 0.0.1372

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.572.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// WebhookPayloadMessageSentMetadata : Platform-specific context for the sent message: a quote-reply reference, a WhatsApp location pin, WhatsApp contact cards, the TikTok message type, or outgoing Instagram/Facebook buttons, quick replies and template.  The key is present only when the send carried some context: it is never null and never an empty object. Read it to tell a location or contact-card message from a text one without a GET on the message.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadMessageSentMetadata {
    /// Instagram/Facebook only. The buttons, quickReplies and/or template this outgoing message carried, as sent (tracked urls included when link tracking wrapped a button). Absent when the send carried none.
    #[serde(rename = "metaInteractive", skip_serializing_if = "Option::is_none")]
    pub meta_interactive: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<Box<models::WebhookPayloadMessageSentMetadataLocation>>,
    /// WhatsApp only. The contact cards this message carries. The message `text` is only the emoji preview (`👤 <name>`); the cards live here.  - API sends: the `contacts` array exactly as given to the inbox send API (`name`, `phones[].phone` / `type`, `emails[]`). - Coexistence echoes of a card shared from the WhatsApp Business app: Meta's shape (`phones[].wa_id`, `vcard`).
    #[serde(rename = "contacts", skip_serializing_if = "Option::is_none")]
    pub contacts: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
    /// `platformMessageId` of the message this send quote-replies to.  - **WhatsApp and Telegram:** present when the reply was sent through Zernio with `replyTo` on the inbox send API. A WhatsApp API send fires `message.sent` off the delivery status, with the quote reference forwarded from the stored send, so it arrives on the same `message.sent` as any WhatsApp send. - **Instagram echoes:** not delivered. Zernio forwards `reply_to.mid` whenever Meta puts it on an echo, but on Instagram Meta does not send it, so a reply the operator quoted in the Instagram app arrives with no `quotedMessageId`. - **Facebook Messenger:** uses a separate subscription (`message_echoes`) that has not been measured. Treat it as unverified, not supported. - **WhatsApp Coexistence echoes:** absent. Meta omits the quote context from `smb_message_echoes`, so a reply the operator sent from the WhatsApp Business app has no `quotedMessageId` even though WhatsApp shows it as a quote-reply.  Do not read the absence of this field as \"not a reply\".
    #[serde(rename = "quotedMessageId", skip_serializing_if = "Option::is_none")]
    pub quoted_message_id: Option<String>,
    /// Slack only. Parent thread ts of the sent message. Pass it back as `replyTo` on the inbox send API to keep replying inside the thread.
    #[serde(rename = "threadTs", skip_serializing_if = "Option::is_none")]
    pub thread_ts: Option<String>,
    /// TikTok only. The message type as TikTok reports it, forwarded verbatim (for example image, video, sticker, share_post, emoji, reaction, template).  Present on every TikTok DM that is not plain text. Those arrive with text empty and, for image, video, share_post, sticker and emoji, an attachment:  - share_post: type share, with the embed url and payload.videoId. - sticker/emoji: type sticker, url signed and expiring.  Absent on image sends made through the Zernio API, which carry the image in attachments.
    #[serde(rename = "tiktokMessageType", skip_serializing_if = "Option::is_none")]
    pub tiktok_message_type: Option<String>,
}

impl WebhookPayloadMessageSentMetadata {
    /// Platform-specific context for the sent message: a quote-reply reference, a WhatsApp location pin, WhatsApp contact cards, the TikTok message type, or outgoing Instagram/Facebook buttons, quick replies and template.  The key is present only when the send carried some context: it is never null and never an empty object. Read it to tell a location or contact-card message from a text one without a GET on the message.
    pub fn new() -> WebhookPayloadMessageSentMetadata {
        WebhookPayloadMessageSentMetadata {
            meta_interactive: None,
            location: None,
            contacts: None,
            quoted_message_id: None,
            thread_ts: None,
            tiktok_message_type: None,
        }
    }
}