langfuse_rs/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(
30		rename = "authorUserId",
31		default,
32		with = "::serde_with::rust::double_option",
33		skip_serializing_if = "Option::is_none"
34	)]
35	pub author_user_id: Option<Option<String>>,
36}
37
38impl CreateCommentRequest {
39	pub fn new(project_id: String, object_type: String, object_id: String, content: String) -> CreateCommentRequest {
40		CreateCommentRequest {
41			project_id,
42			object_type,
43			object_id,
44			content,
45			author_user_id: None,
46		}
47	}
48}