// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Public create-edit request body.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EditRequest {
    /// Instructions describing how to fill the form fields.
    pub instructions: String,
    /// Input document (PDF, DOCX, XLSX, or PPTX). Mutually exclusive with template_id.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub document: Option<MimeData>,
    /// EditTemplate id to fill. When provided, uses the template's pre-defined form fields and empty PDF. Mutually exclusive with document.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub template_id: Option<String>,
    /// The model to use for edit inference.
    ///
    /// Defaults to `retab-small`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub model: Option<String>,
    /// Edit configuration (rendering options).
    ///
    /// Defaults to `{"color":"#000080"}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub config: Option<EditConfig>,
    /// 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 EditRequest {
    /// Construct a new `EditRequest` with the required fields set.
    #[allow(deprecated)]
    pub fn new(instructions: impl Into<String>) -> Self {
        Self {
            instructions: instructions.into(),
            document: Default::default(),
            template_id: Default::default(),
            model: Default::default(),
            config: Default::default(),
            bust_cache: Default::default(),
            background: Default::default(),
        }
    }
}
