windmill-api 1.796.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.796.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CellScore : One scorer's verdict on one run, and how it compares with the baseline.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CellScore {
    #[serde(rename = "scorer_id")]
    pub scorer_id: String,
    #[serde(rename = "score", skip_serializing_if = "Option::is_none")]
    pub score: Option<f64>,
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
    #[serde(rename = "checks", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub checks: Option<Option<serde_json::Value>>,
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// The scorer read this case and had nothing to measure on it. Left out of the column's mean and pass rate rather than counted as a zero. 
    #[serde(rename = "not_applicable", skip_serializing_if = "Option::is_none")]
    pub not_applicable: Option<bool>,
    /// A scoring job is still running for this cell.
    #[serde(rename = "pending")]
    pub pending: bool,
    /// Which side of the scorer's `pass_if` threshold the score fell on. Absent when the column has no threshold, or has no score yet. 
    #[serde(rename = "passed", skip_serializing_if = "Option::is_none")]
    pub passed: Option<bool>,
    /// The same scorer's number on the baseline experiment.
    #[serde(rename = "baseline", skip_serializing_if = "Option::is_none")]
    pub baseline: Option<f64>,
    /// The baseline's score came from a different definition of this scorer, so the delta is a change of scorer as much as a change of agent. 
    #[serde(rename = "definition_changed")]
    pub definition_changed: bool,
}

impl CellScore {
    /// One scorer's verdict on one run, and how it compares with the baseline.
    pub fn new(scorer_id: String, pending: bool, definition_changed: bool) -> CellScore {
        CellScore {
            scorer_id,
            score: None,
            reason: None,
            checks: None,
            error: None,
            not_applicable: None,
            pending,
            passed: None,
            baseline: None,
            definition_changed,
        }
    }
}