Skip to main content

langfuse_client_base/models/
unstable_topic_assignment.rs

1#![allow(deprecated)]
2/*
3 * server
4 *
5 * ## Real-time data  The only real-time path to get tracing data is to ingest via OpenTelemetry (`POST /api/public/otel/v1/traces`) and retrieve via Observations API v2 (`GET /api/public/v2/observations`) and Metrics API v2 (`GET /api/public/v2/metrics`). Other public API write and read endpoints can delay data by about 10 minutes. Direct OpenTelemetry exporters must send the `x-langfuse-ingestion-version: 4` header; current Python and JS SDKs already do. See the [Public API docs](https://langfuse.com/docs/api-and-data-platform/features/public-api) and [real-time ingestion](https://langfuse.com/integrations/native/opentelemetry.md#real-time-ingestion).  ## 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 - Self-hosted deployments: interactive API reference at `/api/docs` and OpenAPI spec at `/api/openapi.yaml`
6 *
7 * The version of the OpenAPI document:
8 *
9 * Generated by: https://openapi-generator.tech
10 */
11
12use crate::models;
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
16pub struct UnstableTopicAssignment {
17    #[serde(rename = "traceId")]
18    pub trace_id: String,
19    /// Trace start time.
20    #[serde(rename = "timestamp")]
21    pub timestamp: jiff::Timestamp,
22    #[serde(rename = "facetId")]
23    pub facet_id: String,
24    #[serde(rename = "facetName")]
25    pub facet_name: String,
26    #[serde(rename = "facetVersion")]
27    pub facet_version: i64,
28    /// The rule whose map assigned the trace. Null when the project has no rule.
29    #[serde(
30        rename = "ruleId",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub rule_id: Option<Option<String>>,
36    #[serde(rename = "status")]
37    pub status: models::UnstableTopicAssignmentStatus,
38    #[serde(rename = "topic", skip_serializing_if = "Option::is_none")]
39    pub topic: Option<models::UnstableTopicAssignmentTopic>,
40    /// The run that assigned the trace. Null for assignments made as traces arrive.
41    #[serde(
42        rename = "runId",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub run_id: Option<Option<String>>,
48    #[serde(rename = "assignedAt")]
49    pub assigned_at: jiff::Timestamp,
50}
51
52impl UnstableTopicAssignment {
53    pub fn new(
54        trace_id: String,
55        timestamp: jiff::Timestamp,
56        facet_id: String,
57        facet_name: String,
58        facet_version: i64,
59        status: models::UnstableTopicAssignmentStatus,
60        assigned_at: jiff::Timestamp,
61    ) -> UnstableTopicAssignment {
62        UnstableTopicAssignment {
63            trace_id,
64            timestamp,
65            facet_id,
66            facet_name,
67            facet_version,
68            rule_id: None,
69            status,
70            topic: None,
71            run_id: None,
72            assigned_at,
73        }
74    }
75}
76
77impl crate::models::validation::Validate for UnstableTopicAssignment {
78    fn validate_into(
79        &self,
80        _path: &crate::models::validation::Path<'_>,
81        _errors: &mut Vec<crate::models::validation::ValidationError>,
82    ) {
83    }
84}