gitea_client/models/
generate_repo_option.rs

1/*
2 * Gitea API
3 *
4 * This documentation describes the Gitea API.
5 *
6 * The version of the OpenAPI document: 1.22.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// GenerateRepoOption : GenerateRepoOption options when creating repository using a template
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GenerateRepoOption {
17    /// include avatar of the template repo
18    #[serde(rename = "avatar", skip_serializing_if = "Option::is_none")]
19    pub avatar: Option<bool>,
20    /// Default branch of the new repository
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    /// include git content of default branch in template repo
27    #[serde(rename = "git_content", skip_serializing_if = "Option::is_none")]
28    pub git_content: Option<bool>,
29    /// include git hooks in template repo
30    #[serde(rename = "git_hooks", skip_serializing_if = "Option::is_none")]
31    pub git_hooks: Option<bool>,
32    /// include labels in template repo
33    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
34    pub labels: Option<bool>,
35    /// Name of the repository to create
36    #[serde(rename = "name")]
37    pub name: String,
38    /// The organization or person who will own the new repository
39    #[serde(rename = "owner")]
40    pub owner: String,
41    /// Whether the repository is private
42    #[serde(rename = "private", skip_serializing_if = "Option::is_none")]
43    pub private: Option<bool>,
44    /// include protected branches in template repo
45    #[serde(rename = "protected_branch", skip_serializing_if = "Option::is_none")]
46    pub protected_branch: Option<bool>,
47    /// include topics in template repo
48    #[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
49    pub topics: Option<bool>,
50    /// include webhooks in template repo
51    #[serde(rename = "webhooks", skip_serializing_if = "Option::is_none")]
52    pub webhooks: Option<bool>,
53}
54
55impl GenerateRepoOption {
56    /// GenerateRepoOption options when creating repository using a template
57    pub fn new(name: String, owner: String) -> GenerateRepoOption {
58        GenerateRepoOption {
59            avatar: None,
60            default_branch: None,
61            description: None,
62            git_content: None,
63            git_hooks: None,
64            labels: None,
65            name,
66            owner,
67            private: None,
68            protected_branch: None,
69            topics: None,
70            webhooks: None,
71        }
72    }
73}
74