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

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowSchemeReadResponse {
    #[serde(rename = "defaultWorkflow", skip_serializing_if = "Option::is_none")]
    pub default_workflow: Option<Box<models::WorkflowMetadataRestModel>>,
    /// The description of the workflow scheme.
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    /// The ID of the workflow scheme.
    #[serde(rename = "id")]
    pub id: String,
    /// The name of the workflow scheme.
    #[serde(rename = "name")]
    pub name: String,
    /// The IDs of projects using the workflow scheme.
    #[serde(rename = "projectIdsUsingScheme")]
    pub project_ids_using_scheme: Vec<String>,
    #[serde(rename = "scope")]
    pub scope: Box<models::WorkflowScope>,
    /// Indicates if there's an [asynchronous task](#async-operations) for this workflow scheme.
    #[serde(rename = "taskId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub task_id: Option<Option<String>>,
    #[serde(rename = "version")]
    pub version: Box<models::DocumentVersion>,
    /// Mappings from workflows to issue types.
    #[serde(rename = "workflowsForIssueTypes")]
    pub workflows_for_issue_types: Vec<models::WorkflowMetadataAndIssueTypeRestModel>,
}

impl WorkflowSchemeReadResponse {
    pub fn new(id: String, name: String, project_ids_using_scheme: Vec<String>, scope: models::WorkflowScope, version: models::DocumentVersion, workflows_for_issue_types: Vec<models::WorkflowMetadataAndIssueTypeRestModel>) -> WorkflowSchemeReadResponse {
        WorkflowSchemeReadResponse {
            default_workflow: None,
            description: None,
            id,
            name,
            project_ids_using_scheme,
            scope: Box::new(scope),
            task_id: None,
            version: Box::new(version),
            workflows_for_issue_types,
        }
    }
}

