/*
 * Gitea API.
 *
 * This documentation describes the Gitea API.
 *
 * The version of the OpenAPI document: 1.17.3
 * 
 * Generated by: https://openapi-generator.tech
 */

/// CreateHookOption : CreateHookOption options when create a hook



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateHookOption {
    #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
    pub active: Option<bool>,
    #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")]
    pub branch_filter: Option<String>,
    /// CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required
    #[serde(rename = "config")]
    pub config: ::std::collections::HashMap<String, String>,
    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
    pub events: Option<Vec<String>>,
    #[serde(rename = "type")]
    pub r#type: RHashType,
}

impl CreateHookOption {
    /// CreateHookOption options when create a hook
    pub fn new(config: ::std::collections::HashMap<String, String>, r#type: RHashType) -> CreateHookOption {
        CreateHookOption {
            active: None,
            branch_filter: None,
            config,
            events: None,
            r#type,
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RHashType {
    #[serde(rename = "dingtalk")]
    Dingtalk,
    #[serde(rename = "discord")]
    Discord,
    #[serde(rename = "gitea")]
    Gitea,
    #[serde(rename = "gogs")]
    Gogs,
    #[serde(rename = "msteams")]
    Msteams,
    #[serde(rename = "slack")]
    Slack,
    #[serde(rename = "telegram")]
    Telegram,
    #[serde(rename = "feishu")]
    Feishu,
    #[serde(rename = "wechatwork")]
    Wechatwork,
    #[serde(rename = "packagist")]
    Packagist,
}

impl Default for RHashType {
    fn default() -> RHashType {
        Self::Dingtalk
    }
}

