orvanta-api 3.2.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.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

/// PendingUserTask : One `<userTask>` parked awaiting a human, with the process context needed to act on it (#1104). Every field is read off the persisted process status or the compiled user-task model -- there is no claim ledger and no `claimed_by`, because the engine records no such thing. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PendingUserTask {
    /// the process instance -- the `id` path segment of the completion operation
    #[serde(rename = "instance_id")]
    pub instance_id: uuid::Uuid,
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    /// the `<userTask>` element id -- the `user_task_id` path segment of the completion operation
    #[serde(rename = "element_id")]
    pub element_id: String,
    /// `<userTask name=\"...\">`, the label an author wrote for a human
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    #[serde(rename = "bpmn_flow_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bpmn_flow_path: Option<Option<String>>,
    #[serde(rename = "bpmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bpmn_version: Option<Option<i64>>,
    #[serde(rename = "instance_created_at")]
    pub instance_created_at: String,
    #[serde(rename = "instance_created_by")]
    pub instance_created_by: String,
    /// When the token arrived at this element, from the engine's own bounded history. Null for a park older than the retained history. 
    #[serde(rename = "parked_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub parked_at: Option<Option<String>>,
    /// `flowable:assignee` / `<humanPerformer>`, when written as a literal
    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub assignee: Option<Option<String>>,
    #[serde(rename = "owner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub owner: Option<Option<String>>,
    #[serde(rename = "candidate_users", skip_serializing_if = "Option::is_none")]
    pub candidate_users: Option<Vec<String>>,
    #[serde(rename = "candidate_groups", skip_serializing_if = "Option::is_none")]
    pub candidate_groups: Option<Vec<String>>,
    /// The task declares an assignment written as an expression, which this path cannot evaluate. The task is still listed (hiding it would make it unreachable, which is the defect #1104 is about) but a client must not present it as unassigned. 
    #[serde(rename = "assignment_unresolved", skip_serializing_if = "Option::is_none")]
    pub assignment_unresolved: Option<bool>,
    /// presentational only -- nothing schedules on it
    #[serde(rename = "due_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub due_date: Option<Option<String>>,
    #[serde(rename = "priority", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub priority: Option<Option<String>>,
    /// `flowable:formKey`, reported but never resolved (#705 phase 4)
    #[serde(rename = "form_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub form_key: Option<Option<String>>,
    #[serde(rename = "form_fields", skip_serializing_if = "Option::is_none")]
    pub form_fields: Option<Vec<models::BpmnUserTaskFormField>>,
    /// the model set `flowable:formFieldValidation=\"false\"`, so the server will not validate the payload
    #[serde(rename = "form_validation_disabled", skip_serializing_if = "Option::is_none")]
    pub form_validation_disabled: Option<bool>,
}

impl PendingUserTask {
    /// One `<userTask>` parked awaiting a human, with the process context needed to act on it (#1104). Every field is read off the persisted process status or the compiled user-task model -- there is no claim ledger and no `claimed_by`, because the engine records no such thing. 
    pub fn new(instance_id: uuid::Uuid, workspace_id: String, element_id: String, instance_created_at: String, instance_created_by: String) -> PendingUserTask {
        PendingUserTask {
            instance_id,
            workspace_id,
            element_id,
            name: None,
            bpmn_flow_path: None,
            bpmn_version: None,
            instance_created_at,
            instance_created_by,
            parked_at: None,
            assignee: None,
            owner: None,
            candidate_users: None,
            candidate_groups: None,
            assignment_unresolved: None,
            due_date: None,
            priority: None,
            form_key: None,
            form_fields: None,
            form_validation_disabled: None,
        }
    }
}