openapi_github/models/
repository_14.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/// Repository14 : A git repository
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Repository14 {
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 downloads are enabled.
100    #[serde(rename = "has_downloads")]
101    pub has_downloads: bool,
102    /// Whether issues are enabled.
103    #[serde(rename = "has_issues")]
104    pub has_issues: bool,
105    #[serde(rename = "has_pages")]
106    pub has_pages: bool,
107    /// Whether projects are enabled.
108    #[serde(rename = "has_projects")]
109    pub has_projects: bool,
110    /// Whether the wiki is enabled.
111    #[serde(rename = "has_wiki")]
112    pub has_wiki: 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}
215
216impl Repository14 {
217    /// A git repository
218    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) -> Repository14 {
219        Repository14 {
220            allow_auto_merge: None,
221            allow_forking: None,
222            allow_merge_commit: None,
223            allow_rebase_merge: None,
224            allow_squash_merge: None,
225            allow_update_branch: None,
226            archive_url,
227            archived,
228            assignees_url,
229            blobs_url,
230            branches_url,
231            clone_url,
232            collaborators_url,
233            comments_url,
234            commits_url,
235            compare_url,
236            contents_url,
237            contributors_url,
238            created_at: Box::new(created_at),
239            custom_properties: None,
240            default_branch,
241            delete_branch_on_merge: None,
242            deployments_url,
243            description,
244            disabled: None,
245            downloads_url,
246            events_url,
247            fork,
248            forks,
249            forks_count,
250            forks_url,
251            full_name,
252            git_commits_url,
253            git_refs_url,
254            git_tags_url,
255            git_url,
256            has_downloads,
257            has_issues,
258            has_pages,
259            has_projects,
260            has_wiki,
261            homepage,
262            hooks_url,
263            html_url,
264            id,
265            is_template: None,
266            issue_comment_url,
267            issue_events_url,
268            issues_url,
269            keys_url,
270            labels_url,
271            language,
272            languages_url,
273            license: license.map(Box::new),
274            master_branch: None,
275            merges_url,
276            milestones_url,
277            mirror_url,
278            name,
279            node_id,
280            notifications_url,
281            open_issues,
282            open_issues_count,
283            organization: None,
284            owner: owner.map(Box::new),
285            permissions: None,
286            private,
287            public: None,
288            pulls_url,
289            pushed_at: pushed_at.map(Box::new),
290            releases_url,
291            role_name: None,
292            size,
293            ssh_url,
294            stargazers: None,
295            stargazers_count,
296            stargazers_url,
297            statuses_url,
298            subscribers_url,
299            subscription_url,
300            svn_url,
301            tags_url,
302            teams_url,
303            topics,
304            trees_url,
305            updated_at,
306            url,
307            visibility,
308            watchers,
309            watchers_count,
310        }
311    }
312}
313/// 
314#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
315pub enum Visibility {
316    #[serde(rename = "public")]
317    Public,
318    #[serde(rename = "private")]
319    Private,
320    #[serde(rename = "internal")]
321    Internal,
322}
323
324impl Default for Visibility {
325    fn default() -> Visibility {
326        Self::Public
327    }
328}
329