orvanta-api 6.5.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: 6.5.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, the compiled user-task model, or the `human_task_claim` ledger added by #1123. 
#[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,
    /// The parked token -- the park itself, and what a claim is taken on (#1123). A multi-instance or parallel-branch task parks several tokens at one element, each with its own resolved identity and its own claim, so `(instance_id, element_id)` does not identify one of them. Pass this as `token_id` to the claim and release operations when an element holds more than one park. 
    #[serde(rename = "token_id")]
    pub token_id: uuid::Uuid,
    /// `<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>` -- the name the engine resolved at park time when the assignment was written as an expression, the declared literal otherwise (#1123). 
    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub assignee: Option<Option<String>>,
    /// `flowable:owner`, same rule as `assignee`
    #[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 that could **not** be turned into a name -- an expression the engine's park-time resolution refused, or a task whose token parked before #1123 shipped. 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.  An expression the engine *did* resolve is not flagged: the identity fields above carry the answer. 
    #[serde(rename = "assignment_unresolved", skip_serializing_if = "Option::is_none")]
    pub assignment_unresolved: Option<bool>,
    /// Each refused expression with the reason it could not be read, so a client can say *why* rather than only *that*. Empty when there is nothing to refuse, and for a token parked before #1123 shipped (which carries no resolution record at all). 
    #[serde(rename = "unresolved_assignments", skip_serializing_if = "Option::is_none")]
    pub unresolved_assignments: Option<Vec<models::BpmnUnresolvedAssignment>>,
    /// When the engine decided this task's identity. Present exactly when a park-time resolution record exists; absent means the identity was read from the static model, which for a literal assignment is the same answer arrived at a different way. 
    #[serde(rename = "identity_resolved_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub identity_resolved_at: Option<Option<String>>,
    /// Who has taken responsibility for this park (#1123). Absent means unclaimed, which is the ordinary state -- claiming is optional and an unclaimed task is completable by anyone in its audience. A claimed task is still listed for everyone in its audience, so they can see it is taken; only its holder and admins may complete it. 
    #[serde(rename = "claimed_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub claimed_by: Option<Option<String>>,
    #[serde(rename = "claimed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub claimed_at: Option<Option<String>>,
    /// 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` -- the key exactly as the model wrote it, always reported so a client can name the external form whether or not it resolved. Before 6.0.0 a resolved key (via a `bpmn_form_binding` row) or `orvanta:formRef` could each name an Orvanta app to render in place of `form_fields`, surfaced as `resolved_form_ref` / `form_ref`. Apps were removed (#1720) and both fields with them (#1759): a key now only ever falls back to `form_fields`. 
    #[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, the compiled user-task model, or the `human_task_claim` ledger added by #1123. 
    pub fn new(instance_id: uuid::Uuid, workspace_id: String, element_id: String, token_id: uuid::Uuid, instance_created_at: String, instance_created_by: String) -> PendingUserTask {
        PendingUserTask {
            instance_id,
            workspace_id,
            element_id,
            token_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,
            unresolved_assignments: None,
            identity_resolved_at: None,
            claimed_by: None,
            claimed_at: None,
            due_date: None,
            priority: None,
            form_key: None,
            form_fields: None,
            form_validation_disabled: None,
        }
    }
}