Skip to main content

langfuse_client_base/models/
unstable_public_api_error.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
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/// UnstablePublicApiError : Standard error envelope for the unstable evaluators API.  Response handling guidance: - Use the HTTP status code for the broad class of failure. - Use `code` for precise branching in SDKs, CLIs, or agents. - Inspect `details` for field-level validation context such as invalid filter values, malformed JSONPath expressions, or missing variable mappings. - Retry only after fixing the specific issue described by `code` and `details`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
16pub struct UnstablePublicApiError {
17    /// Human-readable description of the failure.
18    #[serde(rename = "message")]
19    pub message: String,
20    #[serde(rename = "code")]
21    pub code: models::UnstablePublicApiErrorCode,
22    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
23    pub details: Option<Box<models::UnstablePublicApiErrorDetails>>,
24}
25
26impl UnstablePublicApiError {
27    /// Standard error envelope for the unstable evaluators API.  Response handling guidance: - Use the HTTP status code for the broad class of failure. - Use `code` for precise branching in SDKs, CLIs, or agents. - Inspect `details` for field-level validation context such as invalid filter values, malformed JSONPath expressions, or missing variable mappings. - Retry only after fixing the specific issue described by `code` and `details`.
28    pub fn new(
29        message: String,
30        code: models::UnstablePublicApiErrorCode,
31    ) -> UnstablePublicApiError {
32        UnstablePublicApiError {
33            message,
34            code,
35            details: None,
36        }
37    }
38}