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 Comment {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "projectId")]
    pub project_id: String,
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
    #[serde(rename = "objectType")]
    pub object_type: models::CommentObjectType,
    #[serde(rename = "objectId")]
    pub object_id: String,
    #[serde(rename = "content")]
    pub content: String,
    /// The user ID of the comment author
    #[serde(
        rename = "authorUserId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub author_user_id: Option<Option<String>>,
}

impl Comment {
    pub fn new(
        id: String,
        project_id: String,
        created_at: String,
        updated_at: String,
        object_type: models::CommentObjectType,
        object_id: String,
        content: String,
    ) -> Comment {
        Comment {
            id,
            project_id,
            created_at,
            updated_at,
            object_type,
            object_id,
            content,
            author_user_id: None,
        }
    }
}