openapi_github/models/
repository_4.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/// Repository4 : A git repository
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Repository4 {
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    /// The default value for a merge commit message.  - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
143    #[serde(rename = "merge_commit_message", skip_serializing_if = "Option::is_none")]
144    pub merge_commit_message: Option<MergeCommitMessage>,
145    /// The default value for a merge commit title.  - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
146    #[serde(rename = "merge_commit_title", skip_serializing_if = "Option::is_none")]
147    pub merge_commit_title: Option<MergeCommitTitle>,
148    #[serde(rename = "merges_url")]
149    pub merges_url: String,
150    #[serde(rename = "milestones_url")]
151    pub milestones_url: String,
152    #[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
153    pub mirror_url: Option<String>,
154    /// The name of the repository.
155    #[serde(rename = "name")]
156    pub name: String,
157    #[serde(rename = "node_id")]
158    pub node_id: String,
159    #[serde(rename = "notifications_url")]
160    pub notifications_url: String,
161    #[serde(rename = "open_issues")]
162    pub open_issues: i32,
163    #[serde(rename = "open_issues_count")]
164    pub open_issues_count: i32,
165    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
166    pub organization: Option<String>,
167    #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
168    pub owner: Option<Box<models::User>>,
169    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
170    pub permissions: Option<Box<models::RepositoryPermissions>>,
171    /// Whether the repository is private or public.
172    #[serde(rename = "private")]
173    pub private: bool,
174    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
175    pub public: Option<bool>,
176    #[serde(rename = "pulls_url")]
177    pub pulls_url: String,
178    #[serde(rename = "pushed_at", deserialize_with = "Option::deserialize")]
179    pub pushed_at: Option<Box<models::RepositoryPushedAt>>,
180    #[serde(rename = "releases_url")]
181    pub releases_url: String,
182    #[serde(rename = "role_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
183    pub role_name: Option<Option<String>>,
184    #[serde(rename = "size")]
185    pub size: i32,
186    /// The default value for a squash merge commit message:  - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
187    #[serde(rename = "squash_merge_commit_message", skip_serializing_if = "Option::is_none")]
188    pub squash_merge_commit_message: Option<SquashMergeCommitMessage>,
189    /// The default value for a squash merge commit title:  - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
190    #[serde(rename = "squash_merge_commit_title", skip_serializing_if = "Option::is_none")]
191    pub squash_merge_commit_title: Option<SquashMergeCommitTitle>,
192    #[serde(rename = "ssh_url")]
193    pub ssh_url: String,
194    #[serde(rename = "stargazers", skip_serializing_if = "Option::is_none")]
195    pub stargazers: Option<i32>,
196    #[serde(rename = "stargazers_count")]
197    pub stargazers_count: i32,
198    #[serde(rename = "stargazers_url")]
199    pub stargazers_url: String,
200    #[serde(rename = "statuses_url")]
201    pub statuses_url: String,
202    #[serde(rename = "subscribers_url")]
203    pub subscribers_url: String,
204    #[serde(rename = "subscription_url")]
205    pub subscription_url: String,
206    #[serde(rename = "svn_url")]
207    pub svn_url: String,
208    #[serde(rename = "tags_url")]
209    pub tags_url: String,
210    #[serde(rename = "teams_url")]
211    pub teams_url: String,
212    #[serde(rename = "topics")]
213    pub topics: Vec<String>,
214    #[serde(rename = "trees_url")]
215    pub trees_url: String,
216    #[serde(rename = "updated_at")]
217    pub updated_at: String,
218    #[serde(rename = "url")]
219    pub url: String,
220    /// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.
221    #[serde(rename = "use_squash_pr_title_as_default", skip_serializing_if = "Option::is_none")]
222    pub use_squash_pr_title_as_default: Option<bool>,
223    #[serde(rename = "visibility")]
224    pub visibility: Visibility,
225    #[serde(rename = "watchers")]
226    pub watchers: i32,
227    #[serde(rename = "watchers_count")]
228    pub watchers_count: i32,
229    /// Whether to require contributors to sign off on web-based commits
230    #[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
231    pub web_commit_signoff_required: Option<bool>,
232}
233
234impl Repository4 {
235    /// A git repository
236    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) -> Repository4 {
237        Repository4 {
238            allow_auto_merge: None,
239            allow_forking: None,
240            allow_merge_commit: None,
241            allow_rebase_merge: None,
242            allow_squash_merge: None,
243            allow_update_branch: None,
244            archive_url,
245            archived,
246            assignees_url,
247            blobs_url,
248            branches_url,
249            clone_url,
250            collaborators_url,
251            comments_url,
252            commits_url,
253            compare_url,
254            contents_url,
255            contributors_url,
256            created_at: Box::new(created_at),
257            default_branch,
258            delete_branch_on_merge: None,
259            deployments_url,
260            description,
261            disabled: None,
262            downloads_url,
263            events_url,
264            fork,
265            forks,
266            forks_count,
267            forks_url,
268            full_name,
269            git_commits_url,
270            git_refs_url,
271            git_tags_url,
272            git_url,
273            has_downloads,
274            has_issues,
275            has_pages,
276            has_projects,
277            has_wiki,
278            has_discussions,
279            homepage,
280            hooks_url,
281            html_url,
282            id,
283            is_template: None,
284            issue_comment_url,
285            issue_events_url,
286            issues_url,
287            keys_url,
288            labels_url,
289            language,
290            languages_url,
291            license: license.map(Box::new),
292            master_branch: None,
293            merge_commit_message: None,
294            merge_commit_title: None,
295            merges_url,
296            milestones_url,
297            mirror_url,
298            name,
299            node_id,
300            notifications_url,
301            open_issues,
302            open_issues_count,
303            organization: None,
304            owner: owner.map(Box::new),
305            permissions: None,
306            private,
307            public: None,
308            pulls_url,
309            pushed_at: pushed_at.map(Box::new),
310            releases_url,
311            role_name: None,
312            size,
313            squash_merge_commit_message: None,
314            squash_merge_commit_title: None,
315            ssh_url,
316            stargazers: None,
317            stargazers_count,
318            stargazers_url,
319            statuses_url,
320            subscribers_url,
321            subscription_url,
322            svn_url,
323            tags_url,
324            teams_url,
325            topics,
326            trees_url,
327            updated_at,
328            url,
329            use_squash_pr_title_as_default: None,
330            visibility,
331            watchers,
332            watchers_count,
333            web_commit_signoff_required: None,
334        }
335    }
336}
337/// The default value for a merge commit message.  - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
338#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
339pub enum MergeCommitMessage {
340    #[serde(rename = "PR_BODY")]
341    PrBody,
342    #[serde(rename = "PR_TITLE")]
343    PrTitle,
344    #[serde(rename = "BLANK")]
345    Blank,
346}
347
348impl Default for MergeCommitMessage {
349    fn default() -> MergeCommitMessage {
350        Self::PrBody
351    }
352}
353/// The default value for a merge commit title.  - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
354#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
355pub enum MergeCommitTitle {
356    #[serde(rename = "PR_TITLE")]
357    PrTitle,
358    #[serde(rename = "MERGE_MESSAGE")]
359    MergeMessage,
360}
361
362impl Default for MergeCommitTitle {
363    fn default() -> MergeCommitTitle {
364        Self::PrTitle
365    }
366}
367/// The default value for a squash merge commit message:  - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
368#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
369pub enum SquashMergeCommitMessage {
370    #[serde(rename = "PR_BODY")]
371    PrBody,
372    #[serde(rename = "COMMIT_MESSAGES")]
373    CommitMessages,
374    #[serde(rename = "BLANK")]
375    Blank,
376}
377
378impl Default for SquashMergeCommitMessage {
379    fn default() -> SquashMergeCommitMessage {
380        Self::PrBody
381    }
382}
383/// The default value for a squash merge commit title:  - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
384#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
385pub enum SquashMergeCommitTitle {
386    #[serde(rename = "PR_TITLE")]
387    PrTitle,
388    #[serde(rename = "COMMIT_OR_PR_TITLE")]
389    CommitOrPrTitle,
390}
391
392impl Default for SquashMergeCommitTitle {
393    fn default() -> SquashMergeCommitTitle {
394        Self::PrTitle
395    }
396}
397/// 
398#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
399pub enum Visibility {
400    #[serde(rename = "public")]
401    Public,
402    #[serde(rename = "private")]
403    Private,
404    #[serde(rename = "internal")]
405    Internal,
406}
407
408impl Default for Visibility {
409    fn default() -> Visibility {
410        Self::Public
411    }
412}
413