/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OnWhatsAppAutomaticEventRequest {
    #[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>,
    #[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
    }
}
