jira_v3_openapi 1.6.0

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

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

/// WorkflowPayload : The payload for creating workflow, see https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/\\#api-rest-api-3-workflows-create-post
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowPayload {
    /// The description of the workflow
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "loopedTransitionContainerLayout", skip_serializing_if = "Option::is_none")]
    pub looped_transition_container_layout: Option<Box<models::WorkflowStatusLayoutPayload>>,
    /// The name of the workflow
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The strategy to use if there is a conflict with another workflow
    #[serde(rename = "onConflict", skip_serializing_if = "Option::is_none")]
    pub on_conflict: Option<OnConflict>,
    #[serde(rename = "pcri", skip_serializing_if = "Option::is_none")]
    pub pcri: Option<Box<models::ProjectCreateResourceIdentifier>>,
    #[serde(rename = "startPointLayout", skip_serializing_if = "Option::is_none")]
    pub start_point_layout: Option<Box<models::WorkflowStatusLayoutPayload>>,
    /// The statuses to be used in the workflow
    #[serde(rename = "statuses", skip_serializing_if = "Option::is_none")]
    pub statuses: Option<Vec<models::WorkflowStatusPayload>>,
    /// The transitions for the workflow
    #[serde(rename = "transitions", skip_serializing_if = "Option::is_none")]
    pub transitions: Option<Vec<models::TransitionPayload>>,
}

impl WorkflowPayload {
    /// The payload for creating workflow, see https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/\\#api-rest-api-3-workflows-create-post
    pub fn new() -> WorkflowPayload {
        WorkflowPayload {
            description: None,
            looped_transition_container_layout: None,
            name: None,
            on_conflict: None,
            pcri: None,
            start_point_layout: None,
            statuses: None,
            transitions: None,
        }
    }
}
/// The strategy to use if there is a conflict with another workflow
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OnConflict {
    #[serde(rename = "FAIL")]
    Fail,
    #[serde(rename = "USE")]
    Use,
    #[serde(rename = "NEW")]
    New,
}

impl Default for OnConflict {
    fn default() -> OnConflict {
        Self::Fail
    }
}