use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OcrImageObject {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "top_left_x", deserialize_with = "Option::deserialize")]
pub top_left_x: Option<i32>,
#[serde(rename = "top_left_y", deserialize_with = "Option::deserialize")]
pub top_left_y: Option<i32>,
#[serde(rename = "bottom_right_x", deserialize_with = "Option::deserialize")]
pub bottom_right_x: Option<i32>,
#[serde(rename = "bottom_right_y", deserialize_with = "Option::deserialize")]
pub bottom_right_y: Option<i32>,
#[serde(rename = "image_base64", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub image_base64: Option<Option<String>>,
#[serde(rename = "image_annotation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub image_annotation: Option<Option<String>>,
}
impl OcrImageObject {
pub fn new(id: String, top_left_x: Option<i32>, top_left_y: Option<i32>, bottom_right_x: Option<i32>, bottom_right_y: Option<i32>) -> OcrImageObject {
OcrImageObject {
id,
top_left_x,
top_left_y,
bottom_right_x,
bottom_right_y,
image_base64: None,
image_annotation: None,
}
}
}