openapi_github/models/
nullable_repository.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/// NullableRepository : A repository on GitHub.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableRepository {
17    /// Unique identifier of the repository
18    #[serde(rename = "id")]
19    pub id: i32,
20    #[serde(rename = "node_id")]
21    pub node_id: String,
22    /// The name of the repository.
23    #[serde(rename = "name")]
24    pub name: String,
25    #[serde(rename = "full_name")]
26    pub full_name: String,
27    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
28    pub license: Option<Box<models::NullableLicenseSimple>>,
29    #[serde(rename = "forks")]
30    pub forks: i32,
31    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
32    pub permissions: Option<Box<models::RepositoryPermissions>>,
33    #[serde(rename = "owner")]
34    pub owner: Box<models::SimpleUser>,
35    /// Whether the repository is private or public.
36    #[serde(rename = "private")]
37    pub private: bool,
38    #[serde(rename = "html_url")]
39    pub html_url: String,
40    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
41    pub description: Option<String>,
42    #[serde(rename = "fork")]
43    pub fork: bool,
44    #[serde(rename = "url")]
45    pub url: String,
46    #[serde(rename = "archive_url")]
47    pub archive_url: String,
48    #[serde(rename = "assignees_url")]
49    pub assignees_url: String,
50    #[serde(rename = "blobs_url")]
51    pub blobs_url: String,
52    #[serde(rename = "branches_url")]
53    pub branches_url: String,
54    #[serde(rename = "collaborators_url")]
55    pub collaborators_url: String,
56    #[serde(rename = "comments_url")]
57    pub comments_url: String,
58    #[serde(rename = "commits_url")]
59    pub commits_url: String,
60    #[serde(rename = "compare_url")]
61    pub compare_url: String,
62    #[serde(rename = "contents_url")]
63    pub contents_url: String,
64    #[serde(rename = "contributors_url")]
65    pub contributors_url: String,
66    #[serde(rename = "deployments_url")]
67    pub deployments_url: String,
68    #[serde(rename = "downloads_url")]
69    pub downloads_url: String,
70    #[serde(rename = "events_url")]
71    pub events_url: String,
72    #[serde(rename = "forks_url")]
73    pub forks_url: String,
74    #[serde(rename = "git_commits_url")]
75    pub git_commits_url: String,
76    #[serde(rename = "git_refs_url")]
77    pub git_refs_url: String,
78    #[serde(rename = "git_tags_url")]
79    pub git_tags_url: String,
80    #[serde(rename = "git_url")]
81    pub git_url: String,
82    #[serde(rename = "issue_comment_url")]
83    pub issue_comment_url: String,
84    #[serde(rename = "issue_events_url")]
85    pub issue_events_url: String,
86    #[serde(rename = "issues_url")]
87    pub issues_url: String,
88    #[serde(rename = "keys_url")]
89    pub keys_url: String,
90    #[serde(rename = "labels_url")]
91    pub labels_url: String,
92    #[serde(rename = "languages_url")]
93    pub languages_url: String,
94    #[serde(rename = "merges_url")]
95    pub merges_url: String,
96    #[serde(rename = "milestones_url")]
97    pub milestones_url: String,
98    #[serde(rename = "notifications_url")]
99    pub notifications_url: String,
100    #[serde(rename = "pulls_url")]
101    pub pulls_url: String,
102    #[serde(rename = "releases_url")]
103    pub releases_url: String,
104    #[serde(rename = "ssh_url")]
105    pub ssh_url: String,
106    #[serde(rename = "stargazers_url")]
107    pub stargazers_url: String,
108    #[serde(rename = "statuses_url")]
109    pub statuses_url: String,
110    #[serde(rename = "subscribers_url")]
111    pub subscribers_url: String,
112    #[serde(rename = "subscription_url")]
113    pub subscription_url: String,
114    #[serde(rename = "tags_url")]
115    pub tags_url: String,
116    #[serde(rename = "teams_url")]
117    pub teams_url: String,
118    #[serde(rename = "trees_url")]
119    pub trees_url: String,
120    #[serde(rename = "clone_url")]
121    pub clone_url: String,
122    #[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
123    pub mirror_url: Option<String>,
124    #[serde(rename = "hooks_url")]
125    pub hooks_url: String,
126    #[serde(rename = "svn_url")]
127    pub svn_url: String,
128    #[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
129    pub homepage: Option<String>,
130    #[serde(rename = "language", deserialize_with = "Option::deserialize")]
131    pub language: Option<String>,
132    #[serde(rename = "forks_count")]
133    pub forks_count: i32,
134    #[serde(rename = "stargazers_count")]
135    pub stargazers_count: i32,
136    #[serde(rename = "watchers_count")]
137    pub watchers_count: i32,
138    /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.
139    #[serde(rename = "size")]
140    pub size: i32,
141    /// The default branch of the repository.
142    #[serde(rename = "default_branch")]
143    pub default_branch: String,
144    #[serde(rename = "open_issues_count")]
145    pub open_issues_count: i32,
146    /// Whether this repository acts as a template that can be used to generate new repositories.
147    #[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
148    pub is_template: Option<bool>,
149    #[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
150    pub topics: Option<Vec<String>>,
151    /// Whether issues are enabled.
152    #[serde(rename = "has_issues")]
153    pub has_issues: bool,
154    /// Whether projects are enabled.
155    #[serde(rename = "has_projects")]
156    pub has_projects: bool,
157    /// Whether the wiki is enabled.
158    #[serde(rename = "has_wiki")]
159    pub has_wiki: bool,
160    #[serde(rename = "has_pages")]
161    pub has_pages: bool,
162    /// Whether downloads are enabled.
163    #[serde(rename = "has_downloads")]
164    pub has_downloads: bool,
165    /// Whether discussions are enabled.
166    #[serde(rename = "has_discussions", skip_serializing_if = "Option::is_none")]
167    pub has_discussions: Option<bool>,
168    /// Whether the repository is archived.
169    #[serde(rename = "archived")]
170    pub archived: bool,
171    /// Returns whether or not this repository disabled.
172    #[serde(rename = "disabled")]
173    pub disabled: bool,
174    /// The repository visibility: public, private, or internal.
175    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
176    pub visibility: Option<String>,
177    #[serde(rename = "pushed_at", deserialize_with = "Option::deserialize")]
178    pub pushed_at: Option<String>,
179    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
180    pub created_at: Option<String>,
181    #[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
182    pub updated_at: Option<String>,
183    /// Whether to allow rebase merges for pull requests.
184    #[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
185    pub allow_rebase_merge: Option<bool>,
186    #[serde(rename = "temp_clone_token", skip_serializing_if = "Option::is_none")]
187    pub temp_clone_token: Option<String>,
188    /// Whether to allow squash merges for pull requests.
189    #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
190    pub allow_squash_merge: Option<bool>,
191    /// Whether to allow Auto-merge to be used on pull requests.
192    #[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
193    pub allow_auto_merge: Option<bool>,
194    /// Whether to delete head branches when pull requests are merged
195    #[serde(rename = "delete_branch_on_merge", skip_serializing_if = "Option::is_none")]
196    pub delete_branch_on_merge: Option<bool>,
197    /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.
198    #[serde(rename = "allow_update_branch", skip_serializing_if = "Option::is_none")]
199    pub allow_update_branch: Option<bool>,
200    /// 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.
201    #[serde(rename = "use_squash_pr_title_as_default", skip_serializing_if = "Option::is_none")]
202    pub use_squash_pr_title_as_default: Option<bool>,
203    /// 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).
204    #[serde(rename = "squash_merge_commit_title", skip_serializing_if = "Option::is_none")]
205    pub squash_merge_commit_title: Option<SquashMergeCommitTitle>,
206    /// 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.
207    #[serde(rename = "squash_merge_commit_message", skip_serializing_if = "Option::is_none")]
208    pub squash_merge_commit_message: Option<SquashMergeCommitMessage>,
209    /// 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).
210    #[serde(rename = "merge_commit_title", skip_serializing_if = "Option::is_none")]
211    pub merge_commit_title: Option<MergeCommitTitle>,
212    /// 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.
213    #[serde(rename = "merge_commit_message", skip_serializing_if = "Option::is_none")]
214    pub merge_commit_message: Option<MergeCommitMessage>,
215    /// Whether to allow merge commits for pull requests.
216    #[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
217    pub allow_merge_commit: Option<bool>,
218    /// Whether to allow forking this repo
219    #[serde(rename = "allow_forking", skip_serializing_if = "Option::is_none")]
220    pub allow_forking: Option<bool>,
221    /// Whether to require contributors to sign off on web-based commits
222    #[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
223    pub web_commit_signoff_required: Option<bool>,
224    #[serde(rename = "open_issues")]
225    pub open_issues: i32,
226    #[serde(rename = "watchers")]
227    pub watchers: i32,
228    #[serde(rename = "master_branch", skip_serializing_if = "Option::is_none")]
229    pub master_branch: Option<String>,
230    #[serde(rename = "starred_at", skip_serializing_if = "Option::is_none")]
231    pub starred_at: Option<String>,
232    /// Whether anonymous git access is enabled for this repository
233    #[serde(rename = "anonymous_access_enabled", skip_serializing_if = "Option::is_none")]
234    pub anonymous_access_enabled: Option<bool>,
235}
236
237impl NullableRepository {
238    /// A repository on GitHub.
239    pub fn new(id: i32, node_id: String, name: String, full_name: String, license: Option<models::NullableLicenseSimple>, forks: i32, owner: models::SimpleUser, private: bool, html_url: String, description: Option<String>, fork: bool, url: String, archive_url: String, assignees_url: String, blobs_url: String, branches_url: String, collaborators_url: String, comments_url: String, commits_url: String, compare_url: String, contents_url: String, contributors_url: String, deployments_url: String, downloads_url: String, events_url: String, forks_url: String, git_commits_url: String, git_refs_url: String, git_tags_url: String, git_url: String, issue_comment_url: String, issue_events_url: String, issues_url: String, keys_url: String, labels_url: String, languages_url: String, merges_url: String, milestones_url: String, notifications_url: String, pulls_url: String, releases_url: String, ssh_url: String, stargazers_url: String, statuses_url: String, subscribers_url: String, subscription_url: String, tags_url: String, teams_url: String, trees_url: String, clone_url: String, mirror_url: Option<String>, hooks_url: String, svn_url: String, homepage: Option<String>, language: Option<String>, forks_count: i32, stargazers_count: i32, watchers_count: i32, size: i32, default_branch: String, open_issues_count: i32, has_issues: bool, has_projects: bool, has_wiki: bool, has_pages: bool, has_downloads: bool, archived: bool, disabled: bool, pushed_at: Option<String>, created_at: Option<String>, updated_at: Option<String>, open_issues: i32, watchers: i32) -> NullableRepository {
240        NullableRepository {
241            id,
242            node_id,
243            name,
244            full_name,
245            license: license.map(Box::new),
246            forks,
247            permissions: None,
248            owner: Box::new(owner),
249            private,
250            html_url,
251            description,
252            fork,
253            url,
254            archive_url,
255            assignees_url,
256            blobs_url,
257            branches_url,
258            collaborators_url,
259            comments_url,
260            commits_url,
261            compare_url,
262            contents_url,
263            contributors_url,
264            deployments_url,
265            downloads_url,
266            events_url,
267            forks_url,
268            git_commits_url,
269            git_refs_url,
270            git_tags_url,
271            git_url,
272            issue_comment_url,
273            issue_events_url,
274            issues_url,
275            keys_url,
276            labels_url,
277            languages_url,
278            merges_url,
279            milestones_url,
280            notifications_url,
281            pulls_url,
282            releases_url,
283            ssh_url,
284            stargazers_url,
285            statuses_url,
286            subscribers_url,
287            subscription_url,
288            tags_url,
289            teams_url,
290            trees_url,
291            clone_url,
292            mirror_url,
293            hooks_url,
294            svn_url,
295            homepage,
296            language,
297            forks_count,
298            stargazers_count,
299            watchers_count,
300            size,
301            default_branch,
302            open_issues_count,
303            is_template: None,
304            topics: None,
305            has_issues,
306            has_projects,
307            has_wiki,
308            has_pages,
309            has_downloads,
310            has_discussions: None,
311            archived,
312            disabled,
313            visibility: None,
314            pushed_at,
315            created_at,
316            updated_at,
317            allow_rebase_merge: None,
318            temp_clone_token: None,
319            allow_squash_merge: None,
320            allow_auto_merge: None,
321            delete_branch_on_merge: None,
322            allow_update_branch: None,
323            use_squash_pr_title_as_default: None,
324            squash_merge_commit_title: None,
325            squash_merge_commit_message: None,
326            merge_commit_title: None,
327            merge_commit_message: None,
328            allow_merge_commit: None,
329            allow_forking: None,
330            web_commit_signoff_required: None,
331            open_issues,
332            watchers,
333            master_branch: None,
334            starred_at: None,
335            anonymous_access_enabled: None,
336        }
337    }
338}
339/// 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).
340#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
341pub enum SquashMergeCommitTitle {
342    #[serde(rename = "PR_TITLE")]
343    PrTitle,
344    #[serde(rename = "COMMIT_OR_PR_TITLE")]
345    CommitOrPrTitle,
346}
347
348impl Default for SquashMergeCommitTitle {
349    fn default() -> SquashMergeCommitTitle {
350        Self::PrTitle
351    }
352}
353/// 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.
354#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
355pub enum SquashMergeCommitMessage {
356    #[serde(rename = "PR_BODY")]
357    PrBody,
358    #[serde(rename = "COMMIT_MESSAGES")]
359    CommitMessages,
360    #[serde(rename = "BLANK")]
361    Blank,
362}
363
364impl Default for SquashMergeCommitMessage {
365    fn default() -> SquashMergeCommitMessage {
366        Self::PrBody
367    }
368}
369/// 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).
370#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
371pub enum MergeCommitTitle {
372    #[serde(rename = "PR_TITLE")]
373    PrTitle,
374    #[serde(rename = "MERGE_MESSAGE")]
375    MergeMessage,
376}
377
378impl Default for MergeCommitTitle {
379    fn default() -> MergeCommitTitle {
380        Self::PrTitle
381    }
382}
383/// 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.
384#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
385pub enum MergeCommitMessage {
386    #[serde(rename = "PR_BODY")]
387    PrBody,
388    #[serde(rename = "PR_TITLE")]
389    PrTitle,
390    #[serde(rename = "BLANK")]
391    Blank,
392}
393
394impl Default for MergeCommitMessage {
395    fn default() -> MergeCommitMessage {
396        Self::PrBody
397    }
398}
399