Skip to main content

mistral_openapi_client/models/
resource_link.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/// ResourceLink : A resource that the server is capable of reading, included in a prompt or tool call result.  Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ResourceLink {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub title: Option<Option<String>>,
21    #[serde(rename = "uri")]
22    pub uri: String,
23    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub description: Option<Option<String>>,
25    #[serde(rename = "mimeType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub mime_type: Option<Option<String>>,
27    #[serde(rename = "size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub size: Option<Option<i32>>,
29    #[serde(rename = "icons", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub icons: Option<Option<Vec<models::McpServerIcon>>>,
31    #[serde(rename = "annotations", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub annotations: Option<Option<models::Annotations>>,
33    #[serde(rename = "_meta", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub _meta: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
35    #[serde(rename = "type")]
36    pub r#type: Type,
37}
38
39impl ResourceLink {
40    /// A resource that the server is capable of reading, included in a prompt or tool call result.  Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
41    pub fn new(name: String, uri: String, r#type: Type) -> ResourceLink {
42        ResourceLink {
43            name,
44            title: None,
45            uri,
46            description: None,
47            mime_type: None,
48            size: None,
49            icons: None,
50            annotations: None,
51            _meta: None,
52            r#type,
53        }
54    }
55}
56/// 
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59    #[serde(rename = "resource_link")]
60    ResourceLink,
61}
62
63impl Default for Type {
64    fn default() -> Type {
65        Self::ResourceLink
66    }
67}
68