jira_api_v2/models/
transition.rs

1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Transition : Details of a workflow transition.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Transition {
17    /// The ID of the transition.
18    #[serde(rename = "id")]
19    pub id: String,
20    /// The name of the transition.
21    #[serde(rename = "name")]
22    pub name: String,
23    /// The description of the transition.
24    #[serde(rename = "description")]
25    pub description: String,
26    /// The statuses the transition can start from.
27    #[serde(rename = "from")]
28    pub from: Vec<String>,
29    /// The status the transition goes to.
30    #[serde(rename = "to")]
31    pub to: String,
32    /// The type of the transition.
33    #[serde(rename = "type")]
34    pub r#type: Type,
35    #[serde(rename = "screen", skip_serializing_if = "Option::is_none")]
36    pub screen: Option<Box<models::ScreenId>>,
37    #[serde(rename = "rules", skip_serializing_if = "Option::is_none")]
38    pub rules: Option<Box<models::WorkflowRules>>,
39}
40
41impl Transition {
42    /// Details of a workflow transition.
43    pub fn new(id: String, name: String, description: String, from: Vec<String>, to: String, r#type: Type) -> Transition {
44        Transition {
45            id,
46            name,
47            description,
48            from,
49            to,
50            r#type,
51            screen: None,
52            rules: None,
53        }
54    }
55}
56/// The type of the transition.
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59    #[serde(rename = "global")]
60    Global,
61    #[serde(rename = "initial")]
62    Initial,
63    #[serde(rename = "directed")]
64    Directed,
65}
66
67impl Default for Type {
68    fn default() -> Type {
69        Self::Global
70    }
71}
72