Skip to main content

trieve_client/models/
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 ChunkMetadata {
15    #[serde(rename = "chunk_html", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
16    pub chunk_html: Option<Option<String>>,
17    #[serde(rename = "created_at")]
18    pub created_at: String,
19    #[serde(rename = "dataset_id")]
20    pub dataset_id: uuid::Uuid,
21    #[serde(rename = "id")]
22    pub id: uuid::Uuid,
23    #[serde(rename = "image_urls", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub image_urls: Option<Option<Vec<String>>>,
25    #[serde(rename = "link", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub link: Option<Option<String>>,
27    #[serde(rename = "location", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub location: Option<Option<Box<models::GeoInfo>>>,
29    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub metadata: Option<Option<serde_json::Value>>,
31    #[serde(rename = "num_value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub num_value: Option<Option<f64>>,
33    #[serde(rename = "tag_set", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub tag_set: Option<Option<Vec<String>>>,
35    #[serde(rename = "time_stamp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub time_stamp: Option<Option<String>>,
37    #[serde(rename = "tracking_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub tracking_id: Option<Option<String>>,
39    #[serde(rename = "updated_at")]
40    pub updated_at: String,
41    #[serde(rename = "weight")]
42    pub weight: f64,
43}
44
45impl ChunkMetadata {
46    pub fn new(created_at: String, dataset_id: uuid::Uuid, id: uuid::Uuid, updated_at: String, weight: f64) -> ChunkMetadata {
47        ChunkMetadata {
48            chunk_html: None,
49            created_at,
50            dataset_id,
51            id,
52            image_urls: None,
53            link: None,
54            location: None,
55            metadata: None,
56            num_value: None,
57            tag_set: None,
58            time_stamp: None,
59            tracking_id: None,
60            updated_at,
61            weight,
62        }
63    }
64}
65