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

/// WebhookPayloadMessageSent : Webhook payload for message sent events (fired when a message is sent via the API)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadMessageSent {
    /// Stable webhook event ID
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "event")]
    pub event: Event,
    #[serde(rename = "message")]
    pub message: Box<models::WebhookPayloadMessageSentMessage>,
    #[serde(rename = "conversation")]
    pub conversation: Box<models::WebhookPayloadMessageConversation>,
    #[serde(rename = "account")]
    pub account: Box<models::WebhookPayloadMessageAccount>,
    #[serde(rename = "timestamp")]
    pub timestamp: String,
}

impl WebhookPayloadMessageSent {
    /// Webhook payload for message sent events (fired when a message is sent via the API)
    pub fn new(
        id: String,
        event: Event,
        message: models::WebhookPayloadMessageSentMessage,
        conversation: models::WebhookPayloadMessageConversation,
        account: models::WebhookPayloadMessageAccount,
        timestamp: String,
    ) -> WebhookPayloadMessageSent {
        WebhookPayloadMessageSent {
            id,
            event,
            message: Box::new(message),
            conversation: Box::new(conversation),
            account: Box::new(account),
            timestamp,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
    #[serde(rename = "message.sent")]
    MessageSent,
}

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