s2-kit 0.4.0

The S2 energy flexibility standard (EN 50491-12-2) in Rust: the S2 JSON data model, a semantic validator, sans-IO Resource Manager and Customer Energy Manager session engines, and S2 Connect
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
// @generated by `cargo xtask gen-schema-table` from schema/s2-json — do not edit.
//
// The property table of S2 JSON v1.0.0: every object type, its properties in
// schema order, which are required, and the bounds on every array. It is what
// lets the lenient decoder prune unknown properties and the validator check
// cardinality without anyone transcribing a number by hand.

use super::{ArrayBounds, Kind, Property, TypeSpec};

/// Every object type in S2 JSON v1.0.0, sorted by name.
///
/// One line per property, which is how a human reads a table; rustfmt would
/// explode each of the 550 entries across five lines and make it unreadable,
/// so it is asked not to.
#[rustfmt::skip]
pub static TYPES: &[TypeSpec] = &[
    TypeSpec {
        name: "DDBC.ActuatorDescription",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "supported_commodites", required: true, kind: Kind::ScalarArray(ArrayBounds { min: Some(1), max: Some(4) }) },
            Property { name: "operation_modes", required: true, kind: Kind::ObjectArray("DDBC.OperationMode", ArrayBounds { min: Some(1), max: Some(100) }) },
            Property { name: "transitions", required: true, kind: Kind::ObjectArray("Transition", ArrayBounds { min: Some(0), max: Some(1000) }) },
            Property { name: "timers", required: true, kind: Kind::ObjectArray("Timer", ArrayBounds { min: Some(0), max: Some(1000) }) },
        ],
    },
    TypeSpec {
        name: "DDBC.ActuatorStatus",
        message_type: Some("DDBC.ActuatorStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "actuator_id", required: true, kind: Kind::Id },
            Property { name: "active_operation_mode_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode_factor", required: true, kind: Kind::Scalar },
            Property { name: "previous_operation_mode_id", required: false, kind: Kind::Id },
            Property { name: "transition_timestamp", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "DDBC.AverageDemandRateForecast",
        message_type: Some("DDBC.AverageDemandRateForecast"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "start_time", required: true, kind: Kind::Scalar },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("DDBC.AverageDemandRateForecastElement", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "DDBC.AverageDemandRateForecastElement",
        message_type: None,
        properties: &[
            Property { name: "duration", required: true, kind: Kind::Scalar },
            Property { name: "demand_rate_upper_limit", required: false, kind: Kind::Scalar },
            Property { name: "demand_rate_upper_95PPR", required: false, kind: Kind::Scalar },
            Property { name: "demand_rate_upper_68PPR", required: false, kind: Kind::Scalar },
            Property { name: "demand_rate_expected", required: true, kind: Kind::Scalar },
            Property { name: "demand_rate_lower_68PPR", required: false, kind: Kind::Scalar },
            Property { name: "demand_rate_lower_95PPR", required: false, kind: Kind::Scalar },
            Property { name: "demand_rate_lower_limit", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "DDBC.Instruction",
        message_type: Some("DDBC.Instruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
            Property { name: "actuator_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode_factor", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "DDBC.OperationMode",
        message_type: None,
        properties: &[
            Property { name: "Id", required: true, kind: Kind::Id },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "power_ranges", required: true, kind: Kind::ObjectArray("PowerRange", ArrayBounds { min: Some(1), max: Some(10) }) },
            Property { name: "supply_range", required: true, kind: Kind::Object("NumberRange") },
            Property { name: "running_costs", required: false, kind: Kind::Object("NumberRange") },
            Property { name: "abnormal_condition_only", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "DDBC.PresentDemandStatus",
        message_type: Some("DDBC.PresentDemandStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "present_demand_rate", required: true, kind: Kind::Object("NumberRange") },
        ],
    },
    TypeSpec {
        name: "DDBC.SystemDescription",
        message_type: Some("DDBC.SystemDescription"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "actuators", required: true, kind: Kind::ObjectArray("DDBC.ActuatorDescription", ArrayBounds { min: Some(1), max: Some(10) }) },
            Property { name: "provides_average_demand_rate_forecast", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "DDBC.TimerStatus",
        message_type: Some("DDBC.TimerStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "timer_id", required: true, kind: Kind::Id },
            Property { name: "actuator_id", required: true, kind: Kind::Id },
            Property { name: "finished_at", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.ActuatorDescription",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "supported_commodities", required: true, kind: Kind::ScalarArray(ArrayBounds { min: Some(1), max: Some(4) }) },
            Property { name: "operation_modes", required: true, kind: Kind::ObjectArray("FRBC.OperationMode", ArrayBounds { min: Some(1), max: Some(100) }) },
            Property { name: "transitions", required: true, kind: Kind::ObjectArray("Transition", ArrayBounds { min: Some(0), max: Some(1000) }) },
            Property { name: "timers", required: true, kind: Kind::ObjectArray("Timer", ArrayBounds { min: Some(0), max: Some(1000) }) },
        ],
    },
    TypeSpec {
        name: "FRBC.ActuatorStatus",
        message_type: Some("FRBC.ActuatorStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "actuator_id", required: true, kind: Kind::Id },
            Property { name: "active_operation_mode_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode_factor", required: true, kind: Kind::Scalar },
            Property { name: "previous_operation_mode_id", required: false, kind: Kind::Id },
            Property { name: "transition_timestamp", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.FillLevelTargetProfile",
        message_type: Some("FRBC.FillLevelTargetProfile"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "start_time", required: true, kind: Kind::Scalar },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("FRBC.FillLevelTargetProfileElement", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "FRBC.FillLevelTargetProfileElement",
        message_type: None,
        properties: &[
            Property { name: "duration", required: true, kind: Kind::Scalar },
            Property { name: "fill_level_range", required: true, kind: Kind::Object("NumberRange") },
        ],
    },
    TypeSpec {
        name: "FRBC.Instruction",
        message_type: Some("FRBC.Instruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "actuator_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode", required: true, kind: Kind::Id },
            Property { name: "operation_mode_factor", required: true, kind: Kind::Scalar },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.LeakageBehaviour",
        message_type: Some("FRBC.LeakageBehaviour"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("FRBC.LeakageBehaviourElement", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "FRBC.LeakageBehaviourElement",
        message_type: None,
        properties: &[
            Property { name: "fill_level_range", required: true, kind: Kind::Object("NumberRange") },
            Property { name: "leakage_rate", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.OperationMode",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("FRBC.OperationModeElement", ArrayBounds { min: Some(1), max: Some(100) }) },
            Property { name: "abnormal_condition_only", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.OperationModeElement",
        message_type: None,
        properties: &[
            Property { name: "fill_level_range", required: true, kind: Kind::Object("NumberRange") },
            Property { name: "fill_rate", required: true, kind: Kind::Object("NumberRange") },
            Property { name: "power_ranges", required: true, kind: Kind::ObjectArray("PowerRange", ArrayBounds { min: Some(1), max: Some(10) }) },
            Property { name: "running_costs", required: false, kind: Kind::Object("NumberRange") },
        ],
    },
    TypeSpec {
        name: "FRBC.StorageDescription",
        message_type: None,
        properties: &[
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "fill_level_label", required: false, kind: Kind::Scalar },
            Property { name: "provides_leakage_behaviour", required: true, kind: Kind::Scalar },
            Property { name: "provides_fill_level_target_profile", required: true, kind: Kind::Scalar },
            Property { name: "provides_usage_forecast", required: true, kind: Kind::Scalar },
            Property { name: "fill_level_range", required: true, kind: Kind::Object("NumberRange") },
        ],
    },
    TypeSpec {
        name: "FRBC.StorageStatus",
        message_type: Some("FRBC.StorageStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "present_fill_level", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.SystemDescription",
        message_type: Some("FRBC.SystemDescription"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "actuators", required: true, kind: Kind::ObjectArray("FRBC.ActuatorDescription", ArrayBounds { min: Some(1), max: Some(10) }) },
            Property { name: "storage", required: true, kind: Kind::Object("FRBC.StorageDescription") },
        ],
    },
    TypeSpec {
        name: "FRBC.TimerStatus",
        message_type: Some("FRBC.TimerStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "timer_id", required: true, kind: Kind::Id },
            Property { name: "actuator_id", required: true, kind: Kind::Id },
            Property { name: "finished_at", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "FRBC.UsageForecast",
        message_type: Some("FRBC.UsageForecast"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "start_time", required: true, kind: Kind::Scalar },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("FRBC.UsageForecastElement", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "FRBC.UsageForecastElement",
        message_type: None,
        properties: &[
            Property { name: "duration", required: true, kind: Kind::Scalar },
            Property { name: "usage_rate_upper_limit", required: false, kind: Kind::Scalar },
            Property { name: "usage_rate_upper_95PPR", required: false, kind: Kind::Scalar },
            Property { name: "usage_rate_upper_68PPR", required: false, kind: Kind::Scalar },
            Property { name: "usage_rate_expected", required: true, kind: Kind::Scalar },
            Property { name: "usage_rate_lower_68PPR", required: false, kind: Kind::Scalar },
            Property { name: "usage_rate_lower_95PPR", required: false, kind: Kind::Scalar },
            Property { name: "usage_rate_lower_limit", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "Handshake",
        message_type: Some("Handshake"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "role", required: true, kind: Kind::Scalar },
            Property { name: "supported_protocol_versions", required: false, kind: Kind::ScalarArray(ArrayBounds { min: Some(1), max: None }) },
        ],
    },
    TypeSpec {
        name: "HandshakeResponse",
        message_type: Some("HandshakeResponse"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "selected_protocol_version", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "InstructionStatusUpdate",
        message_type: Some("InstructionStatusUpdate"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "instruction_id", required: true, kind: Kind::Id },
            Property { name: "status_type", required: true, kind: Kind::Scalar },
            Property { name: "timestamp", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "NumberRange",
        message_type: None,
        properties: &[
            Property { name: "start_of_range", required: true, kind: Kind::Scalar },
            Property { name: "end_of_range", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "OMBC.Instruction",
        message_type: Some("OMBC.Instruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "operation_mode_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode_factor", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "OMBC.OperationMode",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "power_ranges", required: true, kind: Kind::ObjectArray("PowerRange", ArrayBounds { min: Some(1), max: Some(10) }) },
            Property { name: "running_costs", required: false, kind: Kind::Object("NumberRange") },
            Property { name: "abnormal_condition_only", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "OMBC.Status",
        message_type: Some("OMBC.Status"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "active_operation_mode_id", required: true, kind: Kind::Id },
            Property { name: "operation_mode_factor", required: true, kind: Kind::Scalar },
            Property { name: "previous_operation_mode_id", required: false, kind: Kind::Id },
            Property { name: "transition_timestamp", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "OMBC.SystemDescription",
        message_type: Some("OMBC.SystemDescription"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "operation_modes", required: true, kind: Kind::ObjectArray("OMBC.OperationMode", ArrayBounds { min: Some(1), max: Some(100) }) },
            Property { name: "transitions", required: true, kind: Kind::ObjectArray("Transition", ArrayBounds { min: Some(0), max: Some(1000) }) },
            Property { name: "timers", required: true, kind: Kind::ObjectArray("Timer", ArrayBounds { min: Some(0), max: Some(1000) }) },
        ],
    },
    TypeSpec {
        name: "OMBC.TimerStatus",
        message_type: Some("OMBC.TimerStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "timer_id", required: true, kind: Kind::Id },
            Property { name: "finished_at", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PEBC.AllowedLimitRange",
        message_type: None,
        properties: &[
            Property { name: "commodity_quantity", required: true, kind: Kind::Scalar },
            Property { name: "limit_type", required: true, kind: Kind::Scalar },
            Property { name: "range_boundary", required: true, kind: Kind::Object("NumberRange") },
            Property { name: "abnormal_condition_only", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PEBC.EnergyConstraint",
        message_type: Some("PEBC.EnergyConstraint"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "valid_until", required: true, kind: Kind::Scalar },
            Property { name: "upper_average_power", required: true, kind: Kind::Scalar },
            Property { name: "lower_average_power", required: true, kind: Kind::Scalar },
            Property { name: "commodity_quantity", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PEBC.Instruction",
        message_type: Some("PEBC.Instruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
            Property { name: "power_constraints_id", required: true, kind: Kind::Id },
            Property { name: "power_envelopes", required: true, kind: Kind::ObjectArray("PEBC.PowerEnvelope", ArrayBounds { min: Some(1), max: Some(10) }) },
        ],
    },
    TypeSpec {
        name: "PEBC.PowerConstraints",
        message_type: Some("PEBC.PowerConstraints"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "valid_until", required: false, kind: Kind::Scalar },
            Property { name: "consequence_type", required: true, kind: Kind::Scalar },
            Property { name: "allowed_limit_ranges", required: true, kind: Kind::ObjectArray("PEBC.AllowedLimitRange", ArrayBounds { min: Some(2), max: Some(100) }) },
        ],
    },
    TypeSpec {
        name: "PEBC.PowerEnvelope",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "commodity_quantity", required: true, kind: Kind::Scalar },
            Property { name: "power_envelope_elements", required: true, kind: Kind::ObjectArray("PEBC.PowerEnvelopeElement", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "PEBC.PowerEnvelopeElement",
        message_type: None,
        properties: &[
            Property { name: "duration", required: true, kind: Kind::Scalar },
            Property { name: "upper_limit", required: true, kind: Kind::Scalar },
            Property { name: "lower_limit", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PPBC.EndInterruptionInstruction",
        message_type: Some("PPBC.EndInterruptionInstruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "power_profile_id", required: true, kind: Kind::Id },
            Property { name: "sequence_container_id", required: true, kind: Kind::Id },
            Property { name: "power_sequence_id", required: true, kind: Kind::Id },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PPBC.PowerProfileDefinition",
        message_type: Some("PPBC.PowerProfileDefinition"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "start_time", required: true, kind: Kind::Scalar },
            Property { name: "end_time", required: true, kind: Kind::Scalar },
            Property { name: "power_sequences_containers", required: true, kind: Kind::ObjectArray("PPBC.PowerSequenceContainer", ArrayBounds { min: Some(1), max: Some(1000) }) },
        ],
    },
    TypeSpec {
        name: "PPBC.PowerProfileStatus",
        message_type: Some("PPBC.PowerProfileStatus"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "sequence_container_status", required: true, kind: Kind::ObjectArray("PPBC.PowerSequenceContainerStatus", ArrayBounds { min: Some(1), max: Some(1000) }) },
        ],
    },
    TypeSpec {
        name: "PPBC.PowerSequence",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("PPBC.PowerSequenceElement", ArrayBounds { min: Some(1), max: Some(288) }) },
            Property { name: "is_interruptible", required: true, kind: Kind::Scalar },
            Property { name: "max_pause_before", required: false, kind: Kind::Scalar },
            Property { name: "abnormal_condition_only", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PPBC.PowerSequenceContainer",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "power_sequences", required: true, kind: Kind::ObjectArray("PPBC.PowerSequence", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "PPBC.PowerSequenceContainerStatus",
        message_type: None,
        properties: &[
            Property { name: "power_profile_id", required: true, kind: Kind::Id },
            Property { name: "sequence_container_id", required: true, kind: Kind::Id },
            Property { name: "selected_sequence_id", required: false, kind: Kind::Id },
            Property { name: "progress", required: false, kind: Kind::Scalar },
            Property { name: "status", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PPBC.PowerSequenceElement",
        message_type: None,
        properties: &[
            Property { name: "duration", required: true, kind: Kind::Scalar },
            Property { name: "power_values", required: true, kind: Kind::ObjectArray("PowerForecastValue", ArrayBounds { min: Some(1), max: Some(10) }) },
        ],
    },
    TypeSpec {
        name: "PPBC.ScheduleInstruction",
        message_type: Some("PPBC.ScheduleInstruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "power_profile_id", required: true, kind: Kind::Id },
            Property { name: "sequence_container_id", required: true, kind: Kind::Id },
            Property { name: "power_sequence_id", required: true, kind: Kind::Id },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PPBC.StartInterruptionInstruction",
        message_type: Some("PPBC.StartInterruptionInstruction"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "power_profile_id", required: true, kind: Kind::Id },
            Property { name: "sequence_container_id", required: true, kind: Kind::Id },
            Property { name: "power_sequence_id", required: true, kind: Kind::Id },
            Property { name: "execution_time", required: true, kind: Kind::Scalar },
            Property { name: "abnormal_condition", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PowerForecast",
        message_type: Some("PowerForecast"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "start_time", required: true, kind: Kind::Scalar },
            Property { name: "elements", required: true, kind: Kind::ObjectArray("PowerForecastElement", ArrayBounds { min: Some(1), max: Some(288) }) },
        ],
    },
    TypeSpec {
        name: "PowerForecastElement",
        message_type: None,
        properties: &[
            Property { name: "duration", required: true, kind: Kind::Scalar },
            Property { name: "power_values", required: true, kind: Kind::ObjectArray("PowerForecastValue", ArrayBounds { min: Some(1), max: Some(10) }) },
        ],
    },
    TypeSpec {
        name: "PowerForecastValue",
        message_type: None,
        properties: &[
            Property { name: "value_upper_limit", required: false, kind: Kind::Scalar },
            Property { name: "value_upper_95PPR", required: false, kind: Kind::Scalar },
            Property { name: "value_upper_68PPR", required: false, kind: Kind::Scalar },
            Property { name: "value_expected", required: true, kind: Kind::Scalar },
            Property { name: "value_lower_68PPR", required: false, kind: Kind::Scalar },
            Property { name: "value_lower_95PPR", required: false, kind: Kind::Scalar },
            Property { name: "value_lower_limit", required: false, kind: Kind::Scalar },
            Property { name: "commodity_quantity", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PowerMeasurement",
        message_type: Some("PowerMeasurement"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "measurement_timestamp", required: true, kind: Kind::Scalar },
            Property { name: "values", required: true, kind: Kind::ObjectArray("PowerValue", ArrayBounds { min: Some(1), max: Some(10) }) },
        ],
    },
    TypeSpec {
        name: "PowerRange",
        message_type: None,
        properties: &[
            Property { name: "start_of_range", required: true, kind: Kind::Scalar },
            Property { name: "end_of_range", required: true, kind: Kind::Scalar },
            Property { name: "commodity_quantity", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "PowerValue",
        message_type: None,
        properties: &[
            Property { name: "commodity_quantity", required: true, kind: Kind::Scalar },
            Property { name: "value", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "ReceptionStatus",
        message_type: Some("ReceptionStatus"),
        properties: &[
            Property { name: "subject_message_id", required: true, kind: Kind::Id },
            Property { name: "status", required: true, kind: Kind::Scalar },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "ResourceManagerDetails",
        message_type: Some("ResourceManagerDetails"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "resource_id", required: true, kind: Kind::Id },
            Property { name: "name", required: false, kind: Kind::Scalar },
            Property { name: "roles", required: true, kind: Kind::ObjectArray("Role", ArrayBounds { min: Some(1), max: Some(3) }) },
            Property { name: "manufacturer", required: false, kind: Kind::Scalar },
            Property { name: "model", required: false, kind: Kind::Scalar },
            Property { name: "serial_number", required: false, kind: Kind::Scalar },
            Property { name: "firmware_version", required: false, kind: Kind::Scalar },
            Property { name: "instruction_processing_delay", required: true, kind: Kind::Scalar },
            Property { name: "available_control_types", required: true, kind: Kind::ScalarArray(ArrayBounds { min: Some(1), max: Some(5) }) },
            Property { name: "currency", required: false, kind: Kind::Scalar },
            Property { name: "provides_forecast", required: true, kind: Kind::Scalar },
            Property { name: "provides_power_measurement_types", required: true, kind: Kind::ScalarArray(ArrayBounds { min: Some(1), max: Some(10) }) },
        ],
    },
    TypeSpec {
        name: "RevokeObject",
        message_type: Some("RevokeObject"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "object_type", required: true, kind: Kind::Scalar },
            Property { name: "object_id", required: true, kind: Kind::Id },
        ],
    },
    TypeSpec {
        name: "Role",
        message_type: None,
        properties: &[
            Property { name: "role", required: true, kind: Kind::Scalar },
            Property { name: "commodity", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "SelectControlType",
        message_type: Some("SelectControlType"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "control_type", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "SessionRequest",
        message_type: Some("SessionRequest"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "request", required: true, kind: Kind::Scalar },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "Timer",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "diagnostic_label", required: false, kind: Kind::Scalar },
            Property { name: "duration", required: true, kind: Kind::Scalar },
        ],
    },
    TypeSpec {
        name: "Transition",
        message_type: None,
        properties: &[
            Property { name: "id", required: true, kind: Kind::Id },
            Property { name: "from", required: true, kind: Kind::Id },
            Property { name: "to", required: true, kind: Kind::Id },
            Property { name: "start_timers", required: true, kind: Kind::IdArray(ArrayBounds { min: Some(0), max: Some(1000) }) },
            Property { name: "blocking_timers", required: true, kind: Kind::IdArray(ArrayBounds { min: Some(0), max: Some(1000) }) },
            Property { name: "transition_costs", required: false, kind: Kind::Scalar },
            Property { name: "transition_duration", required: false, kind: Kind::Scalar },
            Property { name: "abnormal_condition_only", required: true, kind: Kind::Scalar },
        ],
    },
];

/// The object types whose shape differs in S2 JSON `v0.0.2-beta`, sorted by
/// name.
///
/// An overlay rather than a second full table: everything not listed here is
/// byte-identical between the two tags, and
/// [`type_spec_in`](super::type_spec_in) falls through to [`TYPES`].
#[rustfmt::skip]
pub static BETA_TYPES: &[TypeSpec] = &[
    TypeSpec {
        name: "DDBC.SystemDescription",
        message_type: Some("DDBC.SystemDescription"),
        properties: &[
            Property { name: "message_id", required: true, kind: Kind::Id },
            Property { name: "valid_from", required: true, kind: Kind::Scalar },
            Property { name: "actuators", required: true, kind: Kind::ObjectArray("DDBC.ActuatorDescription", ArrayBounds { min: Some(1), max: Some(10) }) },
            Property { name: "present_demand_rate", required: true, kind: Kind::Object("NumberRange") },
            Property { name: "provides_average_demand_rate_forecast", required: true, kind: Kind::Scalar },
        ],
    },
];