openapi_github/models/
repository_11.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/// Repository11 : A git repository
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Repository11 {
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    /// Whether discussions are enabled.
111    #[serde(rename = "has_discussions")]
112    pub has_discussions: bool,
113    #[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
114    pub homepage: Option<String>,
115    #[serde(rename = "hooks_url")]
116    pub hooks_url: String,
117    #[serde(rename = "html_url")]
118    pub html_url: String,
119    /// Unique identifier of the repository
120    #[serde(rename = "id")]
121    pub id: i32,
122    #[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
123    pub is_template: Option<bool>,
124    #[serde(rename = "issue_comment_url")]
125    pub issue_comment_url: String,
126    #[serde(rename = "issue_events_url")]
127    pub issue_events_url: String,
128    #[serde(rename = "issues_url")]
129    pub issues_url: String,
130    #[serde(rename = "keys_url")]
131    pub keys_url: String,
132    #[serde(rename = "labels_url")]
133    pub labels_url: String,
134    #[serde(rename = "language", deserialize_with = "Option::deserialize")]
135    pub language: Option<String>,
136    #[serde(rename = "languages_url")]
137    pub languages_url: String,
138    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
139    pub license: Option<Box<models::License>>,
140    #[serde(rename = "master_branch", skip_serializing_if = "Option::is_none")]
141    pub master_branch: Option<String>,
142    #[serde(rename = "merges_url")]
143    pub merges_url: String,
144    #[serde(rename = "milestones_url")]
145    pub milestones_url: String,
146    #[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
147    pub mirror_url: Option<String>,
148    /// The name of the repository.
149    #[serde(rename = "name")]
150    pub name: String,
151    #[serde(rename = "node_id")]
152    pub node_id: String,
153    #[serde(rename = "notifications_url")]
154    pub notifications_url: String,
155    #[serde(rename = "open_issues")]
156    pub open_issues: i32,
157    #[serde(rename = "open_issues_count")]
158    pub open_issues_count: i32,
159    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
160    pub organization: Option<String>,
161    #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
162    pub owner: Option<Box<models::User>>,
163    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
164    pub permissions: Option<Box<models::RepositoryPermissions>>,
165    /// Whether the repository is private or public.
166    #[serde(rename = "private")]
167    pub private: bool,
168    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
169    pub public: Option<bool>,
170    #[serde(rename = "pulls_url")]
171    pub pulls_url: String,
172    #[serde(rename = "pushed_at", deserialize_with = "Option::deserialize")]
173    pub pushed_at: Option<Box<models::RepositoryPushedAt>>,
174    #[serde(rename = "releases_url")]
175    pub releases_url: String,
176    #[serde(rename = "role_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
177    pub role_name: Option<Option<String>>,
178    #[serde(rename = "size")]
179    pub size: i32,
180    #[serde(rename = "ssh_url")]
181    pub ssh_url: String,
182    #[serde(rename = "stargazers", skip_serializing_if = "Option::is_none")]
183    pub stargazers: Option<i32>,
184    #[serde(rename = "stargazers_count")]
185    pub stargazers_count: i32,
186    #[serde(rename = "stargazers_url")]
187    pub stargazers_url: String,
188    #[serde(rename = "statuses_url")]
189    pub statuses_url: String,
190    #[serde(rename = "subscribers_url")]
191    pub subscribers_url: String,
192    #[serde(rename = "subscription_url")]
193    pub subscription_url: String,
194    #[serde(rename = "svn_url")]
195    pub svn_url: String,
196    #[serde(rename = "tags_url")]
197    pub tags_url: String,
198    #[serde(rename = "teams_url")]
199    pub teams_url: String,
200    #[serde(rename = "topics")]
201    pub topics: Vec<String>,
202    #[serde(rename = "trees_url")]
203    pub trees_url: String,
204    #[serde(rename = "updated_at")]
205    pub updated_at: String,
206    #[serde(rename = "url")]
207    pub url: String,
208    #[serde(rename = "visibility")]
209    pub visibility: Visibility,
210    #[serde(rename = "watchers")]
211    pub watchers: i32,
212    #[serde(rename = "watchers_count")]
213    pub watchers_count: i32,
214    /// Whether to require contributors to sign off on web-based commits
215    #[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
216    pub web_commit_signoff_required: Option<bool>,
217}
218
219impl Repository11 {
220    /// A git repository
221    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, has_discussions: 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) -> Repository11 {
222        Repository11 {
223            allow_auto_merge: None,
224            allow_forking: None,
225            allow_merge_commit: None,
226            allow_rebase_merge: None,
227            allow_squash_merge: None,
228            allow_update_branch: None,
229            archive_url,
230            archived,
231            assignees_url,
232            blobs_url,
233            branches_url,
234            clone_url,
235            collaborators_url,
236            comments_url,
237            commits_url,
238            compare_url,
239            contents_url,
240            contributors_url,
241            created_at: Box::new(created_at),
242            default_branch,
243            delete_branch_on_merge: None,
244            deployments_url,
245            description,
246            disabled: None,
247            downloads_url,
248            events_url,
249            fork,
250            forks,
251            forks_count,
252            forks_url,
253            full_name,
254            git_commits_url,
255            git_refs_url,
256            git_tags_url,
257            git_url,
258            has_downloads,
259            has_issues,
260            has_pages,
261            has_projects,
262            has_wiki,
263            has_discussions,
264            homepage,
265            hooks_url,
266            html_url,
267            id,
268            is_template: None,
269            issue_comment_url,
270            issue_events_url,
271            issues_url,
272            keys_url,
273            labels_url,
274            language,
275            languages_url,
276            license: license.map(Box::new),
277            master_branch: None,
278            merges_url,
279            milestones_url,
280            mirror_url,
281            name,
282            node_id,
283            notifications_url,
284            open_issues,
285            open_issues_count,
286            organization: None,
287            owner: owner.map(Box::new),
288            permissions: None,
289            private,
290            public: None,
291            pulls_url,
292            pushed_at: pushed_at.map(Box::new),
293            releases_url,
294            role_name: None,
295            size,
296            ssh_url,
297            stargazers: None,
298            stargazers_count,
299            stargazers_url,
300            statuses_url,
301            subscribers_url,
302            subscription_url,
303            svn_url,
304            tags_url,
305            teams_url,
306            topics,
307            trees_url,
308            updated_at,
309            url,
310            visibility,
311            watchers,
312            watchers_count,
313            web_commit_signoff_required: None,
314        }
315    }
316}
317/// 
318#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
319pub enum Visibility {
320    #[serde(rename = "public")]
321    Public,
322    #[serde(rename = "private")]
323    Private,
324    #[serde(rename = "internal")]
325    Internal,
326}
327
328impl Default for Visibility {
329    fn default() -> Visibility {
330        Self::Public
331    }
332}
333