orvanta-api 3.1.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

/// 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. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnUserTaskFormField {
    /// the field's name in the process's variable space
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "label", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub label: Option<Option<String>>,
    /// carried verbatim from the document: string, long, enum, date, boolean, ...
    #[serde(rename = "field_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub field_type: Option<Option<String>>,
    #[serde(rename = "date_pattern", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub date_pattern: Option<Option<String>>,
    /// the process variable this field reads/writes when it differs from id
    #[serde(rename = "variable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub variable: Option<Option<String>>,
    /// the declared default, as authored (a literal or an expression)
    #[serde(rename = "default", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub default: Option<Option<serde_json::Value>>,
    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
    pub required: Option<bool>,
    #[serde(rename = "readable")]
    pub readable: bool,
    #[serde(rename = "writable")]
    pub writable: bool,
    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<models::BpmnUserTaskFormFieldValue>>,
    #[serde(rename = "origin")]
    pub origin: Origin,
}

impl 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. 
    pub fn new(id: String, readable: bool, writable: bool, origin: Origin) -> BpmnUserTaskFormField {
        BpmnUserTaskFormField {
            id,
            label: None,
            field_type: None,
            date_pattern: None,
            variable: None,
            default: None,
            required: None,
            readable,
            writable,
            values: None,
            origin,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Origin {
    #[serde(rename = "dialect_form_property")]
    Property,
    #[serde(rename = "dialect_form_field")]
    Field,
}

impl Default for Origin {
    fn default() -> Origin {
        Self::Property
    }
}