gldf-rs 0.4.0

GLDF (General Lighting Data Format) parser and writer for Rust, specifically for the Rust/WASM target as such designed for JSON format
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
#![warn(missing_docs)]
#![warn(rustdoc::broken_intra_doc_links)]

use super::*;
use serde::{Deserialize, Serialize};

/// Represents the product definitions section of a GLDF file.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProductDefinitions {
    /// Product metadata information.
    #[serde(rename = "ProductMetaData", skip_serializing_if = "Option::is_none")]
    pub product_meta_data: Option<ProductMetaData>,

    /// A collection of product variants.
    #[serde(rename = "Variants", skip_serializing_if = "Option::is_none")]
    pub variants: Option<Variants>,
}

/// Represents the maintenance factor of a luminaire.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LuminaireMaintenanceFactor {
    /// The number of years for which the maintenance factor is specified.
    #[serde(rename = "@years", default, skip_serializing_if = "Option::is_none")]
    pub years: Option<i32>,

    /// The room condition under which the maintenance factor is specified.
    #[serde(
        rename = "@roomCondition",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub room_condition: Option<String>,

    /// The value maintenance factor.
    #[serde(rename = "$text", default)]
    pub value: String,
}

/// Represents CIE-specific luminaire maintenance factors.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CieLuminaireMaintenanceFactors {
    /// Luminaire maintenance factors defined according to CIE standards.
    #[serde(rename = "LuminaireMaintenanceFactor", default)]
    pub luminaire_maintenance_factor: Vec<LuminaireMaintenanceFactor>,
}

/// Represents the dirt depreciation factor of a luminaire.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LuminaireDirtDepreciation {
    /// The number of years for which the dirt depreciation factor is specified.
    #[serde(rename = "@years", default)]
    pub years: i32,

    /// The room condition under which the dirt depreciation factor is specified.
    #[serde(rename = "@roomCondition", default)]
    pub room_condition: String,

    /// The value dirt depreciation factor.
    #[serde(rename = "$text", default)]
    pub value: f64,
}

/// Represents IES-specific luminaire light loss factors.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct IesLuminaireLightLossFactors {
    /// Luminaire dirt depreciation factors defined according to IES standards.
    #[serde(rename = "LuminaireDirtDepreciation", default)]
    pub luminaire_dirt_depreciation: Vec<LuminaireDirtDepreciation>,
}

/// Represents JIEG-specific luminaire maintenance factors.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct JiegMaintenanceFactors {
    /// Luminaire maintenance factors defined according to JIEG standards.
    #[serde(rename = "LuminaireMaintenanceFactor", default)]
    pub luminaire_maintenance_factor: Vec<LuminaireMaintenanceFactor>,
}

/// Represents maintenance-related information for a luminaire.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LuminaireMaintenance {
    /// The CIE97 luminaire type classification.
    #[serde(
        rename = "Cie97LuminaireType",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub cie97_luminaire_type: Option<String>,

    /// CIE-specific luminaire maintenance factors.
    #[serde(
        rename = "CieLuminaireMaintenanceFactors",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub cie_luminaire_maintenance_factors: Option<CieLuminaireMaintenanceFactors>,

    /// IES-specific luminaire light loss factors, if available.
    #[serde(
        rename = "IesLuminaireLightLossFactors",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub ies_luminaire_light_loss_factors: Option<IesLuminaireLightLossFactors>,

    /// JIEG-specific luminaire maintenance factors, if available.
    #[serde(
        rename = "JiegMaintenanceFactors",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub jieg_maintenance_factors: Option<JiegMaintenanceFactors>,
}

