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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadMessageMessage {
    /// Internal message ID
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Internal conversation ID
    #[serde(rename = "conversationId", skip_serializing_if = "Option::is_none")]
    pub conversation_id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<Platform>,
    /// Platform's message ID
    #[serde(rename = "platformMessageId", skip_serializing_if = "Option::is_none")]
    pub platform_message_id: Option<String>,
    #[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
    pub direction: Option<Direction>,
    /// Message text content
    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    #[serde(rename = "attachments", skip_serializing_if = "Option::is_none")]
    pub attachments: Option<Vec<models::WebhookPayloadMessageMessageAttachmentsInner>>,
    #[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
    pub sender: Option<Box<models::WebhookPayloadMessageMessageSender>>,
    #[serde(rename = "sentAt", skip_serializing_if = "Option::is_none")]
    pub sent_at: Option<String>,
    #[serde(rename = "isRead", skip_serializing_if = "Option::is_none")]
    pub is_read: Option<bool>,
}

impl WebhookPayloadMessageMessage {
    pub fn new() -> WebhookPayloadMessageMessage {
        WebhookPayloadMessageMessage {
            id: None,
            conversation_id: None,
            platform: None,
            platform_message_id: None,
            direction: None,
            text: None,
            attachments: None,
            sender: None,
            sent_at: None,
            is_read: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
    #[serde(rename = "instagram")]
    Instagram,
    #[serde(rename = "facebook")]
    Facebook,
    #[serde(rename = "telegram")]
    Telegram,
    #[serde(rename = "bluesky")]
    Bluesky,
    #[serde(rename = "reddit")]
    Reddit,
}

impl Default for Platform {
    fn default() -> Platform {
        Self::Instagram
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Direction {
    #[serde(rename = "incoming")]
    Incoming,
}

impl Default for Direction {
    fn default() -> Direction {
        Self::Incoming
    }
}
