/*
* 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.128.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 OnWhatsAppAutomaticEventRequest {
/// Stable webhook event ID: the dedupe key, also sent as the X-Zernio-Event-Id header and identical on every retry and redelivery. It identifies the event only, never an account or other resource.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "event", skip_serializing_if = "Option::is_none")]
pub event: Option<Event>,
/// UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
#[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
/// SocialAccount id of the WhatsApp number whose conversation was flagged.
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
/// Zernio conversation id, when the thread could be resolved.
#[serde(rename = "conversationId", skip_serializing_if = "Option::is_none")]
pub conversation_id: Option<String>,
/// The wamid of the message Meta's analysis flagged.
#[serde(rename = "platformMessageId", skip_serializing_if = "Option::is_none")]
pub platform_message_id: Option<String>,
/// Meta-detected event: `LeadSubmitted` | `Purchase`.
#[serde(rename = "eventName", skip_serializing_if = "Option::is_none")]
pub event_name: Option<String>,
/// Meta's CTWA click id, the Conversions API match key.
#[serde(rename = "ctwaClid", skip_serializing_if = "Option::is_none")]
pub ctwa_clid: Option<String>,
#[serde(rename = "customData", skip_serializing_if = "Option::is_none")]
pub custom_data: Option<Box<models::OnWhatsAppAutomaticEventRequestCustomData>>,
#[serde(rename = "detectedAt", skip_serializing_if = "Option::is_none")]
pub detected_at: Option<String>,
}
impl OnWhatsAppAutomaticEventRequest {
pub fn new() -> OnWhatsAppAutomaticEventRequest {
OnWhatsAppAutomaticEventRequest {
id: None,
event: None,
timestamp: None,
account_id: None,
conversation_id: None,
platform_message_id: None,
event_name: None,
ctwa_clid: None,
custom_data: None,
detected_at: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
#[serde(rename = "whatsapp.automatic_event")]
WhatsappAutomaticEvent,
}
impl Default for Event {
fn default() -> Event {
Self::WhatsappAutomaticEvent
}
}