/// Represents metadata for a luminaire product.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProductMetaData {
    /// The unique product identifier (required in rc.3, must come before ProductNumber).
    #[serde(
        rename = "UniqueProductId",
        default,
        skip_serializing_if = "String::is_empty"
    )]
    pub unique_product_id: String,

    /// The product number, if available.
    #[serde(rename = "ProductNumber", skip_serializing_if = "Option::is_none")]
    pub product_number: Option<LocaleFoo>,

    /// The name of the product, if available.
    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
    pub name: Option<LocaleFoo>,

    /// The description of the product, if available.
    #[serde(rename = "Description", skip_serializing_if = "Option::is_none")]
    pub description: Option<LocaleFoo>,

    /// The tender text for the product.
    #[serde(rename = "TenderText", skip_serializing_if = "Option::is_none")]
    pub tender_text: Option<LocaleFoo>,

    /// The product series to which the product belongs, if available.
    #[serde(rename = "ProductSeries", skip_serializing_if = "Option::is_none")]
    pub product_series: Option<ProductSeries>,

    /// Pictures of the product, if available.
    #[serde(rename = "Pictures", skip_serializing_if = "Option::is_none")]
    pub pictures: Option<Images>,

    /// Luminaire maintenance information for the product, if available.
    #[serde(
        rename = "LuminaireMaintenance",
        skip_serializing_if = "Option::is_none"
    )]
    pub luminaire_maintenance: Option<LuminaireMaintenance>,

    /// Descriptive attributes of the product, if available.
    #[serde(
        rename = "DescriptiveAttributes",
        skip_serializing_if = "Option::is_none"
    )]
    pub descriptive_attributes: Option<DescriptiveAttributes>,
}

/// Represents a rectangular cutout.
///
/// XSD shape (gldf-1.0.0-rc-3.xsd line 3845..): `<RectangularCutout>`
/// is a sequence of three required **child elements** — `<Width>`,
/// `<Length>`, `<Depth>` (each xs:int, mm, ≥ 0). They are NOT
/// attributes; emitting them as `@Width` etc. produces invalid XML
/// that the schema rejects.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RectangularCutout {
    /// The width of the rectangular cutout (mm).
    #[serde(rename = "Width", default)]
    pub width: i32,

    /// The length of the rectangular cutout (mm).
    #[serde(rename = "Length", default)]
    pub length: i32,

    /// The depth of the rectangular cutout (mm).
    #[serde(rename = "Depth", default)]
    pub depth: i32,
}

/// Represents a circular cutout.
///
/// XSD shape: `<CircularCutout>` is a sequence of two required child
/// elements — `<Diameter>` and `<Depth>` (xs:int, mm). Same correction
/// as `RectangularCutout`: child elements, not attributes.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CircularCutout {
    /// The diameter of the circular cutout (mm).
    #[serde(rename = "Diameter", default)]
    pub diameter: i32,

    /// The depth of the circular cutout (mm).
    #[serde(rename = "Depth", default)]
    pub depth: i32,
}

/// Represents a recessed luminaire.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Recessed {
    /// The recessed depth in mm. XSD declares this attribute as
    /// `use="required"`, so we always serialize it (even when zero —
    /// `0` is a valid "unknown / not specified" value for consumers
    /// that need a placeholder).
    #[serde(rename = "@recessedDepth", default)]
    pub recessed_depth: i32,

    /// The rectangular cutout details for the recessed luminaire.
    #[serde(
        rename = "RectangularCutout",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub rectangular_cutout: Option<RectangularCutout>,

    /// The circular cutout details for the recessed luminaire.
    #[serde(
        rename = "CircularCutout",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub circular_cutout: Option<CircularCutout>,
}

/// Represents a surface-mounted luminaire.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SurfaceMounted {}

/// The `Pendant` struct describes pendant-related properties.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Pendant {
    /// The length of the pendant.
    #[serde(rename = "pendantLength", default)]
    pub pendant_length: f64,
}

/// Represents a luminaire with ceiling mount.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Ceiling {
    /// The recessed type
    #[serde(rename = "Recessed", skip_serializing_if = "Option::is_none")]
    pub recessed: Option<Recessed>,
    /// The surface mounted type
    #[serde(rename = "SurfaceMounted", skip_serializing_if = "Option::is_none")]
    pub surface_mounted: Option<SurfaceMounted>,
    /// The pendant type
    #[serde(rename = "Pendant", skip_serializing_if = "Option::is_none")]
    pub pendant: Option<Pendant>,
}

/// Luminaire on the Wall
///
/// Per XSD `Wall` is a `sequence { Recessed?, SurfaceMounted? }` with a
/// required `@mountingHeight`. There is no `<Depth>` element at this
/// level — depth-of-cutout values live inside `Recessed > RectangularCutout
/// > Depth` or `Recessed > CircularCutout > Depth`.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Wall {
    /// The mounting height in mm
    #[serde(rename = "@mountingHeight", default)]
    pub mounting_height: i32,
    /// The recessed type
    #[serde(rename = "Recessed", default, skip_serializing_if = "Option::is_none")]
    pub recessed: Option<Recessed>,
    /// The surface mounted type
    #[serde(
        rename = "SurfaceMounted",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub surface_mounted: Option<SurfaceMounted>,
}

