Skip to main content

orvanta_api/models/
cmmn_case_model.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.0.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CmmnCaseModel : A case model joined with its latest version — the `get/{path}` shape. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CmmnCaseModel {
17    #[serde(rename = "workspace_id")]
18    pub workspace_id: String,
19    #[serde(rename = "path")]
20    pub path: String,
21    #[serde(rename = "summary")]
22    pub summary: String,
23    #[serde(rename = "description")]
24    pub description: String,
25    /// The CMMN 1.1 XML, byte-for-byte as deployed
26    #[serde(rename = "cmmn_xml")]
27    pub cmmn_xml: String,
28    /// The case's input schema, when the author declared one. Free-form here rather than a `$ref`: it is the same JSON-Schema-shaped object scripts and flows use, and it has no component of its own. 
29    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
30    pub schema: Option<serde_json::Value>,
31    #[serde(rename = "edited_by")]
32    pub edited_by: String,
33    #[serde(rename = "edited_at")]
34    pub edited_at: String,
35    #[serde(rename = "archived")]
36    pub archived: bool,
37    #[serde(rename = "extra_perms")]
38    pub extra_perms: std::collections::HashMap<String, bool>,
39    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
40    pub draft_only: Option<bool>,
41    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
42    pub labels: Option<Vec<String>>,
43    /// The `cmmn_case_model_version.id` this response was read from. A running case pins this id, never the path — which is what makes a rename safe (#1343). 
44    #[serde(rename = "version_id")]
45    pub version_id: i64,
46}
47
48impl CmmnCaseModel {
49    /// A case model joined with its latest version — the `get/{path}` shape. 
50    pub fn new(workspace_id: String, path: String, summary: String, description: String, cmmn_xml: String, edited_by: String, edited_at: String, archived: bool, extra_perms: std::collections::HashMap<String, bool>, version_id: i64) -> CmmnCaseModel {
51        CmmnCaseModel {
52            workspace_id,
53            path,
54            summary,
55            description,
56            cmmn_xml,
57            schema: None,
58            edited_by,
59            edited_at,
60            archived,
61            extra_perms,
62            draft_only: None,
63            labels: None,
64            version_id,
65        }
66    }
67}
68