langfuse_client/models/
trace.rs

1/*
2 * langfuse
3 *
4 * ## Authentication  Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings:  - username: Langfuse Public Key - password: Langfuse Secret Key  ## Exports  - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
5 *
6 * The version of the OpenAPI document: 
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Trace {
16    /// The unique identifier of a trace
17    #[serde(rename = "id")]
18    pub id: String,
19    /// The timestamp when the trace was created
20    #[serde(rename = "timestamp")]
21    pub timestamp: String,
22    /// The name of the trace
23    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub name: Option<Option<String>>,
25    /// The input data of the trace. Can be any JSON.
26    #[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub input: Option<Option<serde_json::Value>>,
28    /// The output data of the trace. Can be any JSON.
29    #[serde(rename = "output", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub output: Option<Option<serde_json::Value>>,
31    /// The session identifier associated with the trace
32    #[serde(rename = "sessionId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub session_id: Option<Option<String>>,
34    /// The release version of the application when the trace was created
35    #[serde(rename = "release", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub release: Option<Option<String>>,
37    /// The version of the trace
38    #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub version: Option<Option<String>>,
40    /// The user identifier associated with the trace
41    #[serde(rename = "userId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub user_id: Option<Option<String>>,
43    /// The metadata associated with the trace. Can be any JSON.
44    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub metadata: Option<Option<serde_json::Value>>,
46    /// The tags associated with the trace. Can be an array of strings or null.
47    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub tags: Option<Option<Vec<String>>>,
49    /// Public traces are accessible via url without login
50    #[serde(rename = "public", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub public: Option<Option<bool>>,
52    /// The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
53    #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
54    pub environment: Option<Option<String>>,
55}
56
57impl Trace {
58    pub fn new(id: String, timestamp: String) -> Trace {
59        Trace {
60            id,
61            timestamp,
62            name: None,
63            input: None,
64            output: None,
65            session_id: None,
66            release: None,
67            version: None,
68            user_id: None,
69            metadata: None,
70            tags: None,
71            public: None,
72            environment: None,
73        }
74    }
75}
76