Skip to main content

mistral_openapi_client/models/
image_content.rs

1/*
2 * Mistral AI API
3 *
4 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ImageContent : Image content for a message.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ImageContent {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "data")]
20    pub data: String,
21    #[serde(rename = "mimeType")]
22    pub mime_type: String,
23    #[serde(rename = "annotations", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub annotations: Option<Option<models::Annotations>>,
25    #[serde(rename = "_meta", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub _meta: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
27}
28
29impl ImageContent {
30    /// Image content for a message.
31    pub fn new(r#type: Type, data: String, mime_type: String) -> ImageContent {
32        ImageContent {
33            r#type,
34            data,
35            mime_type,
36            annotations: None,
37            _meta: None,
38        }
39    }
40}
41/// 
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Type {
44    #[serde(rename = "image")]
45    Image,
46}
47
48impl Default for Type {
49    fn default() -> Type {
50        Self::Image
51    }
52}
53