1use serde::{Deserialize, Serialize};
2
3use crate::model::user::User;
4
5#[derive(Default, Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
9pub enum ObjectFormatName {
10 #[default]
11 #[serde(rename = "sha1")]
12 SHA1,
13 #[serde(rename = "sha256")]
14 SHA256,
15}
16
17#[derive(Default, Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
21pub enum TrustModel {
22 #[serde(rename = "default")]
24 #[default]
25 Default,
26 #[serde(rename = "collaborator")]
28 Collaborator,
29 #[serde(rename = "committer")]
32 Committer,
33 #[serde(rename = "collaboratorcommitter")]
35 CollabroatorCommitter,
36}
37
38#[derive(Default, Debug, Clone, Serialize, Deserialize)]
42#[serde(default)]
43pub struct Repository {
44 pub allow_fast_forward_only_merge: bool,
45 pub allow_merge_commits: bool,
46 pub allow_rebase: bool,
47 pub allow_rebase_explicit: bool,
48 pub allow_rebase_update: bool,
49 pub allow_squash_merge: bool,
50 pub archived: bool,
51 pub archived_at: String,
52 pub avatar_url: String,
53 pub clone_url: String,
54 pub created_at: String,
55 pub default_allow_maintainer_edit: bool,
56 pub default_branch: String,
57 pub default_delete_branch_after_merge: bool,
58 pub default_merge_style: String,
59 pub description: String,
60 pub empty: bool,
61 pub external_tracker: ExternalTracker,
62 pub external_wiki: ExternalWiki,
63 pub fork: bool,
64 pub forks_count: i64,
65 pub full_name: String,
66 pub has_actions: bool,
67 pub has_issues: bool,
68 pub has_packages: bool,
69 pub has_projects: bool,
70 pub has_pull_requests: bool,
71 pub has_releases: bool,
72 pub has_wiki: bool,
73 pub html_url: String,
74 pub id: i64,
75 pub ignore_whitespace_conflicts: bool,
76 pub internal: bool,
77 pub language: String,
78 pub languages_url: String,
79 pub link: String,
80 pub mirror: bool,
81 pub mirror_interval: String,
82 pub mirror_updated: String,
83 pub name: String,
84 pub object_format_name: ObjectFormatName,
85 pub open_issues_count: i64,
86 pub open_pr_counter: i64,
87 pub original_url: String,
88 pub owner: User,
89 pub private: bool,
90 pub release_counter: i64,
91 pub size: i64,
92 pub ssh_url: String,
93 pub stars_count: i64,
94 pub template: bool,
95 pub updated_at: String,
96 pub url: String,
97 pub watchers_count: i64,
98 pub website: String,
99 pub wiki_branch: String,
100}
101
102#[derive(Default, Debug, Clone, Serialize, Deserialize)]
108#[serde(default)]
109pub struct CommitUser {
110 pub date: String,
112 pub email: String,
114 pub name: String,
116}
117
118#[derive(Default, Debug, Clone, Serialize, Deserialize)]
122#[serde(default)]
123pub struct RepoCommit {
124 pub author: CommitUser,
126 pub committer: CommitUser,
128 pub message: String,
130 pub url: String,
133}
134
135#[derive(Default, Debug, Clone, Serialize, Deserialize)]
140#[serde(default)]
141pub struct Commit {
142 pub author: Option<User>,
147 pub commit: RepoCommit,
148 pub committer: Option<User>,
153 pub html_url: String,
155 pub sha: String,
157 pub url: String,
159}
160
161#[derive(Default, Debug, Clone, Serialize, Deserialize)]
162pub struct PayloadUser {
163 pub email: String,
164 pub name: String,
166 pub username: String,
167}
168
169#[derive(Default, Debug, Clone, Serialize, Deserialize)]
170pub struct PayloadCommit {
171 pub author: PayloadUser,
172 pub committer: PayloadUser,
173 pub id: String,
175 pub message: String,
176 pub added: Option<Vec<String>>,
177 pub modified: Option<Vec<String>>,
178 pub removed: Option<Vec<String>>,
179 pub timestamp: String,
180 pub url: String,
181 }
183
184#[derive(Default, Debug, Clone, Serialize, Deserialize)]
186#[serde(default)]
187pub struct CommitDateOptions {
188 author: String,
189 commiter: String,
190}
191
192#[derive(Default, Debug, Clone, Serialize, Deserialize)]
193pub struct Branch {
194 pub commit: PayloadCommit,
195 pub effective_branch_protection_name: String,
196 pub enable_status_check: bool,
197 pub name: String,
198 pub protected: bool,
199 pub required_approvals: i64,
200 pub status_check_contexts: Vec<String>,
201 pub user_can_merge: bool,
202 pub user_can_push: bool,
203}
204
205#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
207#[serde(default)]
208pub struct ExternalTracker {
209 pub external_tracker_format: String,
211 pub external_tracker_regexp_pattern: String,
213 pub external_tracker_style: String,
215 pub external_tracker_url: String,
217}
218
219#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
221#[serde(default)]
222pub struct ExternalWiki {
223 pub external_wiki_url: String,
225}
226
227#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
229pub struct FileLinks {
230 pub git: String,
232 pub html: String,
234 #[serde(rename = "self")]
235 pub self_link: String,
237}
238
239#[derive(Default, Debug, Clone, Serialize, Deserialize)]
241#[serde(default)]
242pub struct Identity {
243 email: String,
244 name: String,
245}
246
247#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
249#[serde(default)]
250pub struct Entry {
251 #[serde(rename = "_links")]
253 pub links: FileLinks,
254 pub content: Option<String>,
256 pub download_url: Option<String>,
258 pub encoding: Option<String>,
260 pub git_url: String,
262 pub html_url: String,
264 pub last_commit_sha: String,
266 pub name: String,
268 pub path: Option<String>,
270 pub sha: String,
272 pub size: u64,
274 pub submodule_git_url: Option<String>,
276 pub target: Option<String>,
278 #[serde(rename = "type")]
280 pub r#type: String,
281 pub url: String,
283}
284
285#[derive(Default, Debug, Clone, Serialize, Deserialize)]
287#[serde(default)]
288pub struct EntryVerification {
289 payload: String,
290 reason: String,
292 signature: String,
293 signer: Option<PayloadUser>,
295 verified: bool,
297}
298
299#[derive(Default, Debug, Clone, Serialize, Deserialize)]
301#[serde(default)]
302pub struct EntryMutation {
303 commit: Commit,
305 content: Option<Entry>,
307 verification: EntryVerification,
309}