jira_v3_openapi 1.5.0

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

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

/// WorkflowUpdate : The details of the workflows to update.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowUpdate {
    /// The mapping of old to new status ID.
    #[serde(rename = "defaultStatusMappings", skip_serializing_if = "Option::is_none")]
    pub default_status_mappings: Option<Vec<models::StatusMigration>>,
    /// The new description for this workflow.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The ID of this workflow.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "loopedTransitionContainerLayout", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub looped_transition_container_layout: Option<Option<Box<models::WorkflowLayout>>>,
    #[serde(rename = "startPointLayout", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub start_point_layout: Option<Option<Box<models::WorkflowLayout>>>,
    /// The mapping of old to new status ID for a specific project and issue type.
    #[serde(rename = "statusMappings", skip_serializing_if = "Option::is_none")]
    pub status_mappings: Option<Vec<models::StatusMappingDto>>,
    /// The statuses associated with this workflow.
    #[serde(rename = "statuses")]
    pub statuses: Vec<models::StatusLayoutUpdate>,
    /// The transitions of this workflow.
    #[serde(rename = "transitions")]
    pub transitions: Vec<models::TransitionUpdateDto>,
    #[serde(rename = "version")]
    pub version: Box<models::DocumentVersion>,
}

impl WorkflowUpdate {
    /// The details of the workflows to update.
    pub fn new(id: String, statuses: Vec<models::StatusLayoutUpdate>, transitions: Vec<models::TransitionUpdateDto>, version: models::DocumentVersion) -> WorkflowUpdate {
        WorkflowUpdate {
            default_status_mappings: None,
            description: None,
            id,
            looped_transition_container_layout: None,
            start_point_layout: None,
            status_mappings: None,
            statuses,
            transitions,
            version: Box::new(version),
        }
    }
}