mistral-openapi-client 0.1.0

Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
Documentation
/*
 * Mistral AI API
 *
 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OcrPageObject {
    /// The page index in a pdf document starting from 0
    #[serde(rename = "index")]
    pub index: i32,
    /// The markdown string response of the page
    #[serde(rename = "markdown")]
    pub markdown: String,
    /// List of all extracted images in the page
    #[serde(rename = "images")]
    pub images: Vec<models::OcrImageObject>,
    /// List of all extracted tables in the page
    #[serde(rename = "tables", skip_serializing_if = "Option::is_none")]
    pub tables: Option<Vec<models::OcrTableObject>>,
    /// List of all hyperlinks in the page
    #[serde(rename = "hyperlinks", skip_serializing_if = "Option::is_none")]
    pub hyperlinks: Option<Vec<String>>,
    #[serde(rename = "header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub header: Option<Option<String>>,
    #[serde(rename = "footer", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub footer: Option<Option<String>>,
    #[serde(rename = "dimensions", deserialize_with = "Option::deserialize")]
    pub dimensions: Option<Box<models::OcrPageDimensions>>,
}

impl OcrPageObject {
    pub fn new(index: i32, markdown: String, images: Vec<models::OcrImageObject>, dimensions: Option<models::OcrPageDimensions>) -> OcrPageObject {
        OcrPageObject {
            index,
            markdown,
            images,
            tables: None,
            hyperlinks: None,
            header: None,
            footer: None,
            dimensions: if let Some(x) = dimensions {Some(Box::new(x))} else {None},
        }
    }
}