/// FreeStanding Luminaire
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FreeStanding {}

/// WorkingPlane
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct WorkingPlane {
    /// The free standing type
    #[serde(rename = "FreeStanding", skip_serializing_if = "Option::is_none")]
    pub free_standing: Option<FreeStanding>,
}

/// PoleTop
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PoleTop {
    /// The pole height in mm (XML attribute, optional)
    #[serde(rename = "@poleHeight", skip_serializing_if = "Option::is_none")]
    pub pole_height: Option<i32>,
    /// Legacy: pole height as element (older GLDF versions)
    #[serde(rename = "poleHeight", skip_serializing_if = "Option::is_none")]
    pub pole_height_element: Option<i32>,
}

impl PoleTop {
    /// Get the pole height in mm (handles both attribute and element formats)
    pub fn get_pole_height(&self) -> Option<i32> {
        self.pole_height.or(self.pole_height_element)
    }
}

/// PoleIntegrated
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PoleIntegrated {
    /// The pole height in mm (XML attribute, optional)
    #[serde(rename = "@poleHeight", skip_serializing_if = "Option::is_none")]
    pub pole_height: Option<i32>,
    /// Legacy: pole height as element (older GLDF versions)
    #[serde(rename = "poleHeight", skip_serializing_if = "Option::is_none")]
    pub pole_height_element: Option<i32>,
}

impl PoleIntegrated {
    /// Get the pole height in mm (handles both attribute and element formats)
    pub fn get_pole_height(&self) -> Option<i32> {
        self.pole_height.or(self.pole_height_element)
    }
}

/// Ground
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Ground {
    /// The pole top type
    #[serde(rename = "PoleTop", skip_serializing_if = "Option::is_none")]
    pub pole_top: Option<PoleTop>,
    /// The pole integrated type
    #[serde(rename = "PoleIntegrated", skip_serializing_if = "Option::is_none")]
    pub pole_integrated: Option<PoleIntegrated>,
    /// The free standing type
    #[serde(rename = "FreeStanding", skip_serializing_if = "Option::is_none")]
    pub free_standing: Option<FreeStanding>,
    /// The surface mounted type
    #[serde(rename = "SurfaceMounted", skip_serializing_if = "Option::is_none")]
    pub surface_mounted: Option<SurfaceMounted>,
    /// The recessed type
    #[serde(rename = "Recessed", skip_serializing_if = "Option::is_none")]
    pub recessed: Option<Recessed>,
}

/// Mountings
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Mountings {
    /// The ceiling type
    #[serde(rename = "Ceiling", skip_serializing_if = "Option::is_none")]
    pub ceiling: Option<Ceiling>,
    /// The wall type
    #[serde(rename = "Wall", skip_serializing_if = "Option::is_none")]
    pub wall: Option<Wall>,
    /// The working plane type
    #[serde(rename = "WorkingPlane", skip_serializing_if = "Option::is_none")]
    pub working_plane: Option<WorkingPlane>,
    /// The ground type
    #[serde(rename = "Ground", skip_serializing_if = "Option::is_none")]
    pub ground: Option<Ground>,
}

/// Bare emitter reference — used at `Variant > Geometry > EmitterReference`
/// (the no-3D-geometry choice branch). XSD shape: empty element with a
/// single `@emitterId` attribute. No child elements.
///
/// Distinct from [`EmitterReference`], which is the *nested* form inside
/// `ModelGeometryReference` and requires a `<EmitterObjectExternalName>`
/// text child. They share the XML element name but not the structure;
/// modeling them as one Rust type was a long-running source of XSD
/// violations (either an empty `<EmitterObjectExternalName/>` got
/// emitted in the bare branch, or a required child got dropped in the
/// nested branch). Splitting them is the durable fix.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EmitterReferenceBare {
    /// The emitter id
    #[serde(rename = "@emitterId")]
    pub emitter_id: String,
}

/// Nested emitter reference — used inside
/// `Variant > Geometry > ModelGeometryReference > EmitterReference`.
/// XSD shape: a sequence with a required `<EmitterObjectExternalName>`
/// child plus required `@emitterId` and optional `@targetModelType`.
///
/// `target_model_type` distinguishes between l3d / m3d / r3d when a
/// variant ships multiple 3D model types with different emitter object
/// names. Most files don't set it.
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EmitterReference {
    /// The emitter id
    #[serde(rename = "@emitterId")]
    pub emitter_id: String,
    /// Optional 3D model type marker (l3d / m3d / r3d) — only needed
    /// when the variant references multiple model formats.
    #[serde(
        rename = "@targetModelType",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub target_model_type: Option<String>,
    /// Name of the emitter object inside the referenced 3D geometry.
    /// XSD requires this child element; it always emits.
    #[serde(rename = "EmitterObjectExternalName", default)]
    pub emitter_object_external_name: String,
}

