/*
 * 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 ListWhatsAppConversions200ResponseEventsInner {
    /// When the event was sent to Meta.
    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
    /// One of LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent.
    #[serde(rename = "eventName", skip_serializing_if = "Option::is_none")]
    pub event_name: Option<String>,
    #[serde(
        rename = "conversationId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub conversation_id: Option<Option<String>>,
    /// Number of events Meta accepted on this send (usually 1).
    #[serde(
        rename = "eventsReceived",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub events_received: Option<Option<i32>>,
    /// Number of events Meta rejected (usually 0).
    #[serde(
        rename = "eventsFailed",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub events_failed: Option<Option<i32>>,
    /// Meta fbtrace_id for cross-referencing in Events Manager.
    #[serde(
        rename = "traceId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub trace_id: Option<Option<String>>,
    #[serde(
        rename = "durationMs",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub duration_ms: Option<Option<i32>>,
}

impl ListWhatsAppConversions200ResponseEventsInner {
    pub fn new() -> ListWhatsAppConversions200ResponseEventsInner {
        ListWhatsAppConversions200ResponseEventsInner {
            timestamp: None,
            event_name: None,
            conversation_id: None,
            events_received: None,
            events_failed: None,
            trace_id: None,
            duration_ms: None,
        }
    }
}
