Skip to main content

langfuse_client_base/models/
unstable_public_api_error_code.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/// UnstablePublicApiErrorCode : Machine-readable error code returned by the unstable evaluators API.  SDKs, CLIs, and agents should branch on `code` rather than parsing the human-readable `message`. The HTTP status still indicates the broad error class, while `code` gives the specific failure reason.
15/// Machine-readable error code returned by the unstable evaluators API.  SDKs, CLIs, and agents should branch on `code` rather than parsing the human-readable `message`. The HTTP status still indicates the broad error class, while `code` gives the specific failure reason.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum UnstablePublicApiErrorCode {
18    #[serde(rename = "authentication_failed")]
19    AuthenticationFailed,
20    #[serde(rename = "access_denied")]
21    AccessDenied,
22    #[serde(rename = "invalid_request")]
23    InvalidRequest,
24    #[serde(rename = "invalid_query")]
25    InvalidQuery,
26    #[serde(rename = "invalid_body")]
27    InvalidBody,
28    #[serde(rename = "invalid_filter_value")]
29    InvalidFilterValue,
30    #[serde(rename = "invalid_json_path")]
31    InvalidJsonPath,
32    #[serde(rename = "invalid_variable_mapping")]
33    InvalidVariableMapping,
34    #[serde(rename = "missing_variable_mapping")]
35    MissingVariableMapping,
36    #[serde(rename = "duplicate_variable_mapping")]
37    DuplicateVariableMapping,
38    #[serde(rename = "resource_not_found")]
39    ResourceNotFound,
40    #[serde(rename = "name_conflict")]
41    NameConflict,
42    #[serde(rename = "evaluator_preflight_failed")]
43    EvaluatorPreflightFailed,
44    #[serde(rename = "conflict")]
45    Conflict,
46    #[serde(rename = "unprocessable_content")]
47    UnprocessableContent,
48    #[serde(rename = "rate_limited")]
49    RateLimited,
50    #[serde(rename = "method_not_allowed")]
51    MethodNotAllowed,
52    #[serde(rename = "internal_error")]
53    InternalError,
54}
55
56impl std::fmt::Display for UnstablePublicApiErrorCode {
57    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
58        match self {
59            Self::AuthenticationFailed => write!(f, "authentication_failed"),
60            Self::AccessDenied => write!(f, "access_denied"),
61            Self::InvalidRequest => write!(f, "invalid_request"),
62            Self::InvalidQuery => write!(f, "invalid_query"),
63            Self::InvalidBody => write!(f, "invalid_body"),
64            Self::InvalidFilterValue => write!(f, "invalid_filter_value"),
65            Self::InvalidJsonPath => write!(f, "invalid_json_path"),
66            Self::InvalidVariableMapping => write!(f, "invalid_variable_mapping"),
67            Self::MissingVariableMapping => write!(f, "missing_variable_mapping"),
68            Self::DuplicateVariableMapping => write!(f, "duplicate_variable_mapping"),
69            Self::ResourceNotFound => write!(f, "resource_not_found"),
70            Self::NameConflict => write!(f, "name_conflict"),
71            Self::EvaluatorPreflightFailed => write!(f, "evaluator_preflight_failed"),
72            Self::Conflict => write!(f, "conflict"),
73            Self::UnprocessableContent => write!(f, "unprocessable_content"),
74            Self::RateLimited => write!(f, "rate_limited"),
75            Self::MethodNotAllowed => write!(f, "method_not_allowed"),
76            Self::InternalError => write!(f, "internal_error"),
77        }
78    }
79}
80
81impl Default for UnstablePublicApiErrorCode {
82    fn default() -> UnstablePublicApiErrorCode {
83        Self::AuthenticationFailed
84    }
85}