/// SimpleGeometryReference
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimpleGeometryReference {
    /// The geometry id
    #[serde(rename = "@geometryId")]
    pub geometry_id: String,
    /// The emitter id
    #[serde(rename = "@emitterId")]
    pub emitter_id: String,
}

/// ModelGeometryReference
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ModelGeometryReference {
    /// The geometry id
    #[serde(rename = "@geometryId")]
    pub geometry_id: String,
    /// The list of emitter references
    #[serde(rename = "EmitterReference", default)]
    pub emitter_reference: Vec<EmitterReference>,
}

/// GeometryReferences
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GeometryReferences {
    /// The simple geometry reference
    #[serde(
        rename = "SimpleGeometryReference",
        skip_serializing_if = "Option::is_none"
    )]
    pub simple_geometry_reference: Option<SimpleGeometryReference>,
    /// The model geometry reference
    #[serde(
        rename = "ModelGeometryReference",
        skip_serializing_if = "Option::is_none"
    )]
    pub model_geometry_reference: Option<ModelGeometryReference>,
}

/// Geometry — XSD `Variant > Geometry` is an `xs:choice` of three branches:
/// `EmitterReference`, `SimpleGeometryReference`, `ModelGeometryReference`.
/// The `EmitterReference` branch here is the *bare* form (just
/// `@emitterId`), used when a luminaire has emitters defined but no
/// L3D / cuboid model. The `<EmitterReference>` inside
/// `ModelGeometryReference` is structurally different — see
/// [`EmitterReferenceBare`] vs [`EmitterReference`].
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Geometry {
    /// Emitter reference (used when there is no 3D geometry to attach;
    /// the variant still needs to point at its emitter(s)).
    #[serde(
        rename = "EmitterReference",
        default,
        skip_serializing_if = "Vec::is_empty"
    )]
    pub emitter_reference: Vec<EmitterReferenceBare>,
    /// The simple geometry reference
    #[serde(
        rename = "SimpleGeometryReference",
        skip_serializing_if = "Option::is_none"
    )]
    pub simple_geometry_reference: Option<SimpleGeometryReference>,
    /// The model geometry reference
    #[serde(
        rename = "ModelGeometryReference",
        skip_serializing_if = "Option::is_none"
    )]
    pub model_geometry_reference: Option<ModelGeometryReference>,
}

/// Symbol
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Symbol {
    /// The file id of the symbol
    #[serde(rename = "@fileId")]
    pub file_id: String,
}

/// Variant
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Variant {
    /// The id of the variant
    #[serde(rename = "@id")]
    pub id: String,
    /// The sort order of the variant
    #[serde(rename = "sortOrder", skip_serializing_if = "Option::is_none")]
    pub sort_order: Option<i32>,
    /// The product number of the variant as Locale string
    #[serde(rename = "ProductNumber", skip_serializing_if = "Option::is_none")]
    pub product_number: Option<LocaleFoo>,
    /// The name of the variant as Locale string
    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
    pub name: Option<LocaleFoo>,
    /// The description of the variant as Locale string
    #[serde(rename = "Description", skip_serializing_if = "Option::is_none")]
    pub description: Option<LocaleFoo>,
    /// The tender text of the variant as Locale string
    #[serde(rename = "TenderText", skip_serializing_if = "Option::is_none")]
    pub tender_text: Option<LocaleFoo>,
    /// The gtin of the variant
    #[serde(rename = "GTIN", skip_serializing_if = "Option::is_none")]
    pub gtin: Option<String>,
    /// The mountings of the variant
    #[serde(rename = "Mountings", skip_serializing_if = "Option::is_none")]
    pub mountings: Option<Mountings>,
    /// The geometry of the variant
    #[serde(rename = "Geometry", skip_serializing_if = "Option::is_none")]
    pub geometry: Option<Geometry>,
    /// The product series of the variant
    #[serde(rename = "ProductSeries", skip_serializing_if = "Option::is_none")]
    pub product_series: Option<ProductSeries>,
    /// The images of the variant
    #[serde(rename = "Pictures", skip_serializing_if = "Option::is_none")]
    pub pictures: Option<Images>,
    /// The symbol of the variant
    #[serde(rename = "Symbol", skip_serializing_if = "Option::is_none")]
    pub symbol: Option<Symbol>,
    /// The descriptive attributes of the variant
    #[serde(
        rename = "DescriptiveAttributes",
        skip_serializing_if = "Option::is_none"
    )]
    pub descriptive_attributes: Option<DescriptiveAttributes>,
}

