jira_v3_openapi 1.6.1

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};

/// CreatePrioritySchemeDetails : Details of a new priority scheme
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreatePrioritySchemeDetails {
    /// The ID of the default priority for the priority scheme.
    #[serde(rename = "defaultPriorityId")]
    pub default_priority_id: i64,
    /// The description of the priority scheme.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Instructions to migrate the priorities of issues.  `in` mappings are used to migrate the priorities of issues to priorities used within the priority scheme.  `out` mappings are used to migrate the priorities of issues to priorities not used within the priority scheme.   *  When **priorities** are **added** to the new priority scheme, no mapping needs to be provided as the new priorities are not used by any issues.  *  When **priorities** are **removed** from the new priority scheme, no mapping needs to be provided as the removed priorities are not used by any issues.  *  When **projects** are **added** to the priority scheme, the priorities of issues in those projects might need to be migrated to new priorities used by the priority scheme. This can occur when the current scheme does not use all the priorities in the project(s)' priority scheme(s).           *  An `in` mapping must be provided for each of these priorities.  *  When **projects** are **removed** from the priority scheme, no mapping needs to be provided as the removed projects are not using the priorities of the new priority scheme.  For more information on `in` and `out` mappings, see the child properties documentation for the `PriorityMapping` object below.
    #[serde(rename = "mappings", skip_serializing_if = "Option::is_none")]
    pub mappings: Option<Box<models::PriorityMapping>>,
    /// The name of the priority scheme. Must be unique.
    #[serde(rename = "name")]
    pub name: String,
    /// The IDs of priorities in the scheme.
    #[serde(rename = "priorityIds")]
    pub priority_ids: Vec<i64>,
    /// The IDs of projects that will use the priority scheme.
    #[serde(rename = "projectIds", skip_serializing_if = "Option::is_none")]
    pub project_ids: Option<Vec<i64>>,
}

impl CreatePrioritySchemeDetails {
    /// Details of a new priority scheme
    pub fn new(default_priority_id: i64, name: String, priority_ids: Vec<i64>) -> CreatePrioritySchemeDetails {
        CreatePrioritySchemeDetails {
            default_priority_id,
            description: None,
            mappings: None,
            name,
            priority_ids,
            project_ids: None,
        }
    }
}