use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Default, PartialEq)]
pub struct InputComment {
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reply_to_comment_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
}
pub type CreateCommentBody = InputComment;
#[derive(Debug, Clone, Serialize, Default, PartialEq)]
pub struct UpdateCommentBody {
pub comment: InputComment,
pub update_fields: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct CommentCreator {
#[serde(default)]
pub id: Option<String>,
#[serde(default)]
pub r#type: Option<String>,
#[serde(default)]
pub role: Option<String>,
#[serde(default)]
pub name: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct CommentItem {
#[serde(default)]
pub id: Option<String>,
#[serde(default)]
pub content: Option<String>,
#[serde(default)]
pub creator: Option<CommentCreator>,
#[serde(default)]
pub reply_to_comment_id: Option<String>,
#[serde(default)]
pub created_at: Option<String>,
#[serde(default)]
pub updated_at: Option<String>,
#[serde(default)]
pub resource_type: Option<String>,
#[serde(default)]
pub resource_id: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CreateCommentResponse {
pub comment: CommentItem,
}
#[derive(Debug, Clone, Deserialize)]
pub struct GetCommentResponse {
pub comment: CommentItem,
}
#[derive(Debug, Clone, Deserialize)]
pub struct UpdateCommentResponse {
pub comment: CommentItem,
}
#[derive(Debug, Clone, Deserialize, Default)]
pub struct DeleteCommentResponse {}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct ListCommentsResponse {
#[serde(default)]
pub has_more: bool,
#[serde(default)]
pub page_token: Option<String>,
#[serde(default)]
pub items: Vec<CommentItem>,
}