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 PullRequestListItem {
44 pub number: u32,
45 pub title: String,
46 pub merged_at: Option<String>,
47}
48
49#[derive(Debug, Clone, Deserialize)]
51pub struct Tag {
52 pub name: String,
53 pub commit: TagCommit,
54}
55
56#[derive(Debug, Clone, Deserialize)]
57pub struct TagCommit {
58 pub sha: String,
59}
60
61#[derive(Debug, Clone, Deserialize)]
63pub struct CommitVerification {
64 pub verified: bool,
65 pub reason: String,
66}
67
68#[derive(Debug, Clone, Deserialize)]
70pub struct CommitAuthor {
71 pub login: String,
72}
73
74#[derive(Debug, Clone, Deserialize)]
76pub struct CompareCommitInner {
77 pub message: String,
78 pub verification: CommitVerification,
79}
80
81#[derive(Debug, Clone, Deserialize)]
83pub struct CommitParent {
84 pub sha: String,
85}
86
87#[derive(Debug, Clone, Deserialize)]
89pub struct CompareCommit {
90 pub sha: String,
91 pub commit: CompareCommitInner,
92 pub author: Option<CommitAuthor>,
93 #[serde(default)]
94 pub parents: Vec<CommitParent>,
95}
96
97#[derive(Debug, Clone, Deserialize)]
99pub struct CompareResponse {
100 pub commits: Vec<CompareCommit>,
101}
102
103#[derive(Debug, Clone, Deserialize)]
105pub struct PullRequestSummary {
106 pub number: u32,
107 pub merged_at: Option<String>,
108 pub user: PrUser,
109}
110
111#[derive(Debug, Clone, Deserialize)]
113pub struct PrUser {
114 pub login: String,
115}
116
117#[derive(Debug, Clone, Deserialize)]
119pub struct Release {
120 pub tag_name: String,
121 pub assets: Vec<ReleaseAsset>,
122}
123
124#[derive(Debug, Clone, Deserialize)]
126pub struct ReleaseAsset {
127 pub name: String,
128 pub browser_download_url: String,
129}
130
131#[derive(Debug, Clone, Deserialize)]
133pub struct Review {
134 pub user: PrUser,
135 pub state: String,
136 pub submitted_at: Option<String>,
137 #[serde(default)]
140 pub body: Option<String>,
141}
142
143#[derive(Debug, Clone, Deserialize)]
145pub struct PrCommit {
146 pub sha: String,
147 pub commit: PrCommitInner,
148 pub author: Option<PrUser>,
149}
150
151#[derive(Debug, Clone, Deserialize)]
153pub struct PrCommitInner {
154 pub committer: Option<PrCommitAuthor>,
155 pub verification: Option<CommitVerification>,
156}
157
158#[derive(Debug, Clone, Deserialize)]
160pub struct PrCommitAuthor {
161 pub date: Option<String>,
162}
163
164#[derive(Debug, Clone, Deserialize)]
166pub struct CheckRunApp {
167 pub slug: String,
168}
169
170#[derive(Debug, Clone, Deserialize)]
172pub struct CheckRunItem {
173 pub name: String,
174 pub status: String,
176 pub conclusion: Option<String>,
178 pub app: Option<CheckRunApp>,
180}
181
182#[derive(Debug, Clone, Deserialize)]
184pub struct CheckRunsResponse {
185 pub total_count: u32,
186 pub check_runs: Vec<CheckRunItem>,
187}
188
189#[derive(Debug, Clone, Deserialize)]
191pub struct CombinedStatusResponse {
192 pub state: String,
193 pub statuses: Vec<CommitStatusItem>,
194}
195
196#[derive(Debug, Clone, Deserialize)]
198pub struct CommitStatusItem {
199 pub context: String,
200 pub state: String,
201}
202
203#[derive(Debug, Clone, Deserialize)]
205pub struct SearchResponse<T> {
206 pub total_count: u32,
207 pub items: Vec<T>,
208}
209
210#[derive(Debug, Clone, Deserialize)]
212pub struct SearchPrItem {
213 pub number: u32,
214 pub pull_request: Option<SearchPrMeta>,
215}
216
217#[derive(Debug, Clone, Deserialize)]
219pub struct SearchPrMeta {
220 pub merged_at: Option<String>,
221}