Skip to main content

orvanta_api/models/
bpmn_token_state.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: 2.3.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BpmnTokenState : where a token is parked between step passes, tagged by `type`
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnTokenState {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// only present when type = waiting_for_timer
20    #[serde(rename = "fire_at", skip_serializing_if = "Option::is_none")]
21    pub fire_at: Option<String>,
22    /// only present when type = waiting_for_scope
23    #[serde(rename = "scope_id", skip_serializing_if = "Option::is_none")]
24    pub scope_id: Option<uuid::Uuid>,
25    /// only present when type = async_leave, and only when the element is an exclusive gateway that already chose its outgoing sequence flow: the id of that flow, so the continuation takes it without re-evaluating the gateway's conditions
26    #[serde(rename = "via", skip_serializing_if = "Option::is_none")]
27    pub via: Option<String>,
28}
29
30impl BpmnTokenState {
31    /// where a token is parked between step passes, tagged by `type`
32    pub fn new(r#type: Type) -> BpmnTokenState {
33        BpmnTokenState {
34            r#type,
35            fire_at: None,
36            scope_id: None,
37            via: None,
38        }
39    }
40}
41/// 
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Type {
44    #[serde(rename = "active")]
45    Active,
46    #[serde(rename = "waiting_for_job")]
47    WaitingForJob,
48    #[serde(rename = "waiting_for_event")]
49    WaitingForEvent,
50    #[serde(rename = "waiting_for_timer")]
51    WaitingForTimer,
52    #[serde(rename = "waiting_for_scope")]
53    WaitingForScope,
54    #[serde(rename = "async_before")]
55    AsyncBefore,
56    #[serde(rename = "async_leave")]
57    AsyncLeave,
58    #[serde(rename = "consumed")]
59    Consumed,
60}
61
62impl Default for Type {
63    fn default() -> Type {
64        Self::Active
65    }
66}
67