jira-api-v2 1.0.1

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

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

/// Transition : Details of a workflow transition.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Transition {
    /// The ID of the transition.
    #[serde(rename = "id")]
    pub id: String,
    /// The name of the transition.
    #[serde(rename = "name")]
    pub name: String,
    /// The description of the transition.
    #[serde(rename = "description")]
    pub description: String,
    /// The statuses the transition can start from.
    #[serde(rename = "from")]
    pub from: Vec<String>,
    /// The status the transition goes to.
    #[serde(rename = "to")]
    pub to: String,
    /// The type of the transition.
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "screen", skip_serializing_if = "Option::is_none")]
    pub screen: Option<Box<models::ScreenId>>,
    #[serde(rename = "rules", skip_serializing_if = "Option::is_none")]
    pub rules: Option<Box<models::WorkflowRules>>,
}

impl Transition {
    /// Details of a workflow transition.
    pub fn new(id: String, name: String, description: String, from: Vec<String>, to: String, r#type: Type) -> Transition {
        Transition {
            id,
            name,
            description,
            from,
            to,
            r#type,
            screen: None,
            rules: 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
    }
}