scjson/
scjson_props.rs

1// scjson_props.rs : Properties file for scjson types
2//
3// Part of the scjson project.
4// Developed by Softoboros Technology Inc.
5// Licensed under the BSD 1-Clause License.
6use serde::{Serialize, Deserialize};
7use serde_json::{Map, Value};
8
9//
10// ==== ENUMERATIONS ===
11//
12
13#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
14#[serde(rename_all = "lowercase")]
15/// The assign type that allows for precise manipulation of the datamodel
16///     location.
17///     Types are:
18///     replacechildren (default),
19///     firstchild, lastchild,
20///     previoussibling, nextsibling,
21///     replace, delete,
22///     addattribute
23pub enum AssignTypeDatatypeProps {
24    Replacechildren,
25    Firstchild,
26    Lastchild,
27    Previoussibling,
28    Nextsibling,
29    Replace,
30    Delete,
31    Addattribute,
32}
33/// Retrieves the Default AssignTypeDatatypeProps Value
34impl Default for AssignTypeDatatypeProps {
35    fn default() -> Self {
36        Self::Replacechildren
37    }
38}
39
40#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
41#[serde(rename_all = "lowercase")]
42///     The binding type in use for the SCXML document.
43pub enum BindingDatatypeProps {
44    Early,
45    Late,
46}
47/// Retrieves the Default BindingDatatypeProps Value
48impl Default for BindingDatatypeProps {
49    fn default() -> Self {
50        Self::Early
51    }
52}
53
54#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
55#[serde(rename_all = "lowercase")]
56/// Boolean: true or false only
57pub enum BooleanDatatypeProps {
58    True,
59    False,
60}
61/// Retrieves the Default BooleanDatatypeProps Value
62impl Default for BooleanDatatypeProps {
63    fn default() -> Self {
64        Self::True
65    }
66}
67
68#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
69#[serde(rename_all = "lowercase")]
70/// Describes the processor execution mode for this document, being either "lax"
71/// or "strict".
72pub enum ExmodeDatatypeProps {
73    Lax,
74    Strict,
75}
76/// Retrieves the Default ExmodeDatatypeProps Value
77impl Default for ExmodeDatatypeProps {
78    fn default() -> Self {
79        Self::Lax
80    }
81}
82
83#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
84#[serde(rename_all = "lowercase")]
85/// type of `<history>` state: `shallow` or `deep`.
86pub enum HistoryTypeDatatypeProps {
87    Shallow,
88    Deep,
89}
90/// Retrieves the Default HistoryTypeDatatypeProps Value
91impl Default for HistoryTypeDatatypeProps {
92    fn default() -> Self {
93        Self::Shallow
94    }
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
98#[serde(rename_all = "lowercase")]
99///     The type of the transition i.e. internal or external.
100pub enum TransitionTypeDatatypeProps {
101    Internal,
102    External,
103}
104/// Retrieves the Default TransitionTypeDatatypeProps Value
105impl Default for TransitionTypeDatatypeProps {
106    fn default() -> Self {
107        Self::Internal
108    }
109}
110
111
112//
113// ==== STRUCTS ===
114//
115
116#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
117/// update a datamodel location with an expression or value.
118pub struct AssignProps {
119    #[serde(default)]
120    pub location: String,
121    #[serde(default)]
122    pub expr: Option<String>,
123    #[serde(default)]
124    pub type_value: AssignTypeDatatypeProps,
125    #[serde(default)]
126    pub attr: Option<String>,
127    #[serde(default)]
128    pub other_attributes: Map<String, Value>,
129    #[serde(default)]
130    /// inline payload used by `<send>` and `<invoke>`.
131    pub content: Vec<Map<String, Value>>,
132}
133/// Instantiates a Default Props Object
134impl Default for AssignProps {
135    fn default() -> Self {
136        Self {
137            location: String::default(),
138            expr: Option::<String>::default(),
139            type_value: AssignTypeDatatypeProps::default(),
140            attr: Option::<String>::default(),
141            other_attributes: Map::<String, Value>::default(),
142            content: Vec::<Map::<String, Value>>::default(),
143        }
144    }
145}
146
147#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
148/// cancel a pending `<send>` operation.
149pub struct CancelProps {
150    #[serde(default)]
151    pub other_element: Vec<Map<String, Value>>,
152    #[serde(default)]
153    pub sendid: Option<String>,
154    #[serde(default)]
155    pub sendidexpr: Option<String>,
156    #[serde(default)]
157    pub other_attributes: Map<String, Value>,
158}
159/// Instantiates a Default Props Object
160impl Default for CancelProps {
161    fn default() -> Self {
162        Self {
163            other_element: Vec::<Map::<String, Value>>::default(),
164            sendid: Option::<String>::default(),
165            sendidexpr: Option::<String>::default(),
166            other_attributes: Map::<String, Value>::default(),
167        }
168    }
169}
170
171#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
172/// inline payload used by `<send>` and `<invoke>`.
173pub struct ContentProps {
174    #[serde(default)]
175    /// inline payload used by `<send>` and `<invoke>`.
176    pub content: Option<Vec<ScxmlProps>>,
177    #[serde(default)]
178    pub expr: Option<String>,
179    #[serde(default)]
180    pub other_attributes: Map<String, Value>,
181}
182/// Instantiates a Default Props Object
183impl Default for ContentProps {
184    fn default() -> Self {
185        Self {
186            content: Option::<Vec::<ScxmlProps>>::default(),
187            expr: Option::<String>::default(),
188            other_attributes: Map::<String, Value>::default(),
189        }
190    }
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
194/// represents a single datamodel variable.
195pub struct DataProps {
196    #[serde(default)]
197    pub id: String,
198    #[serde(default)]
199    pub src: Option<String>,
200    #[serde(default)]
201    pub expr: Option<String>,
202    #[serde(default)]
203    pub other_attributes: Map<String, Value>,
204    #[serde(default)]
205    /// inline payload used by `<send>` and `<invoke>`.
206    pub content: Vec<Map<String, Value>>,
207}
208/// Instantiates a Default Props Object
209impl Default for DataProps {
210    fn default() -> Self {
211        Self {
212            id: String::default(),
213            src: Option::<String>::default(),
214            expr: Option::<String>::default(),
215            other_attributes: Map::<String, Value>::default(),
216            content: Vec::<Map::<String, Value>>::default(),
217        }
218    }
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
222/// container for one or more `<data>` elements.
223pub struct DatamodelProps {
224    #[serde(default)]
225    /// represents a single datamodel variable.
226    pub data: Vec<DataProps>,
227    #[serde(default)]
228    pub other_element: Vec<Map<String, Value>>,
229    #[serde(default)]
230    pub other_attributes: Map<String, Value>,
231}
232/// Instantiates a Default Props Object
233impl Default for DatamodelProps {
234    fn default() -> Self {
235        Self {
236            data: Vec::<DataProps>::default(),
237            other_element: Vec::<Map::<String, Value>>::default(),
238            other_attributes: Map::<String, Value>::default(),
239        }
240    }
241}
242
243#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
244/// payload returned when a `<final>` state is reached.
245pub struct DonedataProps {
246    #[serde(default)]
247    /// inline payload used by `<send>` and `<invoke>`.
248    pub content: Option<ContentProps>,
249    #[serde(default)]
250    /// parameter passed to `<invoke>` or `<send>`.
251    pub param: Vec<ParamProps>,
252    #[serde(default)]
253    pub other_attributes: Map<String, Value>,
254}
255/// Instantiates a Default Props Object
256impl Default for DonedataProps {
257    fn default() -> Self {
258        Self {
259            content: Option::<ContentProps>::default(),
260            param: Vec::<ParamProps>::default(),
261            other_attributes: Map::<String, Value>::default(),
262        }
263    }
264}
265
266#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
267/// fallback branch for `<if>` conditions.
268pub struct ElseProps {
269    #[serde(default)]
270    pub other_attributes: Map<String, Value>,
271}
272/// Instantiates a Default Props Object
273impl Default for ElseProps {
274    fn default() -> Self {
275        Self {
276            other_attributes: Map::<String, Value>::default(),
277        }
278    }
279}
280
281#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
282/// conditional branch following an `<if>`.
283pub struct ElseifProps {
284    #[serde(default)]
285    pub cond: String,
286    #[serde(default)]
287    pub other_attributes: Map<String, Value>,
288}
289/// Instantiates a Default Props Object
290impl Default for ElseifProps {
291    fn default() -> Self {
292        Self {
293            cond: String::default(),
294            other_attributes: Map::<String, Value>::default(),
295        }
296    }
297}
298
299#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
300/// marks a terminal state in the machine.
301pub struct FinalProps {
302    #[serde(default)]
303    /// actions performed when entering a state.
304    pub onentry: Vec<OnentryProps>,
305    #[serde(default)]
306    /// actions performed when leaving a state.
307    pub onexit: Vec<OnexitProps>,
308    #[serde(default)]
309    /// payload returned when a `<final>` state is reached.
310    pub donedata: Vec<DonedataProps>,
311    #[serde(default)]
312    pub other_element: Vec<Map<String, Value>>,
313    #[serde(default)]
314    pub id: Option<String>,
315    #[serde(default)]
316    pub other_attributes: Map<String, Value>,
317}
318/// Instantiates a Default Props Object
319impl Default for FinalProps {
320    fn default() -> Self {
321        Self {
322            onentry: Vec::<OnentryProps>::default(),
323            onexit: Vec::<OnexitProps>::default(),
324            donedata: Vec::<DonedataProps>::default(),
325            other_element: Vec::<Map::<String, Value>>::default(),
326            id: Option::<String>::default(),
327            other_attributes: Map::<String, Value>::default(),
328        }
329    }
330}
331
332#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
333/// executed after an `<invoke>` completes.
334pub struct FinalizeProps {
335    #[serde(default)]
336    pub other_element: Vec<Map<String, Value>>,
337    #[serde(default)]
338    pub raise_value: Vec<RaiseProps>,
339    #[serde(default)]
340    pub if_value: Vec<IfProps>,
341    #[serde(default)]
342    /// iterate over items within executable content.
343    pub foreach: Vec<ForeachProps>,
344    #[serde(default)]
345    /// dispatch an external event.
346    pub send: Vec<SendProps>,
347    #[serde(default)]
348    /// inline executable script.
349    pub script: Vec<ScriptProps>,
350    #[serde(default)]
351    /// update a datamodel location with an expression or value.
352    pub assign: Vec<AssignProps>,
353    #[serde(default)]
354    /// diagnostic output statement.
355    pub log: Vec<LogProps>,
356    #[serde(default)]
357    /// cancel a pending `<send>` operation.
358    pub cancel: Vec<CancelProps>,
359    #[serde(default)]
360    pub other_attributes: Map<String, Value>,
361}
362/// Instantiates a Default Props Object
363impl Default for FinalizeProps {
364    fn default() -> Self {
365        Self {
366            other_element: Vec::<Map::<String, Value>>::default(),
367            raise_value: Vec::<RaiseProps>::default(),
368            if_value: Vec::<IfProps>::default(),
369            foreach: Vec::<ForeachProps>::default(),
370            send: Vec::<SendProps>::default(),
371            script: Vec::<ScriptProps>::default(),
372            assign: Vec::<AssignProps>::default(),
373            log: Vec::<LogProps>::default(),
374            cancel: Vec::<CancelProps>::default(),
375            other_attributes: Map::<String, Value>::default(),
376        }
377    }
378}
379
380#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
381/// iterate over items within executable content.
382pub struct ForeachProps {
383    #[serde(default)]
384    pub other_element: Vec<Map<String, Value>>,
385    #[serde(default)]
386    pub raise_value: Vec<RaiseProps>,
387    #[serde(default)]
388    pub if_value: Vec<IfProps>,
389    #[serde(default)]
390    /// iterate over items within executable content.
391    pub foreach: Vec<ForeachProps>,
392    #[serde(default)]
393    /// dispatch an external event.
394    pub send: Vec<SendProps>,
395    #[serde(default)]
396    /// inline executable script.
397    pub script: Vec<ScriptProps>,
398    #[serde(default)]
399    /// update a datamodel location with an expression or value.
400    pub assign: Vec<AssignProps>,
401    #[serde(default)]
402    /// diagnostic output statement.
403    pub log: Vec<LogProps>,
404    #[serde(default)]
405    /// cancel a pending `<send>` operation.
406    pub cancel: Vec<CancelProps>,
407    #[serde(default)]
408    pub array: String,
409    #[serde(default)]
410    pub item: String,
411    #[serde(default)]
412    pub index: Option<String>,
413    #[serde(default)]
414    pub other_attributes: Map<String, Value>,
415}
416/// Instantiates a Default Props Object
417impl Default for ForeachProps {
418    fn default() -> Self {
419        Self {
420            other_element: Vec::<Map::<String, Value>>::default(),
421            raise_value: Vec::<RaiseProps>::default(),
422            if_value: Vec::<IfProps>::default(),
423            foreach: Vec::<ForeachProps>::default(),
424            send: Vec::<SendProps>::default(),
425            script: Vec::<ScriptProps>::default(),
426            assign: Vec::<AssignProps>::default(),
427            log: Vec::<LogProps>::default(),
428            cancel: Vec::<CancelProps>::default(),
429            array: String::default(),
430            item: String::default(),
431            index: Option::<String>::default(),
432            other_attributes: Map::<String, Value>::default(),
433        }
434    }
435}
436
437#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
438/// pseudostate remembering previous active children.
439pub struct HistoryProps {
440    #[serde(default)]
441    pub other_element: Vec<Map<String, Value>>,
442    #[serde(default)]
443    /// edge between states triggered by events.
444    pub transition: TransitionProps,
445    #[serde(default)]
446    pub id: Option<String>,
447    #[serde(default)]
448    pub type_value: Option<HistoryTypeDatatypeProps>,
449    #[serde(default)]
450    pub other_attributes: Map<String, Value>,
451}
452/// Instantiates a Default Props Object
453impl Default for HistoryProps {
454    fn default() -> Self {
455        Self {
456            other_element: Vec::<Map::<String, Value>>::default(),
457            transition: TransitionProps::default(),
458            id: Option::<String>::default(),
459            type_value: Option::<HistoryTypeDatatypeProps>::default(),
460            other_attributes: Map::<String, Value>::default(),
461        }
462    }
463}
464
465#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
466/// conditional execution block.
467pub struct IfProps {
468    #[serde(default)]
469    pub other_element: Vec<Map<String, Value>>,
470    #[serde(default)]
471    pub raise_value: Vec<RaiseProps>,
472    #[serde(default)]
473    pub if_value: Vec<IfProps>,
474    #[serde(default)]
475    /// iterate over items within executable content.
476    pub foreach: Vec<ForeachProps>,
477    #[serde(default)]
478    /// dispatch an external event.
479    pub send: Vec<SendProps>,
480    #[serde(default)]
481    /// inline executable script.
482    pub script: Vec<ScriptProps>,
483    #[serde(default)]
484    /// update a datamodel location with an expression or value.
485    pub assign: Vec<AssignProps>,
486    #[serde(default)]
487    /// diagnostic output statement.
488    pub log: Vec<LogProps>,
489    #[serde(default)]
490    /// cancel a pending `<send>` operation.
491    pub cancel: Vec<CancelProps>,
492    #[serde(default)]
493    /// conditional branch following an `<if>`.
494    pub elseif: Option<ElseifProps>,
495    #[serde(default)]
496    pub else_value: Option<ElseProps>,
497    #[serde(default)]
498    pub cond: String,
499    #[serde(default)]
500    pub other_attributes: Map<String, Value>,
501}
502/// Instantiates a Default Props Object
503impl Default for IfProps {
504    fn default() -> Self {
505        Self {
506            other_element: Vec::<Map::<String, Value>>::default(),
507            raise_value: Vec::<RaiseProps>::default(),
508            if_value: Vec::<IfProps>::default(),
509            foreach: Vec::<ForeachProps>::default(),
510            send: Vec::<SendProps>::default(),
511            script: Vec::<ScriptProps>::default(),
512            assign: Vec::<AssignProps>::default(),
513            log: Vec::<LogProps>::default(),
514            cancel: Vec::<CancelProps>::default(),
515            elseif: Option::<ElseifProps>::default(),
516            else_value: Option::<ElseProps>::default(),
517            cond: String::default(),
518            other_attributes: Map::<String, Value>::default(),
519        }
520    }
521}
522
523#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
524/// starting state within a compound state.
525pub struct InitialProps {
526    #[serde(default)]
527    pub other_element: Vec<Map<String, Value>>,
528    #[serde(default)]
529    /// edge between states triggered by events.
530    pub transition: TransitionProps,
531    #[serde(default)]
532    pub other_attributes: Map<String, Value>,
533}
534/// Instantiates a Default Props Object
535impl Default for InitialProps {
536    fn default() -> Self {
537        Self {
538            other_element: Vec::<Map::<String, Value>>::default(),
539            transition: TransitionProps::default(),
540            other_attributes: Map::<String, Value>::default(),
541        }
542    }
543}
544
545#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
546/// run an external process or machine.
547pub struct InvokeProps {
548    #[serde(default)]
549    /// inline payload used by `<send>` and `<invoke>`.
550    pub content: Vec<ContentProps>,
551    #[serde(default)]
552    /// parameter passed to `<invoke>` or `<send>`.
553    pub param: Vec<ParamProps>,
554    #[serde(default)]
555    /// executed after an `<invoke>` completes.
556    pub finalize: Vec<FinalizeProps>,
557    #[serde(default)]
558    pub other_element: Vec<Map<String, Value>>,
559    #[serde(default)]
560    pub type_value: String,
561    #[serde(default)]
562    pub typeexpr: Option<String>,
563    #[serde(default)]
564    pub src: Option<String>,
565    #[serde(default)]
566    pub srcexpr: Option<String>,
567    #[serde(default)]
568    pub id: Option<String>,
569    #[serde(default)]
570    pub idlocation: Option<String>,
571    #[serde(default)]
572    pub namelist: Option<String>,
573    #[serde(default)]
574    pub autoforward: BooleanDatatypeProps,
575    #[serde(default)]
576    pub other_attributes: Map<String, Value>,
577}
578/// Instantiates a Default Props Object
579impl Default for InvokeProps {
580    fn default() -> Self {
581        Self {
582            content: Vec::<ContentProps>::default(),
583            param: Vec::<ParamProps>::default(),
584            finalize: Vec::<FinalizeProps>::default(),
585            other_element: Vec::<Map::<String, Value>>::default(),
586            type_value: String::default(),
587            typeexpr: Option::<String>::default(),
588            src: Option::<String>::default(),
589            srcexpr: Option::<String>::default(),
590            id: Option::<String>::default(),
591            idlocation: Option::<String>::default(),
592            namelist: Option::<String>::default(),
593            autoforward: BooleanDatatypeProps::default(),
594            other_attributes: Map::<String, Value>::default(),
595        }
596    }
597}
598
599#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
600/// diagnostic output statement.
601pub struct LogProps {
602    #[serde(default)]
603    pub other_element: Vec<Map<String, Value>>,
604    #[serde(default)]
605    pub label: Option<String>,
606    #[serde(default)]
607    pub expr: Option<String>,
608    #[serde(default)]
609    pub other_attributes: Map<String, Value>,
610}
611/// Instantiates a Default Props Object
612impl Default for LogProps {
613    fn default() -> Self {
614        Self {
615            other_element: Vec::<Map::<String, Value>>::default(),
616            label: Option::<String>::default(),
617            expr: Option::<String>::default(),
618            other_attributes: Map::<String, Value>::default(),
619        }
620    }
621}
622
623#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
624/// actions performed when entering a state.
625pub struct OnentryProps {
626    #[serde(default)]
627    pub other_element: Vec<Map<String, Value>>,
628    #[serde(default)]
629    pub raise_value: Vec<RaiseProps>,
630    #[serde(default)]
631    pub if_value: Vec<IfProps>,
632    #[serde(default)]
633    /// iterate over items within executable content.
634    pub foreach: Vec<ForeachProps>,
635    #[serde(default)]
636    /// dispatch an external event.
637    pub send: Vec<SendProps>,
638    #[serde(default)]
639    /// inline executable script.
640    pub script: Vec<ScriptProps>,
641    #[serde(default)]
642    /// update a datamodel location with an expression or value.
643    pub assign: Vec<AssignProps>,
644    #[serde(default)]
645    /// diagnostic output statement.
646    pub log: Vec<LogProps>,
647    #[serde(default)]
648    /// cancel a pending `<send>` operation.
649    pub cancel: Vec<CancelProps>,
650    #[serde(default)]
651    pub other_attributes: Map<String, Value>,
652}
653/// Instantiates a Default Props Object
654impl Default for OnentryProps {
655    fn default() -> Self {
656        Self {
657            other_element: Vec::<Map::<String, Value>>::default(),
658            raise_value: Vec::<RaiseProps>::default(),
659            if_value: Vec::<IfProps>::default(),
660            foreach: Vec::<ForeachProps>::default(),
661            send: Vec::<SendProps>::default(),
662            script: Vec::<ScriptProps>::default(),
663            assign: Vec::<AssignProps>::default(),
664            log: Vec::<LogProps>::default(),
665            cancel: Vec::<CancelProps>::default(),
666            other_attributes: Map::<String, Value>::default(),
667        }
668    }
669}
670
671#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
672/// actions performed when leaving a state.
673pub struct OnexitProps {
674    #[serde(default)]
675    pub other_element: Vec<Map<String, Value>>,
676    #[serde(default)]
677    pub raise_value: Vec<RaiseProps>,
678    #[serde(default)]
679    pub if_value: Vec<IfProps>,
680    #[serde(default)]
681    /// iterate over items within executable content.
682    pub foreach: Vec<ForeachProps>,
683    #[serde(default)]
684    /// dispatch an external event.
685    pub send: Vec<SendProps>,
686    #[serde(default)]
687    /// inline executable script.
688    pub script: Vec<ScriptProps>,
689    #[serde(default)]
690    /// update a datamodel location with an expression or value.
691    pub assign: Vec<AssignProps>,
692    #[serde(default)]
693    /// diagnostic output statement.
694    pub log: Vec<LogProps>,
695    #[serde(default)]
696    /// cancel a pending `<send>` operation.
697    pub cancel: Vec<CancelProps>,
698    #[serde(default)]
699    pub other_attributes: Map<String, Value>,
700}
701/// Instantiates a Default Props Object
702impl Default for OnexitProps {
703    fn default() -> Self {
704        Self {
705            other_element: Vec::<Map::<String, Value>>::default(),
706            raise_value: Vec::<RaiseProps>::default(),
707            if_value: Vec::<IfProps>::default(),
708            foreach: Vec::<ForeachProps>::default(),
709            send: Vec::<SendProps>::default(),
710            script: Vec::<ScriptProps>::default(),
711            assign: Vec::<AssignProps>::default(),
712            log: Vec::<LogProps>::default(),
713            cancel: Vec::<CancelProps>::default(),
714            other_attributes: Map::<String, Value>::default(),
715        }
716    }
717}
718
719#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
720/// coordinates concurrent regions.
721pub struct ParallelProps {
722    #[serde(default)]
723    /// actions performed when entering a state.
724    pub onentry: Vec<OnentryProps>,
725    #[serde(default)]
726    /// actions performed when leaving a state.
727    pub onexit: Vec<OnexitProps>,
728    #[serde(default)]
729    /// edge between states triggered by events.
730    pub transition: Vec<TransitionProps>,
731    #[serde(default)]
732    /// basic state node.
733    pub state: Vec<StateProps>,
734    #[serde(default)]
735    /// coordinates concurrent regions.
736    pub parallel: Vec<ParallelProps>,
737    #[serde(default)]
738    /// pseudostate remembering previous active children.
739    pub history: Vec<HistoryProps>,
740    #[serde(default)]
741    /// container for one or more `<data>` elements.
742    pub datamodel: Vec<DatamodelProps>,
743    #[serde(default)]
744    /// run an external process or machine.
745    pub invoke: Vec<InvokeProps>,
746    #[serde(default)]
747    pub other_element: Vec<Map<String, Value>>,
748    #[serde(default)]
749    pub id: Option<String>,
750    #[serde(default)]
751    pub other_attributes: Map<String, Value>,
752}
753/// Instantiates a Default Props Object
754impl Default for ParallelProps {
755    fn default() -> Self {
756        Self {
757            onentry: Vec::<OnentryProps>::default(),
758            onexit: Vec::<OnexitProps>::default(),
759            transition: Vec::<TransitionProps>::default(),
760            state: Vec::<StateProps>::default(),
761            parallel: Vec::<ParallelProps>::default(),
762            history: Vec::<HistoryProps>::default(),
763            datamodel: Vec::<DatamodelProps>::default(),
764            invoke: Vec::<InvokeProps>::default(),
765            other_element: Vec::<Map::<String, Value>>::default(),
766            id: Option::<String>::default(),
767            other_attributes: Map::<String, Value>::default(),
768        }
769    }
770}
771
772#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
773/// parameter passed to `<invoke>` or `<send>`.
774pub struct ParamProps {
775    #[serde(default)]
776    pub other_element: Vec<Map<String, Value>>,
777    #[serde(default)]
778    pub name: String,
779    #[serde(default)]
780    pub expr: Option<String>,
781    #[serde(default)]
782    pub location: Option<String>,
783    #[serde(default)]
784    pub other_attributes: Map<String, Value>,
785}
786/// Instantiates a Default Props Object
787impl Default for ParamProps {
788    fn default() -> Self {
789        Self {
790            other_element: Vec::<Map::<String, Value>>::default(),
791            name: String::default(),
792            expr: Option::<String>::default(),
793            location: Option::<String>::default(),
794            other_attributes: Map::<String, Value>::default(),
795        }
796    }
797}
798
799#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
800/// raise an internal event.
801pub struct RaiseProps {
802    #[serde(default)]
803    pub event: String,
804    #[serde(default)]
805    pub other_attributes: Map<String, Value>,
806}
807/// Instantiates a Default Props Object
808impl Default for RaiseProps {
809    fn default() -> Self {
810        Self {
811            event: String::default(),
812            other_attributes: Map::<String, Value>::default(),
813        }
814    }
815}
816
817#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
818/// inline executable script.
819pub struct ScriptProps {
820    #[serde(default)]
821    pub src: Option<String>,
822    #[serde(default)]
823    pub other_attributes: Map<String, Value>,
824    #[serde(default)]
825    /// inline payload used by `<send>` and `<invoke>`.
826    pub content: Vec<Map<String, Value>>,
827}
828/// Instantiates a Default Props Object
829impl Default for ScriptProps {
830    fn default() -> Self {
831        Self {
832            src: Option::<String>::default(),
833            other_attributes: Map::<String, Value>::default(),
834            content: Vec::<Map::<String, Value>>::default(),
835        }
836    }
837}
838
839#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
840/// root element of an SCJSON document.
841pub struct ScxmlProps {
842    #[serde(default)]
843    /// basic state node.
844    pub state: Vec<StateProps>,
845    #[serde(default)]
846    /// coordinates concurrent regions.
847    pub parallel: Vec<ParallelProps>,
848    #[serde(default)]
849    /// marks a terminal state in the machine.
850    pub r#final: Vec<FinalProps>,
851    #[serde(default)]
852    /// container for one or more `<data>` elements.
853    pub datamodel: Vec<DatamodelProps>,
854    #[serde(default)]
855    /// inline executable script.
856    pub script: Vec<ScriptProps>,
857    #[serde(default)]
858    pub other_element: Vec<Map<String, Value>>,
859    #[serde(default)]
860    /// starting state within a compound state.
861    pub initial: Vec<String>,
862    #[serde(default)]
863    pub name: Option<String>,
864    #[serde(default)]
865    pub version: Value,
866    #[serde(default)]
867    pub datamodel_attribute: String,
868    #[serde(default)]
869    pub binding: Option<BindingDatatypeProps>,
870    #[serde(default)]
871    pub exmode: Option<ExmodeDatatypeProps>,
872    #[serde(default)]
873    pub other_attributes: Map<String, Value>,
874}
875/// Instantiates a Default Props Object
876impl Default for ScxmlProps {
877    fn default() -> Self {
878        Self {
879            state: Vec::<StateProps>::default(),
880            parallel: Vec::<ParallelProps>::default(),
881            r#final: Vec::<FinalProps>::default(),
882            datamodel: Vec::<DatamodelProps>::default(),
883            script: Vec::<ScriptProps>::default(),
884            other_element: Vec::<Map::<String, Value>>::default(),
885            initial: Vec::<String>::default(),
886            name: Option::<String>::default(),
887            version: Value::default(),
888            datamodel_attribute: String::default(),
889            binding: Option::<BindingDatatypeProps>::default(),
890            exmode: Option::<ExmodeDatatypeProps>::default(),
891            other_attributes: Map::<String, Value>::default(),
892        }
893    }
894}
895
896#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
897/// dispatch an external event.
898pub struct SendProps {
899    #[serde(default)]
900    /// inline payload used by `<send>` and `<invoke>`.
901    pub content: Vec<ContentProps>,
902    #[serde(default)]
903    /// parameter passed to `<invoke>` or `<send>`.
904    pub param: Vec<ParamProps>,
905    #[serde(default)]
906    pub other_element: Vec<Map<String, Value>>,
907    #[serde(default)]
908    pub event: Option<String>,
909    #[serde(default)]
910    pub eventexpr: Option<String>,
911    #[serde(default)]
912    pub target: Option<String>,
913    #[serde(default)]
914    pub targetexpr: Option<String>,
915    #[serde(default)]
916    pub type_value: String,
917    #[serde(default)]
918    pub typeexpr: Option<String>,
919    #[serde(default)]
920    pub id: Option<String>,
921    #[serde(default)]
922    pub idlocation: Option<String>,
923    #[serde(default)]
924    pub delay: String,
925    #[serde(default)]
926    pub delayexpr: Option<String>,
927    #[serde(default)]
928    pub namelist: Option<String>,
929    #[serde(default)]
930    pub other_attributes: Map<String, Value>,
931}
932/// Instantiates a Default Props Object
933impl Default for SendProps {
934    fn default() -> Self {
935        Self {
936            content: Vec::<ContentProps>::default(),
937            param: Vec::<ParamProps>::default(),
938            other_element: Vec::<Map::<String, Value>>::default(),
939            event: Option::<String>::default(),
940            eventexpr: Option::<String>::default(),
941            target: Option::<String>::default(),
942            targetexpr: Option::<String>::default(),
943            type_value: String::default(),
944            typeexpr: Option::<String>::default(),
945            id: Option::<String>::default(),
946            idlocation: Option::<String>::default(),
947            delay: String::default(),
948            delayexpr: Option::<String>::default(),
949            namelist: Option::<String>::default(),
950            other_attributes: Map::<String, Value>::default(),
951        }
952    }
953}
954
955#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
956/// basic state node.
957pub struct StateProps {
958    #[serde(default)]
959    /// actions performed when entering a state.
960    pub onentry: Vec<OnentryProps>,
961    #[serde(default)]
962    /// actions performed when leaving a state.
963    pub onexit: Vec<OnexitProps>,
964    #[serde(default)]
965    /// edge between states triggered by events.
966    pub transition: Vec<TransitionProps>,
967    #[serde(default)]
968    /// starting state within a compound state.
969    pub initial: Vec<InitialProps>,
970    #[serde(default)]
971    /// basic state node.
972    pub state: Vec<StateProps>,
973    #[serde(default)]
974    /// coordinates concurrent regions.
975    pub parallel: Vec<ParallelProps>,
976    #[serde(default)]
977    /// marks a terminal state in the machine.
978    pub r#final: Vec<FinalProps>,
979    #[serde(default)]
980    /// pseudostate remembering previous active children.
981    pub history: Vec<HistoryProps>,
982    #[serde(default)]
983    /// container for one or more `<data>` elements.
984    pub datamodel: Vec<DatamodelProps>,
985    #[serde(default)]
986    /// run an external process or machine.
987    pub invoke: Vec<InvokeProps>,
988    #[serde(default)]
989    pub other_element: Vec<Map<String, Value>>,
990    #[serde(default)]
991    pub id: Option<String>,
992    #[serde(default)]
993    pub initial_attribute: Vec<String>,
994    #[serde(default)]
995    pub other_attributes: Map<String, Value>,
996}
997/// Instantiates a Default Props Object
998impl Default for StateProps {
999    fn default() -> Self {
1000        Self {
1001            onentry: Vec::<OnentryProps>::default(),
1002            onexit: Vec::<OnexitProps>::default(),
1003            transition: Vec::<TransitionProps>::default(),
1004            initial: Vec::<InitialProps>::default(),
1005            state: Vec::<StateProps>::default(),
1006            parallel: Vec::<ParallelProps>::default(),
1007            r#final: Vec::<FinalProps>::default(),
1008            history: Vec::<HistoryProps>::default(),
1009            datamodel: Vec::<DatamodelProps>::default(),
1010            invoke: Vec::<InvokeProps>::default(),
1011            other_element: Vec::<Map::<String, Value>>::default(),
1012            id: Option::<String>::default(),
1013            initial_attribute: Vec::<String>::default(),
1014            other_attributes: Map::<String, Value>::default(),
1015        }
1016    }
1017}
1018
1019#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
1020/// edge between states triggered by events.
1021pub struct TransitionProps {
1022    #[serde(default)]
1023    pub other_element: Vec<Map<String, Value>>,
1024    #[serde(default)]
1025    pub raise_value: Vec<RaiseProps>,
1026    #[serde(default)]
1027    pub if_value: Vec<IfProps>,
1028    #[serde(default)]
1029    /// iterate over items within executable content.
1030    pub foreach: Vec<ForeachProps>,
1031    #[serde(default)]
1032    /// dispatch an external event.
1033    pub send: Vec<SendProps>,
1034    #[serde(default)]
1035    /// inline executable script.
1036    pub script: Vec<ScriptProps>,
1037    #[serde(default)]
1038    /// update a datamodel location with an expression or value.
1039    pub assign: Vec<AssignProps>,
1040    #[serde(default)]
1041    /// diagnostic output statement.
1042    pub log: Vec<LogProps>,
1043    #[serde(default)]
1044    /// cancel a pending `<send>` operation.
1045    pub cancel: Vec<CancelProps>,
1046    #[serde(default)]
1047    pub event: Option<String>,
1048    #[serde(default)]
1049    pub cond: Option<String>,
1050    #[serde(default)]
1051    pub target: Vec<String>,
1052    #[serde(default)]
1053    pub type_value: Option<TransitionTypeDatatypeProps>,
1054    #[serde(default)]
1055    pub other_attributes: Map<String, Value>,
1056}
1057/// Instantiates a Default Props Object
1058impl Default for TransitionProps {
1059    fn default() -> Self {
1060        Self {
1061            other_element: Vec::<Map::<String, Value>>::default(),
1062            raise_value: Vec::<RaiseProps>::default(),
1063            if_value: Vec::<IfProps>::default(),
1064            foreach: Vec::<ForeachProps>::default(),
1065            send: Vec::<SendProps>::default(),
1066            script: Vec::<ScriptProps>::default(),
1067            assign: Vec::<AssignProps>::default(),
1068            log: Vec::<LogProps>::default(),
1069            cancel: Vec::<CancelProps>::default(),
1070            event: Option::<String>::default(),
1071            cond: Option::<String>::default(),
1072            target: Vec::<String>::default(),
1073            type_value: Option::<TransitionTypeDatatypeProps>::default(),
1074            other_attributes: Map::<String, Value>::default(),
1075        }
1076    }
1077}
1078