langfuse-client-base 0.13.0

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

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

/// UnstableUpdateEvaluationRuleRequest : Partial update body for an evaluation rule.  Provide only the fields you want to change. An empty body is rejected.  Practical guidance: - If you only want to rename the rule or change sampling, send just those fields. - If you change `evaluator`, send a fresh `mapping` unless you are certain the existing mapping still matches the evaluator variables. - If you change `target`, usually send both `filter` and `mapping` in the same request. - If you change an experiment `datasetId` filter, call `GET /api/public/v2/datasets` and use dataset `id` values from that response.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UnstableUpdateEvaluationRuleRequest {
    /// Updated deployment name.
    #[serde(
        rename = "name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<Option<String>>,
    #[serde(rename = "evaluator", skip_serializing_if = "Option::is_none")]
    pub evaluator: Option<Box<models::UnstableEvaluationRuleEvaluatorReference>>,
    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
    pub target: Option<models::UnstableEvaluationRuleTarget>,
    /// Updated desired enabled state.
    #[serde(
        rename = "enabled",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub enabled: Option<Option<bool>>,
    /// Updated sampling fraction.
    #[serde(
        rename = "sampling",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sampling: Option<Option<f64>>,
    /// Updated filter list.  For `target=experiment`, `column=datasetId` expects dataset `id` values from `GET /api/public/v2/datasets`, not dataset names.
    #[serde(
        rename = "filter",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub filter: Option<Option<Vec<models::UnstableEvaluationRuleFilter>>>,
    /// Updated variable mappings.
    #[serde(
        rename = "mapping",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mapping: Option<Option<Vec<models::UnstableEvaluationRuleMapping>>>,
}

impl UnstableUpdateEvaluationRuleRequest {
    /// Partial update body for an evaluation rule.  Provide only the fields you want to change. An empty body is rejected.  Practical guidance: - If you only want to rename the rule or change sampling, send just those fields. - If you change `evaluator`, send a fresh `mapping` unless you are certain the existing mapping still matches the evaluator variables. - If you change `target`, usually send both `filter` and `mapping` in the same request. - If you change an experiment `datasetId` filter, call `GET /api/public/v2/datasets` and use dataset `id` values from that response.
    pub fn new() -> UnstableUpdateEvaluationRuleRequest {
        UnstableUpdateEvaluationRuleRequest {
            name: None,
            evaluator: None,
            target: None,
            enabled: None,
            sampling: None,
            filter: None,
            mapping: None,
        }
    }
}