Skip to main content

orvanta_api/models/
bpmn_user_task_form_field.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: 3.1.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BpmnUserTaskFormField : One declared field of a user task's form, compiled from `<flowable:formProperty>` or `<camunda:formField>` (#705). This is the same model the completion payload is validated against (#833), so a client that renders exactly these fields and nothing else cannot submit something the server will reject for being unrecognised. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnUserTaskFormField {
17    /// the field's name in the process's variable space
18    #[serde(rename = "id")]
19    pub id: String,
20    #[serde(rename = "label", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub label: Option<Option<String>>,
22    /// carried verbatim from the document: string, long, enum, date, boolean, ...
23    #[serde(rename = "field_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub field_type: Option<Option<String>>,
25    #[serde(rename = "date_pattern", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub date_pattern: Option<Option<String>>,
27    /// the process variable this field reads/writes when it differs from id
28    #[serde(rename = "variable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub variable: Option<Option<String>>,
30    /// the declared default, as authored (a literal or an expression)
31    #[serde(rename = "default", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub default: Option<Option<serde_json::Value>>,
33    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
34    pub required: Option<bool>,
35    #[serde(rename = "readable")]
36    pub readable: bool,
37    #[serde(rename = "writable")]
38    pub writable: bool,
39    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
40    pub values: Option<Vec<models::BpmnUserTaskFormFieldValue>>,
41    #[serde(rename = "origin")]
42    pub origin: Origin,
43}
44
45impl BpmnUserTaskFormField {
46    /// One declared field of a user task's form, compiled from `<flowable:formProperty>` or `<camunda:formField>` (#705). This is the same model the completion payload is validated against (#833), so a client that renders exactly these fields and nothing else cannot submit something the server will reject for being unrecognised. 
47    pub fn new(id: String, readable: bool, writable: bool, origin: Origin) -> BpmnUserTaskFormField {
48        BpmnUserTaskFormField {
49            id,
50            label: None,
51            field_type: None,
52            date_pattern: None,
53            variable: None,
54            default: None,
55            required: None,
56            readable,
57            writable,
58            values: None,
59            origin,
60        }
61    }
62}
63/// 
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum Origin {
66    #[serde(rename = "dialect_form_property")]
67    Property,
68    #[serde(rename = "dialect_form_field")]
69    Field,
70}
71
72impl Default for Origin {
73    fn default() -> Origin {
74        Self::Property
75    }
76}
77