1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* 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};
/// WebhookPayloadMessageMetadata : Interactive message metadata (present when message is a quick reply tap, postback button tap, or inline keyboard callback)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadMessageMetadata {
/// Payload from a quick reply tap (Facebook/Instagram Messenger).
#[serde(rename = "quickReplyPayload", skip_serializing_if = "Option::is_none")]
pub quick_reply_payload: Option<String>,
/// Payload from a postback button tap (Facebook/Instagram Messenger).
#[serde(rename = "postbackPayload", skip_serializing_if = "Option::is_none")]
pub postback_payload: Option<String>,
/// Title of the tapped postback button (Facebook/Instagram Messenger).
#[serde(rename = "postbackTitle", skip_serializing_if = "Option::is_none")]
pub postback_title: Option<String>,
/// Callback data from an inline keyboard button tap (Telegram).
#[serde(rename = "callbackData", skip_serializing_if = "Option::is_none")]
pub callback_data: Option<String>,
/// WhatsApp only. Which kind of interactive reply the user sent: `button_reply` (tap on an interactive button), `list_reply` (tap on a list row), or `nfm_reply` (a WhatsApp Flow submission).
#[serde(rename = "interactiveType", skip_serializing_if = "Option::is_none")]
pub interactive_type: Option<InteractiveType>,
/// WhatsApp only. The `id` of the tapped button or list row, matching the `id` you supplied when the message was sent. Not set for Flow responses.
#[serde(rename = "interactiveId", skip_serializing_if = "Option::is_none")]
pub interactive_id: Option<String>,
/// WhatsApp only. Payload attached to a tapped template button. Template buttons emit a plain `button` webhook (not an interactive reply), so `interactiveType` is empty while this field is populated.
#[serde(rename = "buttonPayload", skip_serializing_if = "Option::is_none")]
pub button_payload: Option<String>,
/// WhatsApp only. Raw `nfm_reply.response_json` string returned by a Flow submission. Useful if you need the exact wire payload; for typed access use `flowResponseData` instead.
#[serde(rename = "flowResponseJson", skip_serializing_if = "Option::is_none")]
pub flow_response_json: Option<String>,
/// WhatsApp only. Parsed Flow response JSON. Populated when `flowResponseJson` is valid JSON; otherwise omitted. Keys and value types depend on the specific Flow that was submitted.
#[serde(rename = "flowResponseData", skip_serializing_if = "Option::is_none")]
pub flow_response_data: Option<std::collections::HashMap<String, serde_json::Value>>,
#[serde(rename = "storyReply", skip_serializing_if = "Option::is_none")]
pub story_reply: Option<Box<models::WebhookPayloadMessageMetadataStoryReply>>,
/// Instagram only. True when the message was generated by an IG user mentioning the account in their own story (`story_mention` attachment type). Mutually exclusive in practice with `storyReply`.
#[serde(rename = "isStoryMention", skip_serializing_if = "Option::is_none")]
pub is_story_mention: Option<bool>,
#[serde(rename = "referral", skip_serializing_if = "Option::is_none")]
pub referral: Option<Box<models::WebhookPayloadMessageMetadataReferral>>,
}
impl WebhookPayloadMessageMetadata {
/// Interactive message metadata (present when message is a quick reply tap, postback button tap, or inline keyboard callback)
pub fn new() -> WebhookPayloadMessageMetadata {
WebhookPayloadMessageMetadata {
quick_reply_payload: None,
postback_payload: None,
postback_title: None,
callback_data: None,
interactive_type: None,
interactive_id: None,
button_payload: None,
flow_response_json: None,
flow_response_data: None,
story_reply: None,
is_story_mention: None,
referral: None,
}
}
}
/// WhatsApp only. Which kind of interactive reply the user sent: `button_reply` (tap on an interactive button), `list_reply` (tap on a list row), or `nfm_reply` (a WhatsApp Flow submission).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum InteractiveType {
#[serde(rename = "button_reply")]
ButtonReply,
#[serde(rename = "list_reply")]
ListReply,
#[serde(rename = "nfm_reply")]
NfmReply,
}
impl Default for InteractiveType {
fn default() -> InteractiveType {
Self::ButtonReply
}
}