#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ImageAttachment {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
#[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
pub object_type: Option<String>,
#[serde(rename = "display", skip_serializing_if = "Option::is_none")]
pub display: Option<String>,
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
pub natural_slug: Option<String>,
#[serde(rename = "content_type")]
pub content_type: String,
#[serde(rename = "object_id")]
pub object_id: uuid::Uuid,
#[serde(rename = "image")]
pub image: String,
#[serde(rename = "image_height")]
pub image_height: i32,
#[serde(rename = "image_width")]
pub image_width: i32,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
}
impl ImageAttachment {
pub fn new(
content_type: String,
object_id: uuid::Uuid,
image: String,
image_height: i32,
image_width: i32,
) -> ImageAttachment {
ImageAttachment {
id: None,
object_type: None,
display: None,
url: None,
natural_slug: None,
content_type,
object_id,
image,
image_height,
image_width,
name: None,
created: None,
}
}
}