/// Variants
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Variants {
    /// The variant
    #[serde(rename = "Variant", default)]
    pub variant: Vec<Variant>,
}

/// ProductSize
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProductSize {
    /// The length of the product in mm
    #[serde(rename = "Length")]
    pub length: i32,
    /// The width of the product in mm
    #[serde(rename = "Width")]
    pub width: i32,
    /// The height of the product in mm
    #[serde(rename = "Height")]
    pub height: i32,
}

/// Adjustabilities
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Adjustabilities {
    /// The adjustability as a list of strings
    #[serde(rename = "Adjustability", default)]
    pub adjustability: Vec<String>,
}

/// ProtectiveAreas
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProtectiveAreas {
    /// The protective areas as a list of strings
    #[serde(rename = "Area", default)]
    pub area: Vec<String>,
}

/// Mechanical attributes
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Mechanical {
    /// The product size
    #[serde(rename = "ProductSize", skip_serializing_if = "Option::is_none")]
    pub product_size: Option<ProductSize>,
    /// The product form
    #[serde(rename = "ProductForm", skip_serializing_if = "Option::is_none")]
    pub product_form: Option<String>,
    /// The sealing material as a Locale string
    #[serde(rename = "SealingMaterial", skip_serializing_if = "Option::is_none")]
    pub sealing_material: Option<LocaleFoo>,
    /// The adjustabilities
    #[serde(rename = "Adjustabilities", skip_serializing_if = "Option::is_none")]
    pub adjustabilities: Option<Adjustabilities>,
    /// The ik rating
    #[serde(rename = "IKRating", skip_serializing_if = "Option::is_none")]
    pub ik_rating: Option<String>,
    /// The protective areas
    #[serde(rename = "ProtectiveAreas", skip_serializing_if = "Option::is_none")]
    pub protective_areas: Option<ProtectiveAreas>,
    /// The weight in kg
    #[serde(rename = "Weight", skip_serializing_if = "Option::is_none")]
    pub weight: Option<f64>,
}

/// ClampingRange
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClampingRange {
    /// The lower value of the clamping range
    #[serde(rename = "Lower")]
    pub lower: f64,
    /// The upper value of the clamping range
    #[serde(rename = "Upper")]
    pub upper: f64,
}

/// Electrical
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Electrical {
    /// The clamping range
    #[serde(rename = "ClampingRange", skip_serializing_if = "Option::is_none")]
    pub clamping_range: Option<ClampingRange>,
    /// The switching capacity
    #[serde(rename = "SwitchingCapacity", skip_serializing_if = "Option::is_none")]
    pub switching_capacity: Option<String>,
    /// The electrical safety class
    #[serde(
        rename = "ElectricalSafetyClass",
        skip_serializing_if = "Option::is_none"
    )]
    pub electrical_safety_class: Option<String>,
    /// The ingress protection ip code
    #[serde(
        rename = "IngressProtectionIPCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub ingress_protection_ip_code: Option<String>,
    /// The power factor
    #[serde(rename = "PowerFactor", skip_serializing_if = "Option::is_none")]
    pub power_factor: Option<f64>,
    /// Bool constant light output
    #[serde(
        rename = "ConstantLightOutput",
        skip_serializing_if = "Option::is_none"
    )]
    pub constant_light_output: Option<bool>,
    /// The light distribution
    #[serde(rename = "LightDistribution", skip_serializing_if = "Option::is_none")]
    pub light_distribution: Option<String>,
}

/// Flux
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Flux {
    /// The hours of the flux
    #[serde(rename = "@hours")]
    pub hours: i32,
    /// The value of the flux
    #[serde(rename = "$text")]
    pub value: i32,
}

/// DurationTimeAndFlux
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DurationTimeAndFlux {
    /// The list of flux
    #[serde(rename = "Flux", default)]
    pub flux: Vec<Flux>,
}

