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