use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PrReviewDocument { pub meta: PrMeta, pub commits: Vec, pub diff_stat: DiffStat, pub reviews: Vec, pub threads: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PrMeta { pub repo: String, pub pr_index: i64, pub title: String, pub description: Option, pub fetched_at: Option, pub state: String, pub author: String, pub base_branch: String, pub head_branch: String, pub created_at: String, pub updated_at: String, pub merged_at: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CommitItem { pub sha: String, pub short_sha: String, pub title: String, pub author: String, pub date: String, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DiffStat { pub files_changed: usize, pub additions: i64, pub deletions: i64, pub files: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct FileStat { pub path: String, pub additions: i64, pub deletions: i64, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ReviewItem { pub id: i64, pub state: String, pub reviewer: String, pub submitted_at: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CommentThread { pub thread_id: String, pub file_path: Option, pub line: Option, pub root_comment: CommentItem, pub replies: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CommentItem { pub id: i64, pub review_id: Option, pub user: String, pub created_at: String, pub path: Option, pub line: Option, pub body: String, }