gitea_rs/models/
create_repo_option.rs

1/*
2 * Gitea API.
3 *
4 * This documentation describes the Gitea API.
5 *
6 * The version of the OpenAPI document: 1.19.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// CreateRepoOption : CreateRepoOption options when creating repository
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct CreateRepoOption {
17    /// Whether the repository should be auto-initialized?
18    #[serde(rename = "auto_init", skip_serializing_if = "Option::is_none")]
19    pub auto_init: Option<bool>,
20    /// DefaultBranch of the repository (used when initializes and in template)
21    #[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")]
22    pub default_branch: Option<String>,
23    /// Description of the repository to create
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    /// Gitignores to use
27    #[serde(rename = "gitignores", skip_serializing_if = "Option::is_none")]
28    pub gitignores: Option<String>,
29    /// Label-Set to use
30    #[serde(rename = "issue_labels", skip_serializing_if = "Option::is_none")]
31    pub issue_labels: Option<String>,
32    /// License to use
33    #[serde(rename = "license", skip_serializing_if = "Option::is_none")]
34    pub license: Option<String>,
35    /// Name of the repository to create
36    #[serde(rename = "name")]
37    pub name: String,
38    /// Whether the repository is private
39    #[serde(rename = "private", skip_serializing_if = "Option::is_none")]
40    pub private: Option<bool>,
41    /// Readme of the repository to create
42    #[serde(rename = "readme", skip_serializing_if = "Option::is_none")]
43    pub readme: Option<String>,
44    /// Whether the repository is template
45    #[serde(rename = "template", skip_serializing_if = "Option::is_none")]
46    pub template: Option<bool>,
47    /// TrustModel of the repository
48    #[serde(rename = "trust_model", skip_serializing_if = "Option::is_none")]
49    pub trust_model: Option<TrustModel>,
50}
51
52impl CreateRepoOption {
53    /// CreateRepoOption options when creating repository
54    pub fn new(name: String) -> CreateRepoOption {
55        CreateRepoOption {
56            auto_init: None,
57            default_branch: None,
58            description: None,
59            gitignores: None,
60            issue_labels: None,
61            license: None,
62            name,
63            private: None,
64            readme: None,
65            template: None,
66            trust_model: None,
67        }
68    }
69}
70
71/// TrustModel of the repository
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
73pub enum TrustModel {
74    #[serde(rename = "default")]
75    Default,
76    #[serde(rename = "collaborator")]
77    Collaborator,
78    #[serde(rename = "committer")]
79    Committer,
80    #[serde(rename = "collaboratorcommitter")]
81    Collaboratorcommitter,
82}
83
84impl Default for TrustModel {
85    fn default() -> TrustModel {
86        Self::Default
87    }
88}
89