langfuse_client_base/models/
dataset.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
15pub struct Dataset {
16 #[serde(rename = "id")]
17 pub id: String,
18 #[serde(rename = "name")]
19 pub name: String,
20 #[serde(
21 rename = "description",
22 default,
23 with = "::serde_with::rust::double_option",
24 skip_serializing_if = "Option::is_none"
25 )]
26 pub description: Option<Option<String>>,
27 #[serde(
28 rename = "metadata",
29 default,
30 with = "::serde_with::rust::double_option",
31 skip_serializing_if = "Option::is_none"
32 )]
33 pub metadata: Option<Option<serde_json::Value>>,
34 #[serde(
36 rename = "inputSchema",
37 default,
38 with = "::serde_with::rust::double_option",
39 skip_serializing_if = "Option::is_none"
40 )]
41 pub input_schema: Option<Option<serde_json::Value>>,
42 #[serde(
44 rename = "expectedOutputSchema",
45 default,
46 with = "::serde_with::rust::double_option",
47 skip_serializing_if = "Option::is_none"
48 )]
49 pub expected_output_schema: Option<Option<serde_json::Value>>,
50 #[serde(rename = "projectId")]
51 pub project_id: String,
52 #[serde(rename = "createdAt")]
53 pub created_at: String,
54 #[serde(rename = "updatedAt")]
55 pub updated_at: String,
56}
57
58impl Dataset {
59 pub fn new(
60 id: String,
61 name: String,
62 project_id: String,
63 created_at: String,
64 updated_at: String,
65 ) -> Dataset {
66 Dataset {
67 id,
68 name,
69 description: None,
70 metadata: None,
71 input_schema: None,
72 expected_output_schema: None,
73 project_id,
74 created_at,
75 updated_at,
76 }
77 }
78}