/// Emergency
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Emergency {
    /// The duration time and flux
    #[serde(
        rename = "DurationTimeAndFlux",
        skip_serializing_if = "Option::is_none"
    )]
    pub duration_time_and_flux: Option<DurationTimeAndFlux>,
    /// The dedicated emergency lighting type
    #[serde(
        rename = "DedicatedEmergencyLightingType",
        skip_serializing_if = "Option::is_none"
    )]
    pub dedicated_emergency_lighting_type: Option<String>,
}

/// ListPrice
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ListPrice {
    /// The currency of the list price
    #[serde(rename = "@currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// The value of the list price
    #[serde(rename = "$text")]
    pub value: f64,
}

/// ListPrices
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ListPrices {
    /// The list of prices
    #[serde(rename = "ListPrice", default)]
    pub list_price: Vec<ListPrice>,
}

/// HousingColor
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HousingColor {
    /// The ral of the housing color
    #[serde(rename = "@ral", skip_serializing_if = "Option::is_none")]
    pub ral: Option<i32>,
    /// The locale of the housing color
    #[serde(flatten)]
    pub locale: Locale,
}

/// HousingColors
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HousingColors {
    /// The list of housing colors
    #[serde(rename = "HousingColor", default)]
    pub housing_color: Vec<HousingColor>,
}

/// Markets
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Markets {
    /// The list of market regions
    #[serde(rename = "Region", default)]
    pub region: Vec<Locale>,
}

/// ApprovalMarks
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ApprovalMarks {
    /// The list of approval marks
    #[serde(rename = "ApprovalMark", default)]
    pub approval_mark: Vec<String>,
}

/// DesignAwards
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DesignAwards {
    /// The list of design awards
    #[serde(rename = "DesignAward", default)]
    pub design_award: Vec<String>,
}

/// Labels
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Labels {
    /// The list of labels
    #[serde(rename = "Label", default)]
    pub label: Vec<String>,
}

/// Applications
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Applications {
    /// The list of applications
    #[serde(rename = "Application", default)]
    pub application: Vec<String>,
}

/// Marketing
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Marketing {
    /// The list prices
    #[serde(rename = "ListPrices", skip_serializing_if = "Option::is_none")]
    pub list_prices: Option<ListPrices>,
    /// The housing colors
    #[serde(rename = "HousingColors", skip_serializing_if = "Option::is_none")]
    pub housing_colors: Option<HousingColors>,
    /// The markets
    #[serde(rename = "Markets", skip_serializing_if = "Option::is_none")]
    pub markets: Option<Markets>,
    /// The hyperlinks
    #[serde(rename = "Hyperlinks", skip_serializing_if = "Option::is_none")]
    pub hyperlinks: Option<Hyperlinks>,
    /// The designer
    #[serde(rename = "Designer", skip_serializing_if = "Option::is_none")]
    pub designer: Option<String>,
    /// The approval marks
    #[serde(rename = "ApprovalMarks", skip_serializing_if = "Option::is_none")]
    pub approval_marks: Option<ApprovalMarks>,
    /// The design awards
    #[serde(rename = "DesignAwards", skip_serializing_if = "Option::is_none")]
    pub design_awards: Option<DesignAwards>,
    /// The labels
    #[serde(rename = "Labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Labels>,
    /// The applications
    #[serde(rename = "Applications", skip_serializing_if = "Option::is_none")]
    pub applications: Option<Applications>,
}

/// UsefulLifeTimes
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UsefulLifeTimes {
    /// The list of useful life times
    #[serde(rename = "UsefulLife", default)]
    pub useful_life: Vec<String>,
}

/// MedianUsefulLifeTimes
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MedianUsefulLifeTimes {
    /// The list of median useful life times
    #[serde(rename = "MedianUsefulLife", default)]
    pub median_useful_life: Vec<String>,
}

/// Directives for ATEX
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Directives {
    /// The list of directive names.
    #[serde(rename = "Directive", default)]
    pub directive: Vec<String>,
}

/// Classes for ATEX
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Classes {
    /// The list of classification class names.
    #[serde(rename = "Class", default)]
    pub class: Vec<String>,
}

/// Divisions for ATEX
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Divisions {
    /// The list of division names.
    #[serde(rename = "Division", default)]
    pub division: Vec<String>,
}

/// Gas groups (contains Group elements)
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GasGroups {
    /// The list of gas group names.
    #[serde(rename = "Group", default)]
    pub group: Vec<String>,
}

/// Dust groups (contains Group elements)
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DustGroups {
    /// The list of dust group names.
    #[serde(rename = "Group", default)]
    pub group: Vec<String>,
}

