enbbox 1.0.1

Notification infrastructure API — open-source alternative to Novu/Courier
Documentation
/*
 * enbbox API
 *
 * Notification infrastructure API — open-source alternative to Novu/Courier
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// BroadcastTrigger : Trigger a broadcast notification to a topic or segment.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BroadcastTrigger {
    /// Display name.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "overrides")]
    pub overrides: serde_json::Value,
    #[serde(rename = "payload")]
    pub payload: serde_json::Value,
    #[serde(rename = "transaction_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub transaction_id: Option<Option<String>>,
}

impl BroadcastTrigger {
    /// Trigger a broadcast notification to a topic or segment.
    pub fn new(name: String, overrides: serde_json::Value, payload: serde_json::Value) -> BroadcastTrigger {
        BroadcastTrigger {
            name,
            overrides,
            payload,
            transaction_id: None,
        }
    }
}