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