langfuse-client-base 0.16.0

Auto-generated Langfuse API client from OpenAPI specification
Documentation
/*
 * server
 *
 * ## 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`
 *
 * The version of the OpenAPI document:
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct CodeEvaluator1 {
    /// Stable identifier of this evaluator across all versions.
    #[serde(rename = "id")]
    pub id: String,
    /// Human-readable evaluator name. Names are not identifiers and do not need to be unique.
    #[serde(rename = "name")]
    pub name: String,
    /// Optional human-readable evaluator description.
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    #[serde(rename = "createdBy")]
    pub created_by: Box<models::Creator>,
    #[serde(rename = "status")]
    pub status: models::EvaluatorStatus,
    /// Timestamp when the evaluator was paused, otherwise `null`.
    #[serde(rename = "pausedAt", deserialize_with = "Option::deserialize")]
    pub paused_at: Option<chrono::DateTime<chrono::FixedOffset>>,
    /// Machine-readable reason when `status=paused`, otherwise `null`.
    #[serde(rename = "pausedReason", deserialize_with = "Option::deserialize")]
    pub paused_reason: Option<String>,
    /// Human-readable explanation when `status=paused`, otherwise `null`.
    #[serde(rename = "pausedMessage", deserialize_with = "Option::deserialize")]
    pub paused_message: Option<String>,
    /// All modern and legacy evaluation-rule assignments in newest-assignment-first order. Rule-specific mappings are exposed as `variableMappingOverride`; inherited defaults are omitted.
    #[serde(rename = "evaluationRuleAssignments")]
    pub evaluation_rule_assignments: Vec<models::EvaluationRuleAssignment>,
    /// Timestamp when the evaluator was created.
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    /// Timestamp when the evaluator was last updated.
    #[serde(rename = "updatedAt")]
    pub updated_at: chrono::DateTime<chrono::FixedOffset>,
    /// Stable identifier of the latest evaluator version.
    #[serde(rename = "versionId")]
    pub version_id: String,
    /// Monotonically increasing latest evaluator version number.
    #[serde(rename = "version")]
    pub version: i32,
    /// Timestamp when the latest evaluator version was created.
    #[serde(rename = "versionCreatedAt")]
    pub version_created_at: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "versionCreatedBy")]
    pub version_created_by: Box<models::Creator>,
    #[serde(rename = "type")]
    pub r#type: Type,
    /// Source code executed by the latest evaluator version.
    #[serde(rename = "sourceCode")]
    pub source_code: String,
    #[serde(rename = "sourceCodeLanguage")]
    pub source_code_language: models::CodeEvaluatorSourceCodeLanguage,
}

impl CodeEvaluator1 {
    pub fn new(
        id: String,
        name: String,
        description: Option<String>,
        created_by: models::Creator,
        status: models::EvaluatorStatus,
        paused_at: Option<chrono::DateTime<chrono::FixedOffset>>,
        paused_reason: Option<String>,
        paused_message: Option<String>,
        evaluation_rule_assignments: Vec<models::EvaluationRuleAssignment>,
        created_at: chrono::DateTime<chrono::FixedOffset>,
        updated_at: chrono::DateTime<chrono::FixedOffset>,
        version_id: String,
        version: i32,
        version_created_at: chrono::DateTime<chrono::FixedOffset>,
        version_created_by: models::Creator,
        r#type: Type,
        source_code: String,
        source_code_language: models::CodeEvaluatorSourceCodeLanguage,
    ) -> CodeEvaluator1 {
        CodeEvaluator1 {
            id,
            name,
            description,
            created_by: Box::new(created_by),
            status,
            paused_at,
            paused_reason,
            paused_message,
            evaluation_rule_assignments,
            created_at,
            updated_at,
            version_id,
            version,
            version_created_at,
            version_created_by: Box::new(version_created_by),
            r#type,
            source_code,
            source_code_language,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "code")]
    Code,
}

impl Default for Type {
    fn default() -> Type {
        Self::Code
    }
}