openapi_github/models/
repository_7.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Repository7 : A git repository
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Repository7 {
17    /// Whether to allow auto-merge for pull requests.
18    #[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
19    pub allow_auto_merge: Option<bool>,
20    /// Whether to allow private forks
21    #[serde(rename = "allow_forking", skip_serializing_if = "Option::is_none")]
22    pub allow_forking: Option<bool>,
23    /// Whether to allow merge commits for pull requests.
24    #[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
25    pub allow_merge_commit: Option<bool>,
26    /// Whether to allow rebase merges for pull requests.
27    #[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
28    pub allow_rebase_merge: Option<bool>,
29    /// Whether to allow squash merges for pull requests.
30    #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
31    pub allow_squash_merge: Option<bool>,
32    #[serde(rename = "allow_update_branch", skip_serializing_if = "Option::is_none")]
33    pub allow_update_branch: Option<bool>,
34    #[serde(rename = "archive_url")]
35    pub archive_url: String,
36    /// Whether the repository is archived.
37    #[serde(rename = "archived")]
38    pub archived: bool,
39    #[serde(rename = "assignees_url")]
40    pub assignees_url: String,
41    #[serde(rename = "blobs_url")]
42    pub blobs_url: String,
43    #[serde(rename = "branches_url")]
44    pub branches_url: String,
45    #[serde(rename = "clone_url")]
46    pub clone_url: String,
47    #[serde(rename = "collaborators_url")]
48    pub collaborators_url: String,
49    #[serde(rename = "comments_url")]
50    pub comments_url: String,
51    #[serde(rename = "commits_url")]
52    pub commits_url: String,
53    #[serde(rename = "compare_url")]
54    pub compare_url: String,
55    #[serde(rename = "contents_url")]
56    pub contents_url: String,
57    #[serde(rename = "contributors_url")]
58    pub contributors_url: String,
59    #[serde(rename = "created_at")]
60    pub created_at: Box<models::RepositoryCreatedAt>,
61    /// The default branch of the repository.
62    #[serde(rename = "default_branch")]
63    pub default_branch: String,
64    /// Whether to delete head branches when pull requests are merged
65    #[serde(rename = "delete_branch_on_merge", skip_serializing_if = "Option::is_none")]
66    pub delete_branch_on_merge: Option<bool>,
67    #[serde(rename = "deployments_url")]
68    pub deployments_url: String,
69    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
70    pub description: Option<String>,
71    /// Returns whether or not this repository is disabled.
72    #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
73    pub disabled: Option<bool>,
74    #[serde(rename = "downloads_url")]
75    pub downloads_url: String,
76    #[serde(rename = "events_url")]
77    pub events_url: String,
78    #[serde(rename = "fork")]
79    pub fork: bool,
80    #[serde(rename = "forks")]
81    pub forks: i32,
82    #[serde(rename = "forks_count")]
83    pub forks_count: i32,
84    #[serde(rename = "forks_url")]
85    pub forks_url: String,
86    #[serde(rename = "full_name")]
87    pub full_name: String,
88    #[serde(rename = "git_commits_url")]
89    pub git_commits_url: String,
90    #[serde(rename = "git_refs_url")]
91    pub git_refs_url: String,
92    #[serde(rename = "git_tags_url")]
93    pub git_tags_url: String,
94    #[serde(rename = "git_url")]
95    pub git_url: String,
96    /// Whether downloads are enabled.
97    #[serde(rename = "has_downloads")]
98    pub has_downloads: bool,
99    /// Whether issues are enabled.
100    #[serde(rename = "has_issues")]
101    pub has_issues: bool,
102    #[serde(rename = "has_pages")]
103    pub has_pages: bool,
104    /// Whether projects are enabled.
105    #[serde(rename = "has_projects")]
106    pub has_projects: bool,
107    /// Whether the wiki is enabled.
108    #[serde(rename = "has_wiki")]
109    pub has_wiki: bool,
110    #[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
111    pub homepage: Option<String>,
112    #[serde(rename = "hooks_url")]
113    pub hooks_url: String,
114    #[serde(rename = "html_url")]
115    pub html_url: String,
116    /// Unique identifier of the repository
117    #[serde(rename = "id")]
118    pub id: i32,
119    #[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
120    pub is_template: Option<bool>,
121    #[serde(rename = "issue_comment_url")]
122    pub issue_comment_url: String,
123    #[serde(rename = "issue_events_url")]
124    pub issue_events_url: String,
125    #[serde(rename = "issues_url")]
126    pub issues_url: String,
127    #[serde(rename = "keys_url")]
128    pub keys_url: String,
129    #[serde(rename = "labels_url")]
130    pub labels_url: String,
131    #[serde(rename = "language", deserialize_with = "Option::deserialize")]
132    pub language: Option<String>,
133    #[serde(rename = "languages_url")]
134    pub languages_url: String,
135    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
136    pub license: Option<Box<models::License>>,
137    #[serde(rename = "master_branch", skip_serializing_if = "Option::is_none")]
138    pub master_branch: Option<String>,
139    #[serde(rename = "merges_url")]
140    pub merges_url: String,
141    #[serde(rename = "milestones_url")]
142    pub milestones_url: String,
143    #[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
144    pub mirror_url: Option<String>,
145    /// The name of the repository.
146    #[serde(rename = "name")]
147    pub name: String,
148    #[serde(rename = "node_id")]
149    pub node_id: String,
150    #[serde(rename = "notifications_url")]
151    pub notifications_url: String,
152    #[serde(rename = "open_issues")]
153    pub open_issues: i32,
154    #[serde(rename = "open_issues_count")]
155    pub open_issues_count: i32,
156    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
157    pub organization: Option<String>,
158    #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
159    pub owner: Option<Box<models::User>>,
160    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
161    pub permissions: Option<Box<models::RepositoryPermissions>>,
162    /// Whether the repository is private or public.
163    #[serde(rename = "private")]
164    pub private: bool,
165    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
166    pub public: Option<bool>,
167    #[serde(rename = "pulls_url")]
168    pub pulls_url: String,
169    #[serde(rename = "pushed_at", deserialize_with = "Option::deserialize")]
170    pub pushed_at: Option<Box<models::RepositoryPushedAt>>,
171    #[serde(rename = "releases_url")]
172    pub releases_url: String,
173    #[serde(rename = "role_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
174    pub role_name: Option<Option<String>>,
175    #[serde(rename = "size")]
176    pub size: i32,
177    #[serde(rename = "ssh_url")]
178    pub ssh_url: String,
179    #[serde(rename = "stargazers", skip_serializing_if = "Option::is_none")]
180    pub stargazers: Option<i32>,
181    #[serde(rename = "stargazers_count")]
182    pub stargazers_count: i32,
183    #[serde(rename = "stargazers_url")]
184    pub stargazers_url: String,
185    #[serde(rename = "statuses_url")]
186    pub statuses_url: String,
187    #[serde(rename = "subscribers_url")]
188    pub subscribers_url: String,
189    #[serde(rename = "subscription_url")]
190    pub subscription_url: String,
191    #[serde(rename = "svn_url")]
192    pub svn_url: String,
193    #[serde(rename = "tags_url")]
194    pub tags_url: String,
195    #[serde(rename = "teams_url")]
196    pub teams_url: String,
197    #[serde(rename = "topics")]
198    pub topics: Vec<String>,
199    #[serde(rename = "trees_url")]
200    pub trees_url: String,
201    #[serde(rename = "updated_at")]
202    pub updated_at: String,
203    #[serde(rename = "url")]
204    pub url: String,
205    #[serde(rename = "visibility")]
206    pub visibility: Visibility,
207    #[serde(rename = "watchers")]
208    pub watchers: i32,
209    #[serde(rename = "watchers_count")]
210    pub watchers_count: i32,
211}
212
213impl Repository7 {
214    /// A git repository
215    pub fn new(archive_url: String, archived: bool, assignees_url: String, blobs_url: String, branches_url: String, clone_url: String, collaborators_url: String, comments_url: String, commits_url: String, compare_url: String, contents_url: String, contributors_url: String, created_at: models::RepositoryCreatedAt, default_branch: String, deployments_url: String, description: Option<String>, downloads_url: String, events_url: String, fork: bool, forks: i32, forks_count: i32, forks_url: String, full_name: String, git_commits_url: String, git_refs_url: String, git_tags_url: String, git_url: String, has_downloads: bool, has_issues: bool, has_pages: bool, has_projects: bool, has_wiki: bool, homepage: Option<String>, hooks_url: String, html_url: String, id: i32, issue_comment_url: String, issue_events_url: String, issues_url: String, keys_url: String, labels_url: String, language: Option<String>, languages_url: String, license: Option<models::License>, merges_url: String, milestones_url: String, mirror_url: Option<String>, name: String, node_id: String, notifications_url: String, open_issues: i32, open_issues_count: i32, owner: Option<models::User>, private: bool, pulls_url: String, pushed_at: Option<models::RepositoryPushedAt>, releases_url: String, size: i32, ssh_url: String, stargazers_count: i32, stargazers_url: String, statuses_url: String, subscribers_url: String, subscription_url: String, svn_url: String, tags_url: String, teams_url: String, topics: Vec<String>, trees_url: String, updated_at: String, url: String, visibility: Visibility, watchers: i32, watchers_count: i32) -> Repository7 {
216        Repository7 {
217            allow_auto_merge: None,
218            allow_forking: None,
219            allow_merge_commit: None,
220            allow_rebase_merge: None,
221            allow_squash_merge: None,
222            allow_update_branch: None,
223            archive_url,
224            archived,
225            assignees_url,
226            blobs_url,
227            branches_url,
228            clone_url,
229            collaborators_url,
230            comments_url,
231            commits_url,
232            compare_url,
233            contents_url,
234            contributors_url,
235            created_at: Box::new(created_at),
236            default_branch,
237            delete_branch_on_merge: None,
238            deployments_url,
239            description,
240            disabled: None,
241            downloads_url,
242            events_url,
243            fork,
244            forks,
245            forks_count,
246            forks_url,
247            full_name,
248            git_commits_url,
249            git_refs_url,
250            git_tags_url,
251            git_url,
252            has_downloads,
253            has_issues,
254            has_pages,
255            has_projects,
256            has_wiki,
257            homepage,
258            hooks_url,
259            html_url,
260            id,
261            is_template: None,
262            issue_comment_url,
263            issue_events_url,
264            issues_url,
265            keys_url,
266            labels_url,
267            language,
268            languages_url,
269            license: license.map(Box::new),
270            master_branch: None,
271            merges_url,
272            milestones_url,
273            mirror_url,
274            name,
275            node_id,
276            notifications_url,
277            open_issues,
278            open_issues_count,
279            organization: None,
280            owner: owner.map(Box::new),
281            permissions: None,
282            private,
283            public: None,
284            pulls_url,
285            pushed_at: pushed_at.map(Box::new),
286            releases_url,
287            role_name: None,
288            size,
289            ssh_url,
290            stargazers: None,
291            stargazers_count,
292            stargazers_url,
293            statuses_url,
294            subscribers_url,
295            subscription_url,
296            svn_url,
297            tags_url,
298            teams_url,
299            topics,
300            trees_url,
301            updated_at,
302            url,
303            visibility,
304            watchers,
305            watchers_count,
306        }
307    }
308}
309/// 
310#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
311pub enum Visibility {
312    #[serde(rename = "public")]
313    Public,
314    #[serde(rename = "private")]
315    Private,
316    #[serde(rename = "internal")]
317    Internal,
318}
319
320impl Default for Visibility {
321    fn default() -> Visibility {
322        Self::Public
323    }
324}
325