uapi-sdk-rust 0.1.17

UAPI Rust SDK - idiomatic, typed, domain-driven API client.
Documentation
/*
 * UAPI
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * 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 PostImageOcr200Response {
    /// 按阅读顺序拼接后的识别文本。
    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// 纯文本结果,适合做搜索、索引或直接展示。
    #[serde(rename = "plain_text", skip_serializing_if = "Option::is_none")]
    pub plain_text: Option<String>,
    /// 根据图片中的标题、段落和表格整理出的 Markdown 文本。只有在 `return_markdown=true` 时才会返回。
    #[serde(rename = "markdown", skip_serializing_if = "Option::is_none")]
    pub markdown: Option<String>,
    /// 逐段文字结果。适合做高亮、框选和逐项解析。
    #[serde(rename = "words_result", skip_serializing_if = "Option::is_none")]
    pub words_result: Option<Vec<models::PostImageOcr200ResponseWordsResultInner>>,
    /// 识别出的文字片段数量。
    #[serde(rename = "words_result_num", skip_serializing_if = "Option::is_none")]
    pub words_result_num: Option<i32>,
    /// 本次响应是否包含坐标信息。
    #[serde(rename = "need_location", skip_serializing_if = "Option::is_none")]
    pub need_location: Option<bool>,
    /// 耗时拆分信息,适合做性能统计或排查。
    #[serde(rename = "timing", skip_serializing_if = "Option::is_none")]
    pub timing: Option<serde_json::Value>,
    /// 识别结果的统计摘要。
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<serde_json::Value>,
    /// 图片本身的基础信息。
    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
    pub image: Option<serde_json::Value>,
    /// 按行组织的详细识别结果。
    #[serde(rename = "lines", skip_serializing_if = "Option::is_none")]
    pub lines: Option<Vec<serde_json::Value>>,
    /// 按块组织的详细识别结果。
    #[serde(rename = "blocks", skip_serializing_if = "Option::is_none")]
    pub blocks: Option<Vec<serde_json::Value>>,
    /// 按页组织的详细识别结果。
    #[serde(rename = "pages", skip_serializing_if = "Option::is_none")]
    pub pages: Option<Vec<serde_json::Value>>,
    /// 补充识别结果对象,适合需要继续解析更多细节字段的场景。
    #[serde(rename = "raw", skip_serializing_if = "Option::is_none")]
    pub raw: Option<serde_json::Value>,
}

impl PostImageOcr200Response {
    pub fn new() -> PostImageOcr200Response {
        PostImageOcr200Response {
            text: None,
            plain_text: None,
            markdown: None,
            words_result: None,
            words_result_num: None,
            need_location: None,
            timing: None,
            summary: None,
            image: None,
            lines: None,
            blocks: None,
            pages: None,
            raw: None,
        }
    }
}