langfuse-client 0.1.22

## 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
Documentation
/*
 * langfuse
 *
 * ## 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
 *
 * The version of the OpenAPI document: 
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature="bon", derive(bon::Builder))]
pub struct Trace {
    /// The unique identifier of a trace
    #[serde(rename = "id")]
    pub id: String,
    /// The timestamp when the trace was created
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The name of the trace
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    /// The input data of the trace. Can be any JSON.
    #[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub input: Option<Option<serde_json::Value>>,
    /// The output data of the trace. Can be any JSON.
    #[serde(rename = "output", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub output: Option<Option<serde_json::Value>>,
    /// The session identifier associated with the trace
    #[serde(rename = "sessionId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub session_id: Option<Option<String>>,
    /// The release version of the application when the trace was created
    #[serde(rename = "release", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub release: Option<Option<String>>,
    /// The version of the trace
    #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub version: Option<Option<String>>,
    /// The user identifier associated with the trace
    #[serde(rename = "userId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<Option<String>>,
    /// The metadata associated with the trace. Can be any JSON.
    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Option<serde_json::Value>>,
    /// The tags associated with the trace. Can be an array of strings or null.
    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Option<Vec<String>>>,
    /// Public traces are accessible via url without login
    #[serde(rename = "public", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub public: Option<Option<bool>>,
    /// The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
    #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub environment: Option<Option<String>>,
}

impl Trace {
    pub fn new(id: String, timestamp: String) -> Trace {
        Trace {
            id,
            timestamp,
            name: None,
            input: None,
            output: None,
            session_id: None,
            release: None,
            version: None,
            user_id: None,
            metadata: None,
            tags: None,
            public: None,
            environment: None,
        }
    }
}