langfuse_client_base/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(
40        project_id: String,
41        object_type: String,
42        object_id: String,
43        content: String,
44    ) -> CreateCommentRequest {
45        CreateCommentRequest {
46            project_id,
47            object_type,
48            object_id,
49            content,
50            author_user_id: None,
51        }
52    }
53}