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

/// WorkflowRunRecord : A single execution run of a workflow — tracks start/end time and completion status.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowRunRecord {
    /// ISO 8601 timestamp when the run completed (null if still running).
    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<Option<String>>,
    /// Run UUID.
    #[serde(rename = "id")]
    pub id: String,
    /// Project where the run executed.
    #[serde(rename = "project_id")]
    pub project_id: String,
    /// ISO 8601 timestamp when the run started.
    #[serde(rename = "started_at")]
    pub started_at: String,
    /// Run status: `running`, `completed`, `failed`.
    #[serde(rename = "status")]
    pub status: String,
    /// Workflow UUID that was executed.
    #[serde(rename = "workflow_id")]
    pub workflow_id: String,
}

impl WorkflowRunRecord {
    /// A single execution run of a workflow — tracks start/end time and completion status.
    pub fn new(id: String, project_id: String, started_at: String, status: String, workflow_id: String) -> WorkflowRunRecord {
        WorkflowRunRecord {
            completed_at: None,
            id,
            project_id,
            started_at,
            status,
            workflow_id,
        }
    }
}