jira_api_v2/models/
create_workflow_transition_details.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/// CreateWorkflowTransitionDetails : The details of a workflow transition.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateWorkflowTransitionDetails {
17    /// The name of the transition. The maximum length is 60 characters.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The description of the transition. The maximum length is 1000 characters.
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    /// The statuses the transition can start from.
24    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
25    pub from: Option<Vec<String>>,
26    /// The status the transition goes to.
27    #[serde(rename = "to")]
28    pub to: String,
29    /// The type of the transition.
30    #[serde(rename = "type")]
31    pub r#type: Type,
32}
33
34impl CreateWorkflowTransitionDetails {
35    /// The details of a workflow transition.
36    pub fn new(name: String, to: String, r#type: Type) -> CreateWorkflowTransitionDetails {
37        CreateWorkflowTransitionDetails {
38            name,
39            description: None,
40            from: None,
41            to,
42            r#type,
43        }
44    }
45}
46/// The type of the transition.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Type {
49    #[serde(rename = "global")]
50    Global,
51    #[serde(rename = "initial")]
52    Initial,
53    #[serde(rename = "directed")]
54    Directed,
55}
56
57impl Default for Type {
58    fn default() -> Type {
59        Self::Global
60    }
61}
62