1use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5use std::collections::HashMap;
6
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
9#[serde(rename_all = "lowercase")]
10pub enum PrStatus {
11 Draft,
13 Open,
15 Merged,
17 Closed,
19}
20
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
23#[serde(rename_all = "lowercase")]
24pub enum IssueStatus {
25 Open,
27 InProgress,
29 Closed,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct FileChange {
36 pub path: String,
38 pub change_type: String,
40 pub additions: u32,
42 pub deletions: u32,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48pub struct PullRequest {
49 pub id: u64,
51 pub number: u32,
53 pub title: String,
55 pub body: String,
57 pub branch: String,
59 pub base: String,
61 pub status: PrStatus,
63 pub files: Vec<FileChange>,
65 pub created_at: DateTime<Utc>,
67 pub updated_at: DateTime<Utc>,
69}
70
71#[derive(Debug, Clone, Serialize, Deserialize)]
73pub struct Issue {
74 pub id: u64,
76 pub number: u32,
78 pub title: String,
80 pub body: String,
82 pub labels: Vec<String>,
84 pub assignees: Vec<String>,
86 pub status: IssueStatus,
88 pub created_at: DateTime<Utc>,
90 pub updated_at: DateTime<Utc>,
92}
93
94#[derive(Debug, Clone, Serialize, Deserialize)]
96pub struct Dependency {
97 pub name: String,
99 pub version: String,
101 pub latest_version: Option<String>,
103 pub is_outdated: bool,
105}
106
107#[derive(Debug, Clone, Serialize, Deserialize)]
109pub struct ProjectStructure {
110 pub language: Option<String>,
112 pub project_type: String,
114 pub directories: Vec<String>,
116 pub files: Vec<String>,
118}
119
120#[derive(Debug, Clone, Serialize, Deserialize)]
122pub struct Repository {
123 pub name: String,
125 pub owner: String,
127 pub description: String,
129 pub url: String,
131 pub language: Option<String>,
133 pub dependencies: Vec<Dependency>,
135 pub structure: ProjectStructure,
137}
138
139#[derive(Debug, Clone, Serialize, Deserialize)]
141pub struct ProjectCard {
142 pub id: u64,
144 pub content_id: u64,
146 pub content_type: String,
148 pub column_id: u64,
150 pub note: Option<String>,
152}
153
154#[derive(Debug, Clone, Serialize, Deserialize)]
156pub struct Release {
157 pub id: u64,
159 pub tag_name: String,
161 pub name: String,
163 pub body: String,
165 pub draft: bool,
167 pub prerelease: bool,
169 pub created_at: DateTime<Utc>,
171}
172
173#[derive(Debug, Clone, Serialize, Deserialize)]
175pub struct GistFile {
176 pub filename: String,
178 pub content: String,
180 pub language: Option<String>,
182}
183
184#[derive(Debug, Clone, Serialize, Deserialize)]
186pub struct Gist {
187 pub id: String,
189 pub url: String,
191 pub files: HashMap<String, GistFile>,
193 pub description: String,
195 pub public: bool,
197}
198
199#[derive(Debug, Clone, Serialize, Deserialize)]
201pub struct Discussion {
202 pub id: u64,
204 pub number: u32,
206 pub title: String,
208 pub body: String,
210 pub category: String,
212 pub created_at: DateTime<Utc>,
214 pub updated_at: DateTime<Utc>,
216}
217
218#[derive(Debug, Clone, Serialize, Deserialize)]
220pub struct IssueProgressUpdate {
221 pub issue_number: u32,
223 pub message: String,
225 pub status: IssueStatus,
227 pub progress_percentage: u32,
229}