// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Split {
    /// Unique identifier of the split result
    pub id: String,
    /// Information about the split file
    pub file: FileRef,
    /// Model used for the split operation
    pub model: String,
    /// Subdocuments used for the split operation
    pub subdocuments: Vec<Subdocument>,
    /// Number of consensus votes used
    ///
    /// Defaults to `1`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub n_consensus: Option<i64>,
    /// Free-form instructions supplied with the split request.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub instructions: Option<String>,
    /// The list of document splits with their assigned pages
    pub output: Vec<SplitResult>,
    /// Consensus metadata for multi-vote split runs
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub consensus: Option<SplitConsensus>,
    /// Usage information for the split operation
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub usage: Option<RetabUsage>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
}
impl Split {
    /// Construct a new `Split` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        id: impl Into<String>,
        file: FileRef,
        model: impl Into<String>,
        subdocuments: Vec<Subdocument>,
        output: Vec<SplitResult>,
    ) -> Self {
        Self {
            id: id.into(),
            file,
            model: model.into(),
            subdocuments,
            n_consensus: Default::default(),
            instructions: Default::default(),
            output,
            consensus: Default::default(),
            usage: Default::default(),
            created_at: Default::default(),
        }
    }
}
