/*
* OpenAI API
*
* The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
*
* The version of the OpenAPI document: 2.3.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Object019ImageUrl : Contains either an image URL or a data URL for a base64 encoded image.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct Object019ImageUrl {
/// Either a URL of the image or the base64 encoded image data.
#[serde(rename = "url")]
pub url: String,
}
impl Object019ImageUrl {
/// Contains either an image URL or a data URL for a base64 encoded image.
pub fn new(url: String) -> Object019ImageUrl {
Object019ImageUrl { url }
}
}
impl std::fmt::Display for Object019ImageUrl {
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),
}
}
}