langfuse_client_base/models/
session_with_traces.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 SessionWithTraces {
16    #[serde(rename = "traces")]
17    pub traces: Vec<models::Trace>,
18    #[serde(rename = "id")]
19    pub id: String,
20    #[serde(rename = "createdAt")]
21    pub created_at: String,
22    #[serde(rename = "projectId")]
23    pub project_id: String,
24    /// The environment from which this session originated.
25    #[serde(
26        rename = "environment",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub environment: Option<Option<String>>,
32}
33
34impl SessionWithTraces {
35    pub fn new(
36        traces: Vec<models::Trace>,
37        id: String,
38        created_at: String,
39        project_id: String,
40    ) -> SessionWithTraces {
41        SessionWithTraces {
42            traces,
43            id,
44            created_at,
45            project_id,
46            environment: None,
47        }
48    }
49}