jira_api_v2/models/workflow_scheme.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/// WorkflowScheme : Details about a workflow scheme.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WorkflowScheme {
17 /// The ID of the workflow scheme.
18 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19 pub id: Option<i64>,
20 /// The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when creating a workflow scheme.
21 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
22 pub name: Option<String>,
23 /// The description of the workflow scheme.
24 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25 pub description: Option<String>,
26 /// The name of the default workflow for the workflow scheme. The default workflow has *All Unassigned Issue Types* assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to *Jira Workflow (jira)*.
27 #[serde(rename = "defaultWorkflow", skip_serializing_if = "Option::is_none")]
28 pub default_workflow: Option<String>,
29 /// The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one workflow in a workflow scheme.
30 #[serde(rename = "issueTypeMappings", skip_serializing_if = "Option::is_none")]
31 pub issue_type_mappings: Option<std::collections::HashMap<String, String>>,
32 /// For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The default workflow has *All Unassigned Issue Types* assigned to it in Jira.
33 #[serde(rename = "originalDefaultWorkflow", skip_serializing_if = "Option::is_none")]
34 pub original_default_workflow: Option<String>,
35 /// For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one workflow in a workflow scheme.
36 #[serde(rename = "originalIssueTypeMappings", skip_serializing_if = "Option::is_none")]
37 pub original_issue_type_mappings: Option<std::collections::HashMap<String, String>>,
38 /// Whether the workflow scheme is a draft or not.
39 #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
40 pub draft: Option<bool>,
41 /// The user that last modified the draft workflow scheme. A modification is a change to the issue type-project mappings only. This property does not apply to non-draft workflows.
42 #[serde(rename = "lastModifiedUser", skip_serializing_if = "Option::is_none")]
43 pub last_modified_user: Option<Box<models::User>>,
44 /// The date-time that the draft workflow scheme was last modified. A modification is a change to the issue type-project mappings only. This property does not apply to non-draft workflows.
45 #[serde(rename = "lastModified", skip_serializing_if = "Option::is_none")]
46 pub last_modified: Option<String>,
47 #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
48 pub param_self: Option<String>,
49 /// Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow scheme is a workflow scheme that is used by at least one project. The following examples show how this property works: * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is updated. Otherwise, a draft workflow scheme is created. * Update an active workflow scheme with `updateDraftIfNeeded` set to `false`: An error is returned, as active workflow schemes cannot be updated. * Update an inactive workflow scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do not require drafts to update. Defaults to `false`.
50 #[serde(rename = "updateDraftIfNeeded", skip_serializing_if = "Option::is_none")]
51 pub update_draft_if_needed: Option<bool>,
52 /// The issue types available in Jira.
53 #[serde(rename = "issueTypes", skip_serializing_if = "Option::is_none")]
54 pub issue_types: Option<std::collections::HashMap<String, models::IssueTypeDetails>>,
55}
56
57impl WorkflowScheme {
58 /// Details about a workflow scheme.
59 pub fn new() -> WorkflowScheme {
60 WorkflowScheme {
61 id: None,
62 name: None,
63 description: None,
64 default_workflow: None,
65 issue_type_mappings: None,
66 original_default_workflow: None,
67 original_issue_type_mappings: None,
68 draft: None,
69 last_modified_user: None,
70 last_modified: None,
71 param_self: None,
72 update_draft_if_needed: None,
73 issue_types: None,
74 }
75 }
76}
77