1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TeamRepository {
17 #[serde(rename = "id")]
19 pub id: i32,
20 #[serde(rename = "node_id")]
21 pub node_id: String,
22 #[serde(rename = "name")]
24 pub name: String,
25 #[serde(rename = "full_name")]
26 pub full_name: String,
27 #[serde(rename = "license", deserialize_with = "Option::deserialize")]
28 pub license: Option<Box<models::NullableLicenseSimple>>,
29 #[serde(rename = "forks")]
30 pub forks: i32,
31 #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
32 pub permissions: Option<Box<models::RepositoryPermissions>>,
33 #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")]
34 pub role_name: Option<String>,
35 #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
36 pub owner: Option<Box<models::NullableSimpleUser>>,
37 #[serde(rename = "private")]
39 pub private: bool,
40 #[serde(rename = "html_url")]
41 pub html_url: String,
42 #[serde(rename = "description", deserialize_with = "Option::deserialize")]
43 pub description: Option<String>,
44 #[serde(rename = "fork")]
45 pub fork: bool,
46 #[serde(rename = "url")]
47 pub url: String,
48 #[serde(rename = "archive_url")]
49 pub archive_url: String,
50 #[serde(rename = "assignees_url")]
51 pub assignees_url: String,
52 #[serde(rename = "blobs_url")]
53 pub blobs_url: String,
54 #[serde(rename = "branches_url")]
55 pub branches_url: String,
56 #[serde(rename = "collaborators_url")]
57 pub collaborators_url: String,
58 #[serde(rename = "comments_url")]
59 pub comments_url: String,
60 #[serde(rename = "commits_url")]
61 pub commits_url: String,
62 #[serde(rename = "compare_url")]
63 pub compare_url: String,
64 #[serde(rename = "contents_url")]
65 pub contents_url: String,
66 #[serde(rename = "contributors_url")]
67 pub contributors_url: String,
68 #[serde(rename = "deployments_url")]
69 pub deployments_url: String,
70 #[serde(rename = "downloads_url")]
71 pub downloads_url: String,
72 #[serde(rename = "events_url")]
73 pub events_url: String,
74 #[serde(rename = "forks_url")]
75 pub forks_url: String,
76 #[serde(rename = "git_commits_url")]
77 pub git_commits_url: String,
78 #[serde(rename = "git_refs_url")]
79 pub git_refs_url: String,
80 #[serde(rename = "git_tags_url")]
81 pub git_tags_url: String,
82 #[serde(rename = "git_url")]
83 pub git_url: String,
84 #[serde(rename = "issue_comment_url")]
85 pub issue_comment_url: String,
86 #[serde(rename = "issue_events_url")]
87 pub issue_events_url: String,
88 #[serde(rename = "issues_url")]
89 pub issues_url: String,
90 #[serde(rename = "keys_url")]
91 pub keys_url: String,
92 #[serde(rename = "labels_url")]
93 pub labels_url: String,
94 #[serde(rename = "languages_url")]
95 pub languages_url: String,
96 #[serde(rename = "merges_url")]
97 pub merges_url: String,
98 #[serde(rename = "milestones_url")]
99 pub milestones_url: String,
100 #[serde(rename = "notifications_url")]
101 pub notifications_url: String,
102 #[serde(rename = "pulls_url")]
103 pub pulls_url: String,
104 #[serde(rename = "releases_url")]
105 pub releases_url: String,
106 #[serde(rename = "ssh_url")]
107 pub ssh_url: String,
108 #[serde(rename = "stargazers_url")]
109 pub stargazers_url: String,
110 #[serde(rename = "statuses_url")]
111 pub statuses_url: String,
112 #[serde(rename = "subscribers_url")]
113 pub subscribers_url: String,
114 #[serde(rename = "subscription_url")]
115 pub subscription_url: String,
116 #[serde(rename = "tags_url")]
117 pub tags_url: String,
118 #[serde(rename = "teams_url")]
119 pub teams_url: String,
120 #[serde(rename = "trees_url")]
121 pub trees_url: String,
122 #[serde(rename = "clone_url")]
123 pub clone_url: String,
124 #[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
125 pub mirror_url: Option<String>,
126 #[serde(rename = "hooks_url")]
127 pub hooks_url: String,
128 #[serde(rename = "svn_url")]
129 pub svn_url: String,
130 #[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
131 pub homepage: Option<String>,
132 #[serde(rename = "language", deserialize_with = "Option::deserialize")]
133 pub language: Option<String>,
134 #[serde(rename = "forks_count")]
135 pub forks_count: i32,
136 #[serde(rename = "stargazers_count")]
137 pub stargazers_count: i32,
138 #[serde(rename = "watchers_count")]
139 pub watchers_count: i32,
140 #[serde(rename = "size")]
141 pub size: i32,
142 #[serde(rename = "default_branch")]
144 pub default_branch: String,
145 #[serde(rename = "open_issues_count")]
146 pub open_issues_count: i32,
147 #[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
149 pub is_template: Option<bool>,
150 #[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
151 pub topics: Option<Vec<String>>,
152 #[serde(rename = "has_issues")]
154 pub has_issues: bool,
155 #[serde(rename = "has_projects")]
157 pub has_projects: bool,
158 #[serde(rename = "has_wiki")]
160 pub has_wiki: bool,
161 #[serde(rename = "has_pages")]
162 pub has_pages: bool,
163 #[serde(rename = "has_downloads")]
165 pub has_downloads: bool,
166 #[serde(rename = "archived")]
168 pub archived: bool,
169 #[serde(rename = "disabled")]
171 pub disabled: bool,
172 #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
174 pub visibility: Option<String>,
175 #[serde(rename = "pushed_at", deserialize_with = "Option::deserialize")]
176 pub pushed_at: Option<String>,
177 #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
178 pub created_at: Option<String>,
179 #[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
180 pub updated_at: Option<String>,
181 #[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
183 pub allow_rebase_merge: Option<bool>,
184 #[serde(rename = "temp_clone_token", skip_serializing_if = "Option::is_none")]
185 pub temp_clone_token: Option<String>,
186 #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
188 pub allow_squash_merge: Option<bool>,
189 #[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
191 pub allow_auto_merge: Option<bool>,
192 #[serde(rename = "delete_branch_on_merge", skip_serializing_if = "Option::is_none")]
194 pub delete_branch_on_merge: Option<bool>,
195 #[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
197 pub allow_merge_commit: Option<bool>,
198 #[serde(rename = "allow_forking", skip_serializing_if = "Option::is_none")]
200 pub allow_forking: Option<bool>,
201 #[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
203 pub web_commit_signoff_required: Option<bool>,
204 #[serde(rename = "subscribers_count", skip_serializing_if = "Option::is_none")]
205 pub subscribers_count: Option<i32>,
206 #[serde(rename = "network_count", skip_serializing_if = "Option::is_none")]
207 pub network_count: Option<i32>,
208 #[serde(rename = "open_issues")]
209 pub open_issues: i32,
210 #[serde(rename = "watchers")]
211 pub watchers: i32,
212 #[serde(rename = "master_branch", skip_serializing_if = "Option::is_none")]
213 pub master_branch: Option<String>,
214}
215
216impl TeamRepository {
217 pub fn new(id: i32, node_id: String, name: String, full_name: String, license: Option<models::NullableLicenseSimple>, forks: i32, owner: Option<models::NullableSimpleUser>, private: bool, html_url: String, description: Option<String>, fork: bool, url: String, archive_url: String, assignees_url: String, blobs_url: String, branches_url: String, collaborators_url: String, comments_url: String, commits_url: String, compare_url: String, contents_url: String, contributors_url: String, deployments_url: String, downloads_url: String, events_url: String, forks_url: String, git_commits_url: String, git_refs_url: String, git_tags_url: String, git_url: String, issue_comment_url: String, issue_events_url: String, issues_url: String, keys_url: String, labels_url: String, languages_url: String, merges_url: String, milestones_url: String, notifications_url: String, pulls_url: String, releases_url: String, ssh_url: String, stargazers_url: String, statuses_url: String, subscribers_url: String, subscription_url: String, tags_url: String, teams_url: String, trees_url: String, clone_url: String, mirror_url: Option<String>, hooks_url: String, svn_url: String, homepage: Option<String>, language: Option<String>, forks_count: i32, stargazers_count: i32, watchers_count: i32, size: i32, default_branch: String, open_issues_count: i32, has_issues: bool, has_projects: bool, has_wiki: bool, has_pages: bool, has_downloads: bool, archived: bool, disabled: bool, pushed_at: Option<String>, created_at: Option<String>, updated_at: Option<String>, open_issues: i32, watchers: i32) -> TeamRepository {
219 TeamRepository {
220 id,
221 node_id,
222 name,
223 full_name,
224 license: license.map(Box::new),
225 forks,
226 permissions: None,
227 role_name: None,
228 owner: owner.map(Box::new),
229 private,
230 html_url,
231 description,
232 fork,
233 url,
234 archive_url,
235 assignees_url,
236 blobs_url,
237 branches_url,
238 collaborators_url,
239 comments_url,
240 commits_url,
241 compare_url,
242 contents_url,
243 contributors_url,
244 deployments_url,
245 downloads_url,
246 events_url,
247 forks_url,
248 git_commits_url,
249 git_refs_url,
250 git_tags_url,
251 git_url,
252 issue_comment_url,
253 issue_events_url,
254 issues_url,
255 keys_url,
256 labels_url,
257 languages_url,
258 merges_url,
259 milestones_url,
260 notifications_url,
261 pulls_url,
262 releases_url,
263 ssh_url,
264 stargazers_url,
265 statuses_url,
266 subscribers_url,
267 subscription_url,
268 tags_url,
269 teams_url,
270 trees_url,
271 clone_url,
272 mirror_url,
273 hooks_url,
274 svn_url,
275 homepage,
276 language,
277 forks_count,
278 stargazers_count,
279 watchers_count,
280 size,
281 default_branch,
282 open_issues_count,
283 is_template: None,
284 topics: None,
285 has_issues,
286 has_projects,
287 has_wiki,
288 has_pages,
289 has_downloads,
290 archived,
291 disabled,
292 visibility: None,
293 pushed_at,
294 created_at,
295 updated_at,
296 allow_rebase_merge: None,
297 temp_clone_token: None,
298 allow_squash_merge: None,
299 allow_auto_merge: None,
300 delete_branch_on_merge: None,
301 allow_merge_commit: None,
302 allow_forking: None,
303 web_commit_signoff_required: None,
304 subscribers_count: None,
305 network_count: None,
306 open_issues,
307 watchers,
308 master_branch: None,
309 }
310 }
311}
312