1use serde::Deserialize;
2
3#[derive(Debug, Clone, Deserialize)]
5pub struct PrFile {
6 pub filename: String,
7 pub patch: Option<String>,
8 #[serde(default)]
9 pub additions: u32,
10 #[serde(default)]
11 pub deletions: u32,
12 #[serde(default)]
13 pub status: String,
14}
15
16#[derive(Debug, Clone, Deserialize)]
18pub struct PrMetadata {
19 pub number: u32,
20 pub title: String,
21 pub body: Option<String>,
22 pub user: Option<PrUser>,
23 pub head: PrHead,
24 pub base: PrBase,
25}
26
27#[derive(Debug, Clone, Deserialize)]
29pub struct PrHead {
30 pub sha: String,
31}
32
33#[derive(Debug, Clone, Deserialize)]
35pub struct PrBase {
36 #[serde(rename = "ref")]
38 pub ref_name: String,
39}
40
41#[derive(Debug, Clone, Deserialize)]
43pub struct Tag {
44 pub name: String,
45 pub commit: TagCommit,
46}
47
48#[derive(Debug, Clone, Deserialize)]
49pub struct TagCommit {
50 pub sha: String,
51}
52
53#[derive(Debug, Clone, Deserialize)]
55pub struct CommitVerification {
56 pub verified: bool,
57 pub reason: String,
58}
59
60#[derive(Debug, Clone, Deserialize)]
62pub struct CommitAuthor {
63 pub login: String,
64}
65
66#[derive(Debug, Clone, Deserialize)]
68pub struct CompareCommitInner {
69 pub message: String,
70 pub verification: CommitVerification,
71}
72
73#[derive(Debug, Clone, Deserialize)]
75pub struct CommitParent {
76 pub sha: String,
77}
78
79#[derive(Debug, Clone, Deserialize)]
81pub struct CompareCommit {
82 pub sha: String,
83 pub commit: CompareCommitInner,
84 pub author: Option<CommitAuthor>,
85 #[serde(default)]
86 pub parents: Vec<CommitParent>,
87}
88
89#[derive(Debug, Clone, Deserialize)]
91pub struct CompareResponse {
92 pub commits: Vec<CompareCommit>,
93}
94
95#[derive(Debug, Clone, Deserialize)]
97pub struct PullRequestSummary {
98 pub number: u32,
99 pub merged_at: Option<String>,
100 pub user: PrUser,
101}
102
103#[derive(Debug, Clone, Deserialize)]
105pub struct PrUser {
106 pub login: String,
107}
108
109#[derive(Debug, Clone, Deserialize)]
111pub struct Release {
112 pub tag_name: String,
113 pub assets: Vec<ReleaseAsset>,
114}
115
116#[derive(Debug, Clone, Deserialize)]
118pub struct ReleaseAsset {
119 pub name: String,
120 pub browser_download_url: String,
121}
122
123#[derive(Debug, Clone, Deserialize)]
125pub struct Review {
126 pub user: PrUser,
127 pub state: String,
128 pub submitted_at: Option<String>,
129 #[serde(default)]
132 pub body: Option<String>,
133}
134
135#[derive(Debug, Clone, Deserialize)]
137pub struct PrCommit {
138 pub sha: String,
139 pub commit: PrCommitInner,
140 pub author: Option<PrUser>,
141}
142
143#[derive(Debug, Clone, Deserialize)]
145pub struct PrCommitInner {
146 pub committer: Option<PrCommitAuthor>,
147 pub verification: Option<CommitVerification>,
148}
149
150#[derive(Debug, Clone, Deserialize)]
152pub struct PrCommitAuthor {
153 pub date: Option<String>,
154}
155
156#[derive(Debug, Clone, Deserialize)]
158pub struct CheckRunApp {
159 pub slug: String,
160}
161
162#[derive(Debug, Clone, Deserialize)]
164pub struct CheckRunItem {
165 pub name: String,
166 pub status: String,
168 pub conclusion: Option<String>,
170 pub app: Option<CheckRunApp>,
172}
173
174#[derive(Debug, Clone, Deserialize)]
176pub struct CombinedStatusResponse {
177 pub state: String,
178 pub statuses: Vec<CommitStatusItem>,
179}
180
181#[derive(Debug, Clone, Deserialize)]
183pub struct CommitStatusItem {
184 pub context: String,
185 pub state: String,
186}
187
188#[derive(Debug, Clone, Deserialize)]
190pub struct SearchResponse<T> {
191 pub total_count: u32,
192 pub items: Vec<T>,
193}
194
195#[derive(Debug, Clone, Deserialize)]
197pub struct SearchPrItem {
198 pub number: u32,
199 pub pull_request: Option<SearchPrMeta>,
200}
201
202#[derive(Debug, Clone, Deserialize)]
204pub struct SearchPrMeta {
205 pub merged_at: Option<String>,
206}