openapi_github/models/
repos_create_for_authenticated_user_request.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ReposCreateForAuthenticatedUserRequest {
16    /// The name of the repository.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// A short description of the repository.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// A URL with more information about the repository.
23    #[serde(rename = "homepage", skip_serializing_if = "Option::is_none")]
24    pub homepage: Option<String>,
25    /// Whether the repository is private.
26    #[serde(rename = "private", skip_serializing_if = "Option::is_none")]
27    pub private: Option<bool>,
28    /// Whether issues are enabled.
29    #[serde(rename = "has_issues", skip_serializing_if = "Option::is_none")]
30    pub has_issues: Option<bool>,
31    /// Whether projects are enabled.
32    #[serde(rename = "has_projects", skip_serializing_if = "Option::is_none")]
33    pub has_projects: Option<bool>,
34    /// Whether the wiki is enabled.
35    #[serde(rename = "has_wiki", skip_serializing_if = "Option::is_none")]
36    pub has_wiki: Option<bool>,
37    /// Whether discussions are enabled.
38    #[serde(rename = "has_discussions", skip_serializing_if = "Option::is_none")]
39    pub has_discussions: Option<bool>,
40    /// The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.
41    #[serde(rename = "team_id", skip_serializing_if = "Option::is_none")]
42    pub team_id: Option<i32>,
43    /// Whether the repository is initialized with a minimal README.
44    #[serde(rename = "auto_init", skip_serializing_if = "Option::is_none")]
45    pub auto_init: Option<bool>,
46    /// The desired language or platform to apply to the .gitignore.
47    #[serde(rename = "gitignore_template", skip_serializing_if = "Option::is_none")]
48    pub gitignore_template: Option<String>,
49    /// The license keyword of the open source license for this repository.
50    #[serde(rename = "license_template", skip_serializing_if = "Option::is_none")]
51    pub license_template: Option<String>,
52    /// Whether to allow squash merges for pull requests.
53    #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
54    pub allow_squash_merge: Option<bool>,
55    /// Whether to allow merge commits for pull requests.
56    #[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
57    pub allow_merge_commit: Option<bool>,
58    /// Whether to allow rebase merges for pull requests.
59    #[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
60    pub allow_rebase_merge: Option<bool>,
61    /// Whether to allow Auto-merge to be used on pull requests.
62    #[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
63    pub allow_auto_merge: Option<bool>,
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    /// 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).
68    #[serde(rename = "squash_merge_commit_title", skip_serializing_if = "Option::is_none")]
69    pub squash_merge_commit_title: Option<SquashMergeCommitTitle>,
70    /// 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.
71    #[serde(rename = "squash_merge_commit_message", skip_serializing_if = "Option::is_none")]
72    pub squash_merge_commit_message: Option<SquashMergeCommitMessage>,
73    /// 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).
74    #[serde(rename = "merge_commit_title", skip_serializing_if = "Option::is_none")]
75    pub merge_commit_title: Option<MergeCommitTitle>,
76    /// 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.
77    #[serde(rename = "merge_commit_message", skip_serializing_if = "Option::is_none")]
78    pub merge_commit_message: Option<MergeCommitMessage>,
79    /// Whether downloads are enabled.
80    #[serde(rename = "has_downloads", skip_serializing_if = "Option::is_none")]
81    pub has_downloads: Option<bool>,
82    /// Whether this repository acts as a template that can be used to generate new repositories.
83    #[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
84    pub is_template: Option<bool>,
85}
86
87impl ReposCreateForAuthenticatedUserRequest {
88    pub fn new(name: String) -> ReposCreateForAuthenticatedUserRequest {
89        ReposCreateForAuthenticatedUserRequest {
90            name,
91            description: None,
92            homepage: None,
93            private: None,
94            has_issues: None,
95            has_projects: None,
96            has_wiki: None,
97            has_discussions: None,
98            team_id: None,
99            auto_init: None,
100            gitignore_template: None,
101            license_template: None,
102            allow_squash_merge: None,
103            allow_merge_commit: None,
104            allow_rebase_merge: None,
105            allow_auto_merge: None,
106            delete_branch_on_merge: None,
107            squash_merge_commit_title: None,
108            squash_merge_commit_message: None,
109            merge_commit_title: None,
110            merge_commit_message: None,
111            has_downloads: None,
112            is_template: None,
113        }
114    }
115}
116/// 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).
117#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
118pub enum SquashMergeCommitTitle {
119    #[serde(rename = "PR_TITLE")]
120    PrTitle,
121    #[serde(rename = "COMMIT_OR_PR_TITLE")]
122    CommitOrPrTitle,
123}
124
125impl Default for SquashMergeCommitTitle {
126    fn default() -> SquashMergeCommitTitle {
127        Self::PrTitle
128    }
129}
130/// 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.
131#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
132pub enum SquashMergeCommitMessage {
133    #[serde(rename = "PR_BODY")]
134    PrBody,
135    #[serde(rename = "COMMIT_MESSAGES")]
136    CommitMessages,
137    #[serde(rename = "BLANK")]
138    Blank,
139}
140
141impl Default for SquashMergeCommitMessage {
142    fn default() -> SquashMergeCommitMessage {
143        Self::PrBody
144    }
145}
146/// 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).
147#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
148pub enum MergeCommitTitle {
149    #[serde(rename = "PR_TITLE")]
150    PrTitle,
151    #[serde(rename = "MERGE_MESSAGE")]
152    MergeMessage,
153}
154
155impl Default for MergeCommitTitle {
156    fn default() -> MergeCommitTitle {
157        Self::PrTitle
158    }
159}
160/// 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.
161#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
162pub enum MergeCommitMessage {
163    #[serde(rename = "PR_BODY")]
164    PrBody,
165    #[serde(rename = "PR_TITLE")]
166    PrTitle,
167    #[serde(rename = "BLANK")]
168    Blank,
169}
170
171impl Default for MergeCommitMessage {
172    fn default() -> MergeCommitMessage {
173        Self::PrBody
174    }
175}
176