// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// All timing information for a run.
/// ``duration_ms`` is backfilled at read time from
/// ``completed_at - started_at`` when both timestamps are present and the
/// stored value is ``None``. The field is ``init=False`` so producers cannot
/// pass it through ``__init__`` — they must round-trip through
/// ``model_validate`` (or persist via the Mongo projection helpers in
/// ``run_duration.py``). Records that already store ``duration_ms`` are left
/// untouched (idempotent), so backfill cannot drift from the canonical value
/// written by the projection.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RunTiming {
    /// When the run record was created
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
    /// When the run started executing
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub started_at: Option<String>,
    /// When the run finished executing
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub completed_at: Option<String>,
    /// When the current awaiting_review period started
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub review_waiting_started_at: Option<String>,
    /// Accumulated time spent waiting for review across the run
    ///
    /// Defaults to `0`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub accumulated_review_waiting_ms: Option<i64>,
    /// Total run duration in milliseconds. Backfilled from ``completed_at - started_at`` on read when not stored.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub duration_ms: Option<i64>,
}