/// Gas zones (contains Zone elements)
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GasZones {
    /// The list of gas zone values.
    #[serde(rename = "Zone", default)]
    pub zone: Vec<String>,
}

/// Dust zones (contains Zone elements)
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DustZones {
    /// The list of dust zone values.
    #[serde(rename = "Zone", default)]
    pub zone: Vec<String>,
}

/// DivisionGroups
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DivisionGroups {
    /// The gas classification group.
    #[serde(rename = "Gas", skip_serializing_if = "Option::is_none")]
    pub gas: Option<GasGroups>,
    /// The dust classification group.
    #[serde(rename = "Dust", skip_serializing_if = "Option::is_none")]
    pub dust: Option<DustGroups>,
}

/// Zones (contains Gas and Dust with Zone children)
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Zones {
    /// The gas protection zone.
    #[serde(rename = "Gas", skip_serializing_if = "Option::is_none")]
    pub gas: Option<GasZones>,
    /// The dust protection zone.
    #[serde(rename = "Dust", skip_serializing_if = "Option::is_none")]
    pub dust: Option<DustZones>,
}

/// ZoneGroups
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ZoneGroups {
    /// The gas protection zone group.
    #[serde(rename = "Gas", skip_serializing_if = "Option::is_none")]
    pub gas: Option<GasGroups>,
    /// The dust protection zone group.
    #[serde(rename = "Dust", skip_serializing_if = "Option::is_none")]
    pub dust: Option<DustGroups>,
}

/// TemperatureClasses
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TemperatureClasses {
    /// The list of temperature classes
    #[serde(rename = "TemperatureClass", default)]
    pub temperature_class: Vec<String>,
}

/// ExCodes
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ExCodes {
    /// The list of explosion protection (Ex) codes.
    #[serde(rename = "ExCode", default)]
    pub ex_code: Vec<String>,
}

/// EquipmentProtectionLevels
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EquipmentProtectionLevels {
    /// The list of equipment protection levels.
    #[serde(rename = "EquipmentProtectionLevel", default)]
    pub equipment_protection_level: Vec<String>,
}

/// EquipmentGroups
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EquipmentGroups {
    /// The list of equipment groups.
    #[serde(rename = "EquipmentGroup", default)]
    pub equipment_group: Vec<String>,
}

/// EquipmentCategories
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EquipmentCategories {
    /// The list of equipment categories.
    #[serde(rename = "EquipmentCategory", default)]
    pub equipment_category: Vec<String>,
}

/// Atmospheres
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Atmospheres {
    /// The list of atmospheres.
    #[serde(rename = "Atmosphere", default)]
    pub atmosphere: Vec<String>,
}

/// Groups
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Groups {
    /// The list of groups.
    #[serde(rename = "Group", default)]
    pub group: Vec<String>,
}

/// ATEX classification
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ATEX {
    /// The ATEX directives information.
    #[serde(rename = "Directives", skip_serializing_if = "Option::is_none")]
    pub directives: Option<Directives>,
    /// The ATEX classes information.
    #[serde(rename = "Classes", skip_serializing_if = "Option::is_none")]
    pub classes: Option<Classes>,
    /// The ATEX divisions information.
    #[serde(rename = "Divisions", skip_serializing_if = "Option::is_none")]
    pub divisions: Option<Divisions>,
    /// The ATEX division groups information.
    #[serde(rename = "DivisionGroups", skip_serializing_if = "Option::is_none")]
    pub division_groups: Option<DivisionGroups>,
    /// The ATEX zones information.
    #[serde(rename = "Zones", skip_serializing_if = "Option::is_none")]
    pub zones: Option<Zones>,
    /// The ATEX zone groups information.
    #[serde(rename = "ZoneGroups", skip_serializing_if = "Option::is_none")]
    pub zone_groups: Option<ZoneGroups>,
    /// The maximum surface temperature allowed by ATEX.
    #[serde(
        rename = "MaximumSurfaceTemperature",
        skip_serializing_if = "Option::is_none"
    )]
    pub maximum_surface_temperature: Option<String>,
    /// The ATEX groups information.
    #[serde(rename = "Groups", skip_serializing_if = "Option::is_none")]
    pub groups: Option<Groups>,
}

/// AbsorptionRate
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AbsorptionRate {
    /// The rate of absorption in hertz (Hz).
    #[serde(rename = "@hertz")]
    pub hertz: i32,
    /// The corresponding value of the absorption rate.
    #[serde(rename = "$text")]
    pub value: f64,
}

