// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// One document's compact per-target breakdown.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExperimentByDocumentMetricsResponse {
    pub run_id: String,
    /// Defaults to `by_document`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub kind: Option<String>,
    /// Defaults to `by_document`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub view: Option<String>,
    pub document: ExperimentMetricDocumentRef,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub score: Option<f64>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub prior_score: Option<f64>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub confusion: Option<ExperimentDocumentConfusionMetric>,
    /// Defaults to `[]`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub targets: Option<Vec<ExperimentByDocumentTargetMetric>>,
}
impl ExperimentByDocumentMetricsResponse {
    /// Construct a new `ExperimentByDocumentMetricsResponse` with the required fields set.
    #[allow(deprecated)]
    pub fn new(run_id: impl Into<String>, document: ExperimentMetricDocumentRef) -> Self {
        Self {
            run_id: run_id.into(),
            kind: Default::default(),
            view: Default::default(),
            document,
            score: Default::default(),
            prior_score: Default::default(),
            confusion: Default::default(),
            targets: Default::default(),
        }
    }
}
