trieve_client/models/
slim_chunk_metadata.rs

1/*
2 * Trieve API
3 *
4 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5 *
6 * The version of the OpenAPI document: 0.11.7
7 * Contact: developers@trieve.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct SlimChunkMetadata {
15    #[serde(rename = "created_at")]
16    pub created_at: String,
17    #[serde(rename = "dataset_id")]
18    pub dataset_id: uuid::Uuid,
19    #[serde(rename = "id")]
20    pub id: uuid::Uuid,
21    #[serde(rename = "image_urls", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub image_urls: Option<Option<Vec<String>>>,
23    #[serde(rename = "link", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub link: Option<Option<String>>,
25    #[serde(rename = "location", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub location: Option<Option<Box<models::GeoInfo>>>,
27    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub metadata: Option<Option<serde_json::Value>>,
29    #[serde(rename = "num_value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub num_value: Option<Option<f64>>,
31    #[serde(rename = "tag_set", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub tag_set: Option<Option<String>>,
33    #[serde(rename = "time_stamp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub time_stamp: Option<Option<String>>,
35    #[serde(rename = "tracking_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub tracking_id: Option<Option<String>>,
37    #[serde(rename = "updated_at")]
38    pub updated_at: String,
39    #[serde(rename = "weight")]
40    pub weight: f64,
41}
42
43impl SlimChunkMetadata {
44    pub fn new(created_at: String, dataset_id: uuid::Uuid, id: uuid::Uuid, updated_at: String, weight: f64) -> SlimChunkMetadata {
45        SlimChunkMetadata {
46            created_at,
47            dataset_id,
48            id,
49            image_urls: None,
50            link: None,
51            location: None,
52            metadata: None,
53            num_value: None,
54            tag_set: None,
55            time_stamp: None,
56            tracking_id: None,
57            updated_at,
58            weight,
59        }
60    }
61}
62