jira_v3_openapi 1.5.0

Jira Cloud platform REST API lib (OpenAPI document version: 1001.0.0-SNAPSHOT-37416ade0f89f7cb291510843b8a4bbd682b33a1)
Documentation
/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT-37416ade0f89f7cb291510843b8a4bbd682b33a1
 * Contact: ecosystem@atlassian.com
 * Generated by: https://openapi-generator.tech
 */

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

/// TransitionPayload : The payload for creating a transition in a workflow. Can be DIRECTED, GLOBAL, SELF-LOOPED, GLOBAL LOOPED
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransitionPayload {
    /// The actions that are performed when the transition is made
    #[serde(rename = "actions", skip_serializing_if = "Option::is_none")]
    pub actions: Option<Vec<models::RulePayload>>,
    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Box<models::ConditionGroupPayload>>,
    /// Mechanism in Jira for triggering certain actions, like notifications, automations, etc. Unless a custom notification scheme is configure, it's better not to provide any value here
    #[serde(rename = "customIssueEventId", skip_serializing_if = "Option::is_none")]
    pub custom_issue_event_id: Option<String>,
    /// The description of the transition
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The statuses that the transition can be made from
    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
    pub from: Option<Vec<models::FromLayoutPayload>>,
    /// The id of the transition
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// The name of the transition
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The properties of the transition
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
    pub to: Option<Box<models::ToLayoutPayload>>,
    #[serde(rename = "transitionScreen", skip_serializing_if = "Option::is_none")]
    pub transition_screen: Option<Box<models::RulePayload>>,
    /// The triggers that are performed when the transition is made
    #[serde(rename = "triggers", skip_serializing_if = "Option::is_none")]
    pub triggers: Option<Vec<models::RulePayload>>,
    /// The type of the transition
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// The validators that are performed when the transition is made
    #[serde(rename = "validators", skip_serializing_if = "Option::is_none")]
    pub validators: Option<Vec<models::RulePayload>>,
}

impl TransitionPayload {
    /// The payload for creating a transition in a workflow. Can be DIRECTED, GLOBAL, SELF-LOOPED, GLOBAL LOOPED
    pub fn new() -> TransitionPayload {
        TransitionPayload {
            actions: None,
            conditions: None,
            custom_issue_event_id: None,
            description: None,
            from: None,
            id: None,
            name: None,
            properties: None,
            to: None,
            transition_screen: None,
            triggers: None,
            r#type: None,
            validators: None,
        }
    }
}
/// The type of the transition
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "global")]
    Global,
    #[serde(rename = "initial")]
    Initial,
    #[serde(rename = "directed")]
    Directed,
}

impl Default for Type {
    fn default() -> Type {
        Self::Global
    }
}