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

/// WorkflowStepCreate : Defines one step of a workflow — the channel type, template, and conditions.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowStepCreate {
    /// Whether this step is active. Inactive steps are skipped.
    #[serde(rename = "active", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub active: Option<Option<bool>>,
    /// Step execution filters/conditions.
    #[serde(rename = "filters")]
    pub filters: serde_json::Value,
    /// Arbitrary step metadata.
    #[serde(rename = "metadata")]
    pub metadata: serde_json::Value,
    /// Human-readable step name.
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    /// Delivery channel/type for this step.
    #[serde(rename = "step_type")]
    pub step_type: models::StepType,
    /// Content template with {{handlebar}} placeholders.
    #[serde(rename = "template")]
    pub template: serde_json::Value,
}

impl WorkflowStepCreate {
    /// Defines one step of a workflow — the channel type, template, and conditions.
    pub fn new(filters: serde_json::Value, metadata: serde_json::Value, step_type: models::StepType, template: serde_json::Value) -> WorkflowStepCreate {
        WorkflowStepCreate {
            active: None,
            filters,
            metadata,
            name: None,
            step_type,
            template,
        }
    }
}