use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct TraceWithFullDetails {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "timestamp")]
pub timestamp: String,
#[serde(
rename = "name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub name: Option<Option<String>>,
#[serde(
rename = "input",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub input: Option<Option<serde_json::Value>>,
#[serde(
rename = "output",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub output: Option<Option<serde_json::Value>>,
#[serde(
rename = "sessionId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub session_id: Option<Option<String>>,
#[serde(
rename = "release",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub release: Option<Option<String>>,
#[serde(
rename = "version",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub version: Option<Option<String>>,
#[serde(
rename = "userId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub user_id: Option<Option<String>>,
#[serde(
rename = "metadata",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub metadata: Option<Option<serde_json::Value>>,
#[serde(rename = "tags")]
pub tags: Vec<String>,
#[serde(rename = "public")]
pub public: bool,
#[serde(rename = "environment")]
pub environment: String,
#[serde(rename = "htmlPath")]
pub html_path: String,
#[serde(
rename = "latency",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub latency: Option<Option<f64>>,
#[serde(
rename = "totalCost",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub total_cost: Option<Option<f64>>,
#[serde(rename = "observations")]
pub observations: Vec<models::ObservationsView>,
#[serde(rename = "scores")]
pub scores: Vec<models::ScoreV1>,
}
impl TraceWithFullDetails {
pub fn new(
id: String,
timestamp: String,
tags: Vec<String>,
public: bool,
environment: String,
html_path: String,
observations: Vec<models::ObservationsView>,
scores: Vec<models::ScoreV1>,
) -> TraceWithFullDetails {
TraceWithFullDetails {
id,
timestamp,
name: None,
input: None,
output: None,
session_id: None,
release: None,
version: None,
user_id: None,
metadata: None,
tags,
public,
environment,
html_path,
latency: None,
total_cost: None,
observations,
scores,
}
}
}