jira_api_v2/models/
create_workflow_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/// CreateWorkflowDetails : The details of a workflow.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateWorkflowDetails {
17    /// The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be separated by a whitespace but the name cannot start or end with a whitespace.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The description of the workflow. The maximum length is 1000 characters.
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    /// The transitions of the workflow. For the request to be valid, these transitions must:   *  include one *initial* transition.  *  not use the same name for a *global* and *directed* transition.  *  have a unique name for each *global* transition.  *  have a unique 'to' status for each *global* transition.  *  have unique names for each transition from a status.  *  not have a 'from' status on *initial* and *global* transitions.  *  have a 'from' status on *directed* transitions.  All the transition statuses must be included in `statuses`.
24    #[serde(rename = "transitions")]
25    pub transitions: Vec<models::CreateWorkflowTransitionDetails>,
26    /// The statuses of the workflow. Any status that does not include a transition is added to the workflow without a transition.
27    #[serde(rename = "statuses")]
28    pub statuses: Vec<models::CrateWorkflowStatusDetails>,
29}
30
31impl CreateWorkflowDetails {
32    /// The details of a workflow.
33    pub fn new(name: String, transitions: Vec<models::CreateWorkflowTransitionDetails>, statuses: Vec<models::CrateWorkflowStatusDetails>) -> CreateWorkflowDetails {
34        CreateWorkflowDetails {
35            name,
36            description: None,
37            transitions,
38            statuses,
39        }
40    }
41}
42