/*
 * 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.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// WebhookPayloadMessage : Webhook payload for message received events (DMs from Instagram, Facebook, Telegram, Bluesky, Reddit)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadMessage {
    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
    pub event: Option<Event>,
    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
    pub message: Option<Box<models::WebhookPayloadMessageMessage>>,
    #[serde(rename = "conversation", skip_serializing_if = "Option::is_none")]
    pub conversation: Option<Box<models::WebhookPayloadMessageConversation>>,
    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
    pub account: Option<Box<models::WebhookPayloadMessageAccount>>,
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Box<models::WebhookPayloadMessageMetadata>>,
    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
}

impl WebhookPayloadMessage {
    /// Webhook payload for message received events (DMs from Instagram, Facebook, Telegram, Bluesky, Reddit)
    pub fn new() -> WebhookPayloadMessage {
        WebhookPayloadMessage {
            event: None,
            message: None,
            conversation: None,
            account: None,
            metadata: None,
            timestamp: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
    #[serde(rename = "message.received")]
    MessageReceived,
}

impl Default for Event {
    fn default() -> Event {
        Self::MessageReceived
    }
}
