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

/// WorkflowRecord : A notification workflow with its steps, status, and configuration.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowRecord {
    /// Whether the workflow is active.
    #[serde(rename = "active")]
    pub active: bool,
    /// Whether this workflow is critical (bypasses preferences).
    #[serde(rename = "critical")]
    pub critical: bool,
    /// Description.
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    /// Workflow UUID.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Unique slug identifier used in trigger calls.
    #[serde(rename = "identifier")]
    pub identifier: String,
    /// Display name.
    #[serde(rename = "name")]
    pub name: String,
    /// Associated notification group UUID.
    #[serde(rename = "notification_group_id")]
    pub notification_group_id: uuid::Uuid,
    /// Serialized step definitions.
    #[serde(rename = "steps")]
    pub steps: Vec<serde_json::Value>,
    /// Tags for filtering.
    #[serde(rename = "tags")]
    pub tags: Vec<String>,
}

impl WorkflowRecord {
    /// A notification workflow with its steps, status, and configuration.
    pub fn new(active: bool, critical: bool, id: uuid::Uuid, identifier: String, name: String, notification_group_id: uuid::Uuid, steps: Vec<serde_json::Value>, tags: Vec<String>) -> WorkflowRecord {
        WorkflowRecord {
            active,
            critical,
            description: None,
            id,
            identifier,
            name,
            notification_group_id,
            steps,
            tags,
        }
    }
}