/// AcousticAbsorptionRates
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AcousticAbsorptionRates {
    /// The collection of absorption rates at different frequencies.
    #[serde(rename = "AbsorptionRate", default)]
    pub absorption_rate: Vec<AbsorptionRate>,
}

/// TemperatureRange
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TemperatureRange {
    /// The lower value of the temperature range
    #[serde(rename = "Lower")]
    pub lower: i32,
    /// The upper value of the temperature range
    #[serde(rename = "Upper")]
    pub upper: i32,
}

/// OperationsAndMaintenance
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OperationsAndMaintenance {
    /// The list of useful life times for the luminaire.
    #[serde(rename = "UsefulLifeTimes", skip_serializing_if = "Option::is_none")]
    pub useful_life_times: Option<UsefulLifeTimes>,
    /// The list of median useful life times for the luminaire.
    #[serde(
        rename = "MedianUsefulLifeTimes",
        skip_serializing_if = "Option::is_none"
    )]
    pub median_useful_life_times: Option<MedianUsefulLifeTimes>,
    /// The operating temperature range for the luminaire.
    #[serde(
        rename = "OperatingTemperature",
        skip_serializing_if = "Option::is_none"
    )]
    pub operating_temperature: Option<TemperatureRange>,
    /// The ambient temperature range for the luminaire.
    #[serde(rename = "AmbientTemperature", skip_serializing_if = "Option::is_none")]
    pub ambient_temperature: Option<TemperatureRange>,
    /// The rated ambient temperature for the luminaire.
    #[serde(
        rename = "RatedAmbientTemperature",
        skip_serializing_if = "Option::is_none"
    )]
    pub rated_ambient_temperature: Option<i32>,
    /// The ATEX classification details for the luminaire.
    #[serde(rename = "ATEX", skip_serializing_if = "Option::is_none")]
    pub atex: Option<ATEX>,
    /// The list of acoustic absorption rates for the luminaire.
    #[serde(
        rename = "AcousticAbsorptionRates",
        skip_serializing_if = "Option::is_none"
    )]
    pub acoustic_absorption_rates: Option<AcousticAbsorptionRates>,
}

/// FileReference
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FileReference {
    /// The file ID for the file reference.
    #[serde(rename = "@fileId")]
    pub file_id: String,
}

/// Property
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Property {
    /// The ID of the property.
    #[serde(rename = "@id", default)]
    pub id: String,
    /// The locale information for the property.
    ///
    /// XSD declares `Name` as `type="Locale"` (the multi-locale complex type).
    #[serde(rename = "Name", default)]
    pub name: LocaleFoo,
    /// The source of the property.
    #[serde(rename = "PropertySource", default)]
    pub property_source: String,
    /// The value of the property.
    #[serde(rename = "Value", default)]
    pub value: String,
    /// The file reference for the property, if applicable.
    #[serde(
        rename = "FileReference",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub file_reference: Option<FileReference>,
}

/// CustomProperties
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CustomProperties {
    /// The list of custom properties for the luminaire.
    #[serde(rename = "Property", default)]
    pub property: Vec<Property>,
}

/// DescriptiveAttributes
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DescriptiveAttributes {
    /// The mechanical attributes for the luminaire.
    #[serde(rename = "Mechanical", skip_serializing_if = "Option::is_none")]
    pub mechanical: Option<Mechanical>,
    /// The electrical attributes for the luminaire.
    #[serde(rename = "Electrical", skip_serializing_if = "Option::is_none")]
    pub electrical: Option<Electrical>,
    /// The emergency attributes for the luminaire.
    #[serde(rename = "Emergency", skip_serializing_if = "Option::is_none")]
    pub emergency: Option<Emergency>,
    /// The marketing attributes for the luminaire.
    #[serde(rename = "Marketing", skip_serializing_if = "Option::is_none")]
    pub marketing: Option<Marketing>,
    /// The operations and maintenance attributes for the luminaire.
    #[serde(
        rename = "OperationsAndMaintenance",
        skip_serializing_if = "Option::is_none"
    )]
    pub operations_and_maintenance: Option<OperationsAndMaintenance>,
    /// The custom properties for the luminaire, if applicable.
    #[serde(rename = "CustomProperties", skip_serializing_if = "Option::is_none")]
    pub custom_properties: Option<CustomProperties>,
}