1use crate::JsString;
14use crate::sparse_collection::SparseCollection;
15
16#[derive(Debug, Clone, PartialEq, Default)]
21pub enum PropertyValue {
22 #[default]
23 Null,
24 Bool(bool),
25 Number(f64),
26 String(JsString),
27 Array(Vec<PropertyValue>),
28 Object(Vec<(JsString, PropertyValue)>),
29}
30
31#[derive(Debug, Clone, PartialEq, serde::Deserialize)]
33pub struct PropertyEntryInput {
34 pub name: JsString,
35 #[serde(default)]
36 pub value: PropertyValue,
37}
38
39#[derive(Debug, Clone, PartialEq, serde::Deserialize)]
41pub struct PropertySetInput {
42 pub name: JsString,
43 pub properties: SparseCollection<PropertyEntryInput>,
44}
45
46#[derive(Debug, Clone, PartialEq, serde::Deserialize)]
48pub struct QuantitySetInput {
49 pub name: JsString,
50 pub quantities: SparseCollection<PropertyEntryInput>,
51}
52
53#[derive(Debug, Clone, PartialEq, Default, serde::Deserialize)]
59#[serde(default)]
60pub struct TypeAssignmentInput {
61 pub name: Option<JsString>,
63 #[serde(rename = "type")]
65 pub type_name: Option<JsString>,
66}
67
68#[derive(Debug, Clone, PartialEq, Default, serde::Deserialize)]
70#[serde(default, rename_all = "camelCase")]
71pub struct DataFingerprintInput {
72 pub ifc_type: JsString,
73 pub name: Option<JsString>,
74 pub description: Option<JsString>,
75 pub object_type: Option<JsString>,
76 pub predefined_type: Option<JsString>,
77 pub tag: Option<JsString>,
79 #[serde(deserialize_with = "crate::sparse_collection::optional_sparse")]
80 pub property_sets: SparseCollection<PropertySetInput>,
81 #[serde(deserialize_with = "crate::sparse_collection::optional_sparse")]
82 pub quantity_sets: SparseCollection<QuantitySetInput>,
83 #[serde(deserialize_with = "crate::sparse_collection::optional_sparse")]
84 pub type_assignments: SparseCollection<TypeAssignmentInput>,
85 #[serde(deserialize_with = "crate::input_decode::optional_values")]
87 pub materials: Vec<JsString>,
88 #[serde(deserialize_with = "crate::input_decode::optional_values")]
90 pub classifications: Vec<JsString>,
91}