langfuse-client-base 0.15.0

Auto-generated Langfuse API client from OpenAPI specification
Documentation
/*
 * server
 *
 * ## 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 UnstableCreateEvaluationRuleWithEvaluatorsRequest {
    /// Human-readable deployment name.
    #[serde(rename = "name")]
    pub name: String,
    /// One or more evaluator assignments. Providing the deprecated top-level `evaluator` or `mapping` fields alongside this is rejected with `400`.  Multiple assignments are supported on writable targets.
    #[serde(rename = "evaluators")]
    pub evaluators: Vec<models::UnstableCreateEvaluationRuleEvaluatorAssignment>,
    #[serde(rename = "target")]
    pub target: models::UnstableEvaluationRuleTarget,
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[serde(
        rename = "sampling",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sampling: Option<Option<f64>>,
    #[serde(
        rename = "filter",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub filter: Option<Option<Vec<models::UnstableEvaluationRuleFilter>>>,
}

impl UnstableCreateEvaluationRuleWithEvaluatorsRequest {
    pub fn new(
        name: String,
        evaluators: Vec<models::UnstableCreateEvaluationRuleEvaluatorAssignment>,
        target: models::UnstableEvaluationRuleTarget,
        enabled: bool,
    ) -> UnstableCreateEvaluationRuleWithEvaluatorsRequest {
        UnstableCreateEvaluationRuleWithEvaluatorsRequest {
            name,
            evaluators,
            target,
            enabled,
            sampling: None,
            filter: None,
        }
    }
}