// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Public create-partition request body.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PartitionRequest {
    /// The document to partition
    pub document: MimeData,
    /// The key to partition the document by
    pub key: String,
    /// Instructions describing how the document should be partitioned
    pub instructions: String,
    /// The model to use for partitioning
    ///
    /// Defaults to `retab-small`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    /// Number of partitioning runs to use for consensus voting. Uses deterministic single-pass when set to 1.
    ///
    /// Defaults to `1`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub n_consensus: Option<i64>,
    /// If true, allow a page to appear in more than one partition chunk
    ///
    /// Defaults to `true`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub allow_overlap: Option<bool>,
    /// If true, skip the LLM cache and force a fresh completion
    ///
    /// Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub bust_cache: Option<bool>,
    /// If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1/<primitive>/{id} until status is terminal. Mutually exclusive with stream.
    ///
    /// Defaults to `false`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub background: Option<bool>,
}
impl PartitionRequest {
    /// Construct a new `PartitionRequest` with the required fields set.
    #[allow(deprecated)]
    pub fn new<D: Into<crate::MimeData>>(
        document: D,
        key: impl Into<String>,
        instructions: impl Into<String>,
    ) -> Self {
        Self {
            document: document.into(),
            key: key.into(),
            instructions: instructions.into(),
            model: Default::default(),
            n_consensus: Default::default(),
            allow_overlap: Default::default(),
            bust_cache: Default::default(),
            background: Default::default(),
        }
    }
}
