langfuse_client/models/
create_comment_request.rs

1/*
2 * langfuse
3 *
4 * ## 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 - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
5 *
6 * The version of the OpenAPI document: 
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateCommentRequest {
16    /// The id of the project to attach the comment to.
17    #[serde(rename = "projectId")]
18    pub project_id: String,
19    /// The type of the object to attach the comment to (trace, observation, session, prompt).
20    #[serde(rename = "objectType")]
21    pub object_type: String,
22    /// The id of the object to attach the comment to. If this does not reference a valid existing object, an error will be thrown.
23    #[serde(rename = "objectId")]
24    pub object_id: String,
25    /// The content of the comment. May include markdown. Currently limited to 3000 characters.
26    #[serde(rename = "content")]
27    pub content: String,
28    /// The id of the user who created the comment.
29    #[serde(rename = "authorUserId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub author_user_id: Option<Option<String>>,
31}
32
33impl CreateCommentRequest {
34    pub fn new(project_id: String, object_type: String, object_id: String, content: String) -> CreateCommentRequest {
35        CreateCommentRequest {
36            project_id,
37            object_type,
38            object_id,
39            content,
40            author_user_id: None,
41        }
42    }
43}
44