langfuse-client-base 0.12.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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct PromptMeta {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "type")]
    pub r#type: models::PromptType,
    #[serde(rename = "versions")]
    pub versions: Vec<i32>,
    #[serde(rename = "labels")]
    pub labels: Vec<String>,
    #[serde(rename = "tags")]
    pub tags: Vec<String>,
    #[serde(rename = "lastUpdatedAt")]
    pub last_updated_at: String,
    /// Config object of the most recent prompt version that matches the filters (if any are provided)
    #[serde(rename = "lastConfig", deserialize_with = "Option::deserialize")]
    pub last_config: Option<serde_json::Value>,
}

impl PromptMeta {
    pub fn new(
        name: String,
        r#type: models::PromptType,
        versions: Vec<i32>,
        labels: Vec<String>,
        tags: Vec<String>,
        last_updated_at: String,
        last_config: Option<serde_json::Value>,
    ) -> PromptMeta {
        PromptMeta {
            name,
            r#type,
            versions,
            labels,
            tags,
            last_updated_at,
            last_config,
        }
    }
}