use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AssetFaceResponseDto {
#[serde(rename = "boundingBoxX1")]
pub bounding_box_x1: i32,
#[serde(rename = "boundingBoxX2")]
pub bounding_box_x2: i32,
#[serde(rename = "boundingBoxY1")]
pub bounding_box_y1: i32,
#[serde(rename = "boundingBoxY2")]
pub bounding_box_y2: i32,
#[serde(rename = "id")]
pub id: uuid::Uuid,
#[serde(rename = "imageHeight")]
pub image_height: i32,
#[serde(rename = "imageWidth")]
pub image_width: i32,
#[serde(rename = "person", deserialize_with = "Option::deserialize")]
pub person: Option<Box<models::PersonResponseDto>>,
#[serde(rename = "sourceType", skip_serializing_if = "Option::is_none")]
pub source_type: Option<models::SourceType>,
}
impl AssetFaceResponseDto {
pub fn new(bounding_box_x1: i32, bounding_box_x2: i32, bounding_box_y1: i32, bounding_box_y2: i32, id: uuid::Uuid, image_height: i32, image_width: i32, person: Option<models::PersonResponseDto>) -> AssetFaceResponseDto {
AssetFaceResponseDto {
bounding_box_x1,
bounding_box_x2,
bounding_box_y1,
bounding_box_y2,
id,
image_height,
image_width,
person: if let Some(x) = person {Some(Box::new(x))} else {None},
source_type: None,
}
}
}