use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct DecisionInputImage {
#[serde(rename = "image_url")]
pub image_url: String,
#[serde(rename = "detail", skip_serializing_if = "Option::is_none")]
pub detail: Option<Box<models::DecisionInputImageDetail>>,
#[serde(
rename = "prompt_cache_breakpoint",
skip_serializing_if = "Option::is_none"
)]
pub prompt_cache_breakpoint: Option<models::PromptCacheBreakpoint1>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl DecisionInputImage {
pub fn new(image_url: String, r#type: Type) -> DecisionInputImage {
DecisionInputImage {
image_url,
detail: None,
prompt_cache_breakpoint: None,
r#type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "input_image")]
InputImage,
}
impl Default for Type {
fn default() -> Type {
Self::InputImage
}
}
impl std::fmt::Display for DecisionInputImage {
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),
}
}
}