/*
* 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).
*
* The version of the OpenAPI document: 1.13.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 WebhookPayloadReactionReaction {
/// The emoji reacted with. May be an empty string when `action` is `removed` on WhatsApp (Meta does not report which emoji was removed).
#[serde(rename = "emoji")]
pub emoji: String,
#[serde(rename = "action")]
pub action: Action,
/// Internal Zernio message ID of the reacted-to message, when resolvable from the platform ID.
#[serde(rename = "messageId", skip_serializing_if = "Option::is_none")]
pub message_id: Option<String>,
/// Platform-native ID of the reacted-to message (e.g. WhatsApp wamid).
#[serde(rename = "platformMessageId")]
pub platform_message_id: String,
#[serde(rename = "sender")]
pub sender: Box<models::WebhookPayloadReactionReactionSender>,
#[serde(rename = "reactedAt")]
pub reacted_at: String,
}
impl WebhookPayloadReactionReaction {
pub fn new(
emoji: String,
action: Action,
platform_message_id: String,
sender: models::WebhookPayloadReactionReactionSender,
reacted_at: String,
) -> WebhookPayloadReactionReaction {
WebhookPayloadReactionReaction {
emoji,
action,
message_id: None,
platform_message_id,
sender: Box::new(sender),
reacted_at,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
#[serde(rename = "added")]
Added,
#[serde(rename = "removed")]
Removed,
}
impl Default for Action {
fn default() -> Action {
Self::Added
}
}