// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// A document blueprint generated from an uploaded file.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FileBlueprint {
    /// Defaults to `file.blueprint`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub object: Option<String>,
    /// Unique identifier of the file blueprint.
    pub id: String,
    /// Information about the analyzed file.
    pub file: FileRef,
    /// User intent supplied with the blueprint request.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub intent: Option<String>,
    /// The generated Document Blueprint payload.
    ///
    /// Defaults to `{}`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub output: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.
    ///
    /// Defaults to `pending`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub status: Option<FileBlueprintStatus>,
    /// Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub error: Option<PrimitiveError>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub created_at: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub started_at: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub completed_at: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub mode: Option<FileBlueprintMode>,
}
impl FileBlueprint {
    /// Construct a new `FileBlueprint` with the required fields set.
    #[allow(deprecated)]
    pub fn new(id: impl Into<String>, file: FileRef) -> Self {
        Self {
            object: Default::default(),
            id: id.into(),
            file,
            intent: Default::default(),
            output: Default::default(),
            status: Default::default(),
            error: Default::default(),
            created_at: Default::default(),
            started_at: Default::default(),
            completed_at: Default::default(),
            mode: Default::default(),
        }
    }
}
