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