// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Summary of the most recent block-eval run.
/// Execution status and verdict outcome are exposed as separate fields.
/// The summary is written on terminal-state transitions, so in practice
/// `status` is one of `completed | error | cancelled` and `outcome` is
/// populated when `status == "completed"`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LatestBlockEvalRunSummary {
    pub run_record_id: String,
    pub status: LatestBlockEvalRunSummaryStatus,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub outcome: Option<LatestBlockEvalRunSummaryOutcome>,
    pub started_at: String,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub completed_at: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub duration_ms: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub workflow_draft_fingerprint: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub block_execution_fingerprint: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub validity_fingerprint: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub handle_inputs_fingerprint: Option<String>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub assertions_passed: Option<i64>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub assertions_failed: Option<i64>,
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub blocked_assertions: Option<i64>,
}
impl LatestBlockEvalRunSummary {
    /// Construct a new `LatestBlockEvalRunSummary` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        run_record_id: impl Into<String>,
        status: LatestBlockEvalRunSummaryStatus,
        started_at: impl Into<String>,
    ) -> Self {
        Self {
            run_record_id: run_record_id.into(),
            status,
            outcome: Default::default(),
            started_at: started_at.into(),
            completed_at: Default::default(),
            duration_ms: Default::default(),
            workflow_draft_fingerprint: Default::default(),
            block_execution_fingerprint: Default::default(),
            validity_fingerprint: Default::default(),
            handle_inputs_fingerprint: Default::default(),
            assertions_passed: Default::default(),
            assertions_failed: Default::default(),
            blocked_assertions: Default::default(),
        }
    }
}
