/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT-48dd1e2d75e7eac65741e465279d2700f927137d
 * Contact: ecosystem@atlassian.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// AvailableWorkflowConnectRule : The Connect provided ecosystem rules available.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AvailableWorkflowConnectRule {
    /// The add-on providing the rule.
    #[serde(rename = "addonKey", skip_serializing_if = "Option::is_none")]
    pub addon_key: Option<String>,
    /// The URL creation path segment defined in the Connect module.
    #[serde(rename = "createUrl", skip_serializing_if = "Option::is_none")]
    pub create_url: Option<String>,
    /// The rule description.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The URL edit path segment defined in the Connect module.
    #[serde(rename = "editUrl", skip_serializing_if = "Option::is_none")]
    pub edit_url: Option<String>,
    /// The module providing the rule.
    #[serde(rename = "moduleKey", skip_serializing_if = "Option::is_none")]
    pub module_key: Option<String>,
    /// The rule name.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The rule key.
    #[serde(rename = "ruleKey", skip_serializing_if = "Option::is_none")]
    pub rule_key: Option<String>,
    /// The rule type.
    #[serde(rename = "ruleType", skip_serializing_if = "Option::is_none")]
    pub rule_type: Option<RuleType>,
    /// The URL view path segment defined in the Connect module.
    #[serde(rename = "viewUrl", skip_serializing_if = "Option::is_none")]
    pub view_url: Option<String>,
}

impl AvailableWorkflowConnectRule {
    /// The Connect provided ecosystem rules available.
    pub fn new() -> AvailableWorkflowConnectRule {
        AvailableWorkflowConnectRule {
            addon_key: None,
            create_url: None,
            description: None,
            edit_url: None,
            module_key: None,
            name: None,
            rule_key: None,
            rule_type: None,
            view_url: None,
        }
    }
}
/// The rule type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RuleType {
    #[serde(rename = "Condition")]
    Condition,
    #[serde(rename = "Validator")]
    Validator,
    #[serde(rename = "Function")]
    Function,
    #[serde(rename = "Screen")]
    Screen,
}

impl Default for RuleType {
    fn default() -> RuleType {
        Self::Condition
    }
}

