1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReposUpdateRequest {
/// The name of the repository.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// A short description of the repository.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// A URL with more information about the repository.
#[serde(rename = "homepage", skip_serializing_if = "Option::is_none")]
pub homepage: Option<String>,
/// Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private.
#[serde(rename = "private", skip_serializing_if = "Option::is_none")]
pub private: Option<bool>,
/// The visibility of the repository.
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
pub visibility: Option<Visibility>,
#[serde(rename = "security_and_analysis", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub security_and_analysis: Option<Option<Box<models::ReposUpdateRequestSecurityAndAnalysis>>>,
/// Either `true` to enable issues for this repository or `false` to disable them.
#[serde(rename = "has_issues", skip_serializing_if = "Option::is_none")]
pub has_issues: Option<bool>,
/// Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error.
#[serde(rename = "has_projects", skip_serializing_if = "Option::is_none")]
pub has_projects: Option<bool>,
/// Either `true` to enable the wiki for this repository or `false` to disable it.
#[serde(rename = "has_wiki", skip_serializing_if = "Option::is_none")]
pub has_wiki: Option<bool>,
/// Either `true` to make this repo available as a template repository or `false` to prevent it.
#[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
pub is_template: Option<bool>,
/// Updates the default branch for this repository.
#[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")]
pub default_branch: Option<String>,
/// Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.
#[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
pub allow_squash_merge: Option<bool>,
/// Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.
#[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
pub allow_merge_commit: Option<bool>,
/// Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.
#[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
pub allow_rebase_merge: Option<bool>,
/// Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge.
#[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
pub allow_auto_merge: Option<bool>,
/// Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion.
#[serde(rename = "delete_branch_on_merge", skip_serializing_if = "Option::is_none")]
pub delete_branch_on_merge: Option<bool>,
/// Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise.
#[serde(rename = "allow_update_branch", skip_serializing_if = "Option::is_none")]
pub allow_update_branch: Option<bool>,
/// Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead.
#[serde(rename = "use_squash_pr_title_as_default", skip_serializing_if = "Option::is_none")]
pub use_squash_pr_title_as_default: Option<bool>,
/// 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).
#[serde(rename = "squash_merge_commit_title", skip_serializing_if = "Option::is_none")]
pub squash_merge_commit_title: Option<SquashMergeCommitTitle>,
/// 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.
#[serde(rename = "squash_merge_commit_message", skip_serializing_if = "Option::is_none")]
pub squash_merge_commit_message: Option<SquashMergeCommitMessage>,
/// 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).
#[serde(rename = "merge_commit_title", skip_serializing_if = "Option::is_none")]
pub merge_commit_title: Option<MergeCommitTitle>,
/// 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.
#[serde(rename = "merge_commit_message", skip_serializing_if = "Option::is_none")]
pub merge_commit_message: Option<MergeCommitMessage>,
/// Whether to archive this repository. `false` will unarchive a previously archived repository.
#[serde(rename = "archived", skip_serializing_if = "Option::is_none")]
pub archived: Option<bool>,
/// Either `true` to allow private forks, or `false` to prevent private forks.
#[serde(rename = "allow_forking", skip_serializing_if = "Option::is_none")]
pub allow_forking: Option<bool>,
/// Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits.
#[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
pub web_commit_signoff_required: Option<bool>,
}
impl ReposUpdateRequest {
pub fn new() -> ReposUpdateRequest {
ReposUpdateRequest {
name: None,
description: None,
homepage: None,
private: None,
visibility: None,
security_and_analysis: None,
has_issues: None,
has_projects: None,
has_wiki: None,
is_template: None,
default_branch: None,
allow_squash_merge: None,
allow_merge_commit: None,
allow_rebase_merge: None,
allow_auto_merge: None,
delete_branch_on_merge: None,
allow_update_branch: None,
use_squash_pr_title_as_default: None,
squash_merge_commit_title: None,
squash_merge_commit_message: None,
merge_commit_title: None,
merge_commit_message: None,
archived: None,
allow_forking: None,
web_commit_signoff_required: None,
}
}
}
/// The visibility of the repository.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Visibility {
#[serde(rename = "public")]
Public,
#[serde(rename = "private")]
Private,
}
impl Default for Visibility {
fn default() -> Visibility {
Self::Public
}
}
/// 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).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SquashMergeCommitTitle {
#[serde(rename = "PR_TITLE")]
PrTitle,
#[serde(rename = "COMMIT_OR_PR_TITLE")]
CommitOrPrTitle,
}
impl Default for SquashMergeCommitTitle {
fn default() -> SquashMergeCommitTitle {
Self::PrTitle
}
}
/// 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.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SquashMergeCommitMessage {
#[serde(rename = "PR_BODY")]
PrBody,
#[serde(rename = "COMMIT_MESSAGES")]
CommitMessages,
#[serde(rename = "BLANK")]
Blank,
}
impl Default for SquashMergeCommitMessage {
fn default() -> SquashMergeCommitMessage {
Self::PrBody
}
}
/// 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).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MergeCommitTitle {
#[serde(rename = "PR_TITLE")]
PrTitle,
#[serde(rename = "MERGE_MESSAGE")]
MergeMessage,
}
impl Default for MergeCommitTitle {
fn default() -> MergeCommitTitle {
Self::PrTitle
}
}
/// 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.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MergeCommitMessage {
#[serde(rename = "PR_BODY")]
PrBody,
#[serde(rename = "PR_TITLE")]
PrTitle,
#[serde(rename = "BLANK")]
Blank,
}
impl Default for MergeCommitMessage {
fn default() -> MergeCommitMessage {
Self::PrBody
}
}