openlark_workflow/v2/comment/
models.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Default, PartialEq)]
7pub struct InputComment {
8 #[serde(skip_serializing_if = "Option::is_none")]
10 pub content: Option<String>,
11 #[serde(skip_serializing_if = "Option::is_none")]
13 pub reply_to_comment_id: Option<String>,
14 #[serde(skip_serializing_if = "Option::is_none")]
16 pub resource_type: Option<String>,
17 #[serde(skip_serializing_if = "Option::is_none")]
19 pub resource_id: Option<String>,
20}
21
22pub type CreateCommentBody = InputComment;
24
25#[derive(Debug, Clone, Serialize, Default, PartialEq)]
27pub struct UpdateCommentBody {
28 pub comment: InputComment,
30 pub update_fields: Vec<String>,
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
36pub struct CommentCreator {
37 #[serde(default)]
39 pub id: Option<String>,
40 #[serde(default)]
42 pub r#type: Option<String>,
43 #[serde(default)]
45 pub role: Option<String>,
46 #[serde(default)]
48 pub name: Option<String>,
49}
50
51#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
53pub struct CommentItem {
54 #[serde(default)]
56 pub id: Option<String>,
57 #[serde(default)]
59 pub content: Option<String>,
60 #[serde(default)]
62 pub creator: Option<CommentCreator>,
63 #[serde(default)]
65 pub reply_to_comment_id: Option<String>,
66 #[serde(default)]
68 pub created_at: Option<String>,
69 #[serde(default)]
71 pub updated_at: Option<String>,
72 #[serde(default)]
74 pub resource_type: Option<String>,
75 #[serde(default)]
77 pub resource_id: Option<String>,
78}
79
80#[derive(Debug, Clone, Deserialize)]
82pub struct CreateCommentResponse {
83 pub comment: CommentItem,
85}
86
87#[derive(Debug, Clone, Deserialize)]
89pub struct GetCommentResponse {
90 pub comment: CommentItem,
92}
93
94#[derive(Debug, Clone, Deserialize)]
96pub struct UpdateCommentResponse {
97 pub comment: CommentItem,
99}
100
101#[derive(Debug, Clone, Deserialize, Default)]
103pub struct DeleteCommentResponse {}
104
105#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
107pub struct ListCommentsResponse {
108 #[serde(default)]
110 pub has_more: bool,
111 #[serde(default)]
113 pub page_token: Option<String>,
114 #[serde(default)]
116 pub items: Vec<CommentItem>,
117}