use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct Object019 {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "image_url")]
pub image_url: Box<models::Object019ImageUrl>,
}
impl Object019 {
pub fn new(r#type: Type, image_url: models::Object019ImageUrl) -> Object019 {
Object019 {
r#type,
image_url: Box::new(image_url),
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "image_url")]
ImageUrl,
}
impl Default for Type {
fn default() -> Type {
Self::ImageUrl
}
}
impl std::fmt::Display for Object019 {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}