langfuse_client_base/models/
create_event_event.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 CreateEventEvent {
16    #[serde(rename = "body")]
17    pub body: Box<models::CreateEventBody>,
18    /// UUID v4 that identifies the event
19    #[serde(rename = "id")]
20    pub id: String,
21    /// Datetime (ISO 8601) of event creation in client. Should be as close to actual event creation in client as possible, this timestamp will be used for ordering of events in future release. Resolution: milliseconds (required), microseconds (optimal).
22    #[serde(rename = "timestamp")]
23    pub timestamp: String,
24    /// Optional. Metadata field used by the Langfuse SDKs for debugging.
25    #[serde(
26        rename = "metadata",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub metadata: Option<Option<serde_json::Value>>,
32}
33
34impl CreateEventEvent {
35    pub fn new(body: models::CreateEventBody, id: String, timestamp: String) -> CreateEventEvent {
36        CreateEventEvent {
37            body: Box::new(body),
38            id,
39            timestamp,
40            metadata: None,
41        }
42    }
43}