gitea_rs/models/
create_hook_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/// CreateHookOption : CreateHookOption options when create a hook
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct CreateHookOption {
17    #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
18    pub active: Option<bool>,
19    #[serde(rename = "authorization_header", skip_serializing_if = "Option::is_none")]
20    pub authorization_header: Option<String>,
21    #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")]
22    pub branch_filter: Option<String>,
23    /// CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required
24    #[serde(rename = "config")]
25    pub config: ::std::collections::HashMap<String, String>,
26    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
27    pub events: Option<Vec<String>>,
28    #[serde(rename = "type")]
29    pub r#type: RHashType,
30}
31
32impl CreateHookOption {
33    /// CreateHookOption options when create a hook
34    pub fn new(config: ::std::collections::HashMap<String, String>, r#type: RHashType) -> CreateHookOption {
35        CreateHookOption {
36            active: None,
37            authorization_header: None,
38            branch_filter: None,
39            config,
40            events: None,
41            r#type,
42        }
43    }
44}
45
46/// 
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum RHashType {
49    #[serde(rename = "dingtalk")]
50    Dingtalk,
51    #[serde(rename = "discord")]
52    Discord,
53    #[serde(rename = "gitea")]
54    Gitea,
55    #[serde(rename = "gogs")]
56    Gogs,
57    #[serde(rename = "msteams")]
58    Msteams,
59    #[serde(rename = "slack")]
60    Slack,
61    #[serde(rename = "telegram")]
62    Telegram,
63    #[serde(rename = "feishu")]
64    Feishu,
65    #[serde(rename = "wechatwork")]
66    Wechatwork,
67    #[serde(rename = "packagist")]
68    Packagist,
69}
70
71impl Default for RHashType {
72    fn default() -> RHashType {
73        Self::Dingtalk
74    }
75}
76