langfuse_client/models/
get_scores_response_data_boolean.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)]
15#[cfg_attr(feature="bon", derive(bon::Builder))]
16pub struct GetScoresResponseDataBoolean {
17    #[serde(rename = "trace")]
18    pub trace: models::GetScoresResponseTraceData,
19    /// The numeric value of the score. Equals 1 for \"True\" and 0 for \"False\"
20    #[serde(rename = "value")]
21    pub value: f64,
22    /// The string representation of the score value. Is inferred from the numeric value and equals \"True\" or \"False\"
23    #[serde(rename = "stringValue")]
24    pub string_value: String,
25    #[serde(rename = "id")]
26    pub id: String,
27    #[serde(rename = "traceId")]
28    pub trace_id: String,
29    #[serde(rename = "name")]
30    pub name: String,
31    #[serde(rename = "source")]
32    pub source: models::ScoreSource,
33    #[serde(rename = "observationId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub observation_id: Option<Option<String>>,
35    #[serde(rename = "timestamp")]
36    pub timestamp: String,
37    #[serde(rename = "createdAt")]
38    pub created_at: String,
39    #[serde(rename = "updatedAt")]
40    pub updated_at: String,
41    #[serde(rename = "authorUserId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub author_user_id: Option<Option<String>>,
43    #[serde(rename = "comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub comment: Option<Option<String>>,
45    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub metadata: Option<Option<serde_json::Value>>,
47    /// Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range
48    #[serde(rename = "configId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub config_id: Option<Option<String>>,
50    /// Reference an annotation queue on a score. Populated if the score was initially created in an annotation queue.
51    #[serde(rename = "queueId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
52    pub queue_id: Option<Option<String>>,
53    /// The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
54    #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
55    pub environment: Option<Option<String>>,
56}
57
58impl GetScoresResponseDataBoolean {
59    pub fn new(trace: models::GetScoresResponseTraceData, value: f64, string_value: String, id: String, trace_id: String, name: String, source: models::ScoreSource, timestamp: String, created_at: String, updated_at: String) -> GetScoresResponseDataBoolean {
60        GetScoresResponseDataBoolean {
61            trace,
62            value,
63            string_value,
64            id,
65            trace_id,
66            name,
67            source,
68            observation_id: None,
69            timestamp,
70            created_at,
71            updated_at,
72            author_user_id: None,
73            comment: None,
74            metadata: None,
75            config_id: None,
76            queue_id: None,
77            environment: None,
78        }
79    }
80}
81