openadr 0.10.0

OpenADR 3.1 in Rust: VTN server, VEN runtime, typed client and an open conformance suite
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
//! Payload specifications generated from the OpenADR enumeration schemas.
//!
//! **Generated file — do not edit.** Regenerate with `cargo xtask codegen` after updating
//! `openadr3-specification/<version>/enumerations/*.schema.yaml`, the mirror `cargo xtask
//! spec-sync` fetches.
//!
//! All six enumeration files are read: the four that describe a `valuesMap` become
//! [`PAYLOAD_SPECS`], and the two that constrain a descriptor field become string tables.
//! The descriptions are the Alliance's text: © OpenADR Alliance, Apache License 2.0.

use super::{PayloadGroup, PayloadSpec, ValueKinds};
use rust_decimal_macros::dec;

/// Every payload type the specification enumerates, in name order within each group.
pub(super) static PAYLOAD_SPECS: &[PayloadSpec] = &[
    PayloadSpec {
        name: "ALERT_AIR_QUALITY",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Air quality is or is forecast to be. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_BLACK_START",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The grid is in the process of resuming full operation. Devices should minimize electricity use until the event is cleared. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_FIRE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "There is a substantial risk of fire in the area which could interrupt electricity supply in addition to being a danger to life and property. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_FLEX_ALERT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Power supply will be scarce during the event. Devices should seek to shift load to times before or after the event. Devices that can shed should do so during the event. Payload value contains a human-readable string describing the alert. Note: See: flexalert.org",
    },
    PayloadSpec {
        name: "ALERT_FREEZING",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "There is (or is forecast to be) temperatures low enough to be of concern. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_GRID_EMERGENCY",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "There is an imminent risk of the grid failing to continue supplying power to some customers, maintaining operational parameters (e.g. voltage), or ceasing to operate at all. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_OTHER",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "No specific definition. See associated text data element. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_POSSIBLE_OUTAGE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Customers may lose grid power in the coming hours or days. Note: An example of this from California is Public Service Power Shutoffs (usually from fire risk). Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_TSUNAMI",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Tsunami waves expected to hit the coastline. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "ALERT_WIND",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "There is (or is forecast to be) wind speeds high enough to be of concern. Includes hurricanes. Payload value contains a human-readable string describing the alert.",
    },
    PayloadSpec {
        name: "CHARGE_STATE_SETPOINT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The state of charge of an energy storage resource. Payload value is indicated by units in associated eventPayloadDescriptor. Note: Common units are percentage and kWh.",
    },
    PayloadSpec {
        name: "CONTROL_LEVEL_OFFSET",
        group: PayloadGroup::Event,
        kinds: ValueKinds::INTEGER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(-10)),
        maximum: Some(dec!(10)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Discrete integer levels that are relative to normal operations where 0 is normal operations. There is no requirement to link the setpoints to specific load consumption values, but the intention is that the higher the setpoint the less load is consumed (where negative values would indicate higher load consumption). Payload value is an integer between -10 and +10 with no units.",
    },
    PayloadSpec {
        name: "CONTROL_LEVEL_OFFSET_PERCENT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(-1)),
        maximum: Some(dec!(1)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Percentage change from normal operations, where 0 is normal operations. The percentage does not refer to specific load consumptions values, but to load control operation levels. The lower the percentage the less load is consumed. Negative values indicate higher load consumption. Common payload values are floats from -1.0 to 1.0 with units of PERCENT, set in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "CONTROL_SETPOINT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::ANY,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Resource dependent setting, generally used for device control instructions. Payload value type depends on application. The actual values to be used in this payload will be defined by program providers.",
    },
    PayloadSpec {
        name: "CTA2045_REBOOT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::INTEGER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: Some(dec!(1)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Pass through for resources that support [CTA-2045B]. Payload value 0 = SOFT, 1 = HARD. See [CTA-2045B] for definitions.",
    },
    PayloadSpec {
        name: "CTA2045_SET_OVERRIDE_STATUS",
        group: PayloadGroup::Event,
        kinds: ValueKinds::INTEGER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: Some(dec!(1)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Pass through CTA-2045 Override status: 0 = No Override, 1 = Override. See [CTA-2045B].",
    },
    PayloadSpec {
        name: "CURVE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::POINT,
        min_items: 1,
        max_items: None,
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "A series of one or more Point objects representing a 2D curve drawn on an x/y graph. The typical use is to represent a VoltVar or VoltWatt curve for customizing inverter control.",
    },
    PayloadSpec {
        name: "DISPATCH_INSTRUCTION",
        group: PayloadGroup::Event,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: None,
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Implementation-specific instructions that can be mapped to resource-specific control actions by VEN clients. Applicable values are communicated out of band by VTN administrators.",
    },
    PayloadSpec {
        name: "DISPATCH_SETPOINT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The absolute amount of consumption by a resource. Payload value is a float and is indicated by units in associated eventPayloadDescriptor. Note: This is used to dispatch resources.",
    },
    PayloadSpec {
        name: "DISPATCH_SETPOINT_RELATIVE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The relative change of consumption by a resource. Payload value is a float and is indicated by units in associated eventPayloadDescriptor. Note: This is used to dispatch a resource's load.",
    },
    PayloadSpec {
        name: "EXPORT_CAPACITY_AVAILABLE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The amount of extra export capacity available for reservation to the customer. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "EXPORT_CAPACITY_AVAILABLE_PRICE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The cost per unit of power of extra export capacity available for reservation. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "EXPORT_CAPACITY_LIMIT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The maximum export level for the site. Payload is a float and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "EXPORT_CAPACITY_RESERVATION",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The amount of additional export capacity that a customer has been granted by the VTN. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "EXPORT_CAPACITY_RESERVATION_FEE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The cost per unit of power of extra export capacity available for reservation. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "EXPORT_CAPACITY_SUBSCRIPTION",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The amount of export capacity a customer has subscribed to in advance. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "EXPORT_PRICE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The price of energy exported (usually to the grid). Payload value is float and units and currency are defined in associated eventPayloadDescriptor. Note: Can be used for any form of energy.",
    },
    PayloadSpec {
        name: "GHG",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "An estimate of marginal GreenHouse Gas emissions, in g/kWh. Payload value is float.",
    },
    PayloadSpec {
        name: "IMPORT_CAPACITY_AVAILABLE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The amount of extra import capacity available for reservation to the customer. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "IMPORT_CAPACITY_AVAILABLE_PRICE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The cost per unit of power of extra import capacity available for reservation. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "IMPORT_CAPACITY_LIMIT",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The maximum import level for the site. Payload is a float and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "IMPORT_CAPACITY_RESERVATION",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The amount of additional import capacity that a customer has been granted by the VTN. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "IMPORT_CAPACITY_RESERVATION_FEE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The cost per unit of power of extra import capacity available for reservation. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "IMPORT_CAPACITY_SUBSCRIPTION",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The amount of import capacity a customer has subscribed to in advance. Payload is a float, and meaning is indicated by units in associated eventPayloadDescriptor.",
    },
    PayloadSpec {
        name: "OLS",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: None,
        minimum: Some(dec!(0)),
        maximum: Some(dec!(1)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Optimum Load Shape. Payload values array contains a list of values 0.0 to 1.0 representing percentage of usage over the set of intervals in the event. Note: See ANSI-SCTE 267.",
    },
    PayloadSpec {
        name: "PRICE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The price of energy. Payload value is a float. Units and currency defined in associated eventPayloadDescriptor. Note: Can be used for any form of energy.",
    },
    PayloadSpec {
        name: "PRICE_ALTERNATE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The price of a second form of energy, as defined by the program. Payload value is a float. Units and currency defined in associated eventPayloadDescriptor. Note: Can be used for any form of energy.",
    },
    PayloadSpec {
        name: "SIMPLE",
        group: PayloadGroup::Event,
        kinds: ValueKinds::INTEGER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: Some(dec!(3)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "An indication of the level of a basic demand response signal. Payload value is an integer of 0, 1, 2, or 3. Note: An example mapping is normal operations, moderate load shed, high load shed, and emergency load shed.",
    },
    PayloadSpec {
        name: "BINDING_EVENTS",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::BOOLEAN,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "True if events are fixed once transmitted.",
    },
    PayloadSpec {
        name: "COUNTRY",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Alpha-2 code per ISO 3166-1.",
    },
    PayloadSpec {
        name: "LOCAL",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::BOOLEAN,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Indicates that data in the program, e.g. price signals, have been created by a local VTN, possibly adapting from a grid VTN. See the Local Scenarios chapter for more information.",
    },
    PayloadSpec {
        name: "PRINCIPAL_SUBDIVISION",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Coding per ISO 3166-2. E.g. state in US.",
    },
    PayloadSpec {
        name: "PROGRAM_LONG_NAME",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Long name of program for human readability.",
    },
    PayloadSpec {
        name: "PROGRAM_TYPE",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "A program defined categorization.",
    },
    PayloadSpec {
        name: "RETAILER_LONG_NAME",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Long name of energy retailer for human readability.",
    },
    PayloadSpec {
        name: "RETAILER_NAME",
        group: PayloadGroup::ProgramAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Short name of energy retailer providing the program.",
    },
    PayloadSpec {
        name: "BASELINE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Indicates energy or power consumption in the absence of load control. Payload value is determined by reading type which may indicate usage or demand.",
    },
    PayloadSpec {
        name: "DATA_QUALITY",
        group: PayloadGroup::Report,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &["OK", "MISSING", "ESTIMATED", "BAD"],
        description: "Payload values array contains a string indicating data quality of companion report payload in the same interval. Strings may be one of enumerated Data Quality enumerations.",
    },
    PayloadSpec {
        name: "DELTA_USAGE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Change in usage as compared to a baseline. Payload value is a float and units are defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "DEMAND",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Power usage for an interval, i.e. Real Power. Payload value is a float, units defined in payloadDescriptor. Reading type indicates MEAN, PEAK, FORECAST.",
    },
    PayloadSpec {
        name: "DOWN_REGULATION_AVAILABLE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Down Regulation capacity available for dispatch, in real power. Payload value is a float, units defined in payloadDescriptor. Reading type indicates MEAN, PEAK, FORECAST.",
    },
    PayloadSpec {
        name: "EXPORT_RESERVATION_CAPACITY",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Amount of additional export capacity requested. Payload values are a float.",
    },
    PayloadSpec {
        name: "EXPORT_RESERVATION_FEE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Amount per unit of export capacity that the VEN is willing to pay for the requested reservation. Payload value is a float with currency defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "GENERATION_DELTA_AVAILABLE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Payload values array contains a single float indicating expected generation by a resource for the associated interval.",
    },
    PayloadSpec {
        name: "IMPORT_RESERVATION_CAPACITY",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Amount of additional import capacity requested. Payload values are a float.",
    },
    PayloadSpec {
        name: "IMPORT_RESERVATION_FEE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Amount per unit of import capacity that the VEN is willing to pay for the requested reservation. Payload value is a float with currency defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "LOAD_SHED_DELTA_AVAILABLE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Payload values array contains a single float indicating expected increase or decrease in load by a resource for the associated interval.",
    },
    PayloadSpec {
        name: "OPERATING_STATE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[
            "NORMAL",
            "ERROR",
            "IDLE_NORMAL",
            "RUNNING_NORMAL",
            "RUNNING_CURTAILED",
            "RUNNING_HEIGHTENED",
            "IDLE_CURTAILED",
            "SGD_ERROR_CONDITION",
            "IDLE_HEIGHTENED",
            "IDLE_OPTED_OUT",
            "RUNNING_OPTED_OUT",
            "AGGREGATED_REPORT",
        ],
        description: "Payload values array includes a list of operating state enumerations, see below.",
    },
    PayloadSpec {
        name: "READING",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "An instantaneous data point, as from a meter. Same as pulse count. Payload value is a float and units are defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "REGULATION_SETPOINT",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Regulation setpoint as instructed as part of regulation services. Payload value is a float, units defined in payloadDescriptor. Reading type indicates MEAN, PEAK, FORECAST.",
    },
    PayloadSpec {
        name: "SETPOINT",
        group: PayloadGroup::Report,
        kinds: ValueKinds::ANY,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Current control setpoint of a resource, see CONTROL_SETPOINT in event interval payloads. Payload values are determined by the application. The actual values to be used in this payload will be defined by program providers.",
    },
    PayloadSpec {
        name: "SIMPLE_LEVEL",
        group: PayloadGroup::Report,
        kinds: ValueKinds::INTEGER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: Some(dec!(3)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Simple level that a VEN resource is operating at for each Interval. Payload value is an integer 0, 1, 2, 3 corresponding to values in SIMPLE events.",
    },
    PayloadSpec {
        name: "STORAGE_CHARGE_LEVEL",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: Some(dec!(1)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Current storage charge level expressed as a percentage, where 0% is empty and 100% is full. Payload value is a float, units of PERCENT defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "STORAGE_DISPATCH_FORECAST",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Payload values array contains a single float indicating expected stored energy that could be dispatched for the associated interval.",
    },
    PayloadSpec {
        name: "STORAGE_MAX_CHARGE_POWER",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The maximum sustainable power that can be charged from an electricity network (load). Payload value is a float, units of power defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "STORAGE_MAX_DISCHARGE_POWER",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "The maximum sustainable power that can be discharged into an electricity network (injection). Payload value is a float, units of power defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "STORAGE_USABLE_CAPACITY",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Usable energy that the storage device can hold when fully charged. Payload value is a float, units of energy defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "UP_REGULATION_AVAILABLE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Up Regulation capacity available for dispatch, in real power. Payload value is a float, units defined in payloadDescriptor. Reading type indicates MEAN, PEAK, FORECAST.",
    },
    PayloadSpec {
        name: "USAGE",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Energy usage over an interval. Payload value is a float and units are defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "USAGE_FORECAST",
        group: PayloadGroup::Report,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Payload values array contains a single float indicating expected resource usage for the associated interval. Units of energy defined in payloadDescriptor.",
    },
    PayloadSpec {
        name: "AREA",
        group: PayloadGroup::VenAttribute,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: None,
        minimum: None,
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Describes a geographic area. Values[] contains application specific data. Demand Response programs may define their own use of these fields, such as GeoJSON polygon data.",
    },
    PayloadSpec {
        name: "DESCRIPTION",
        group: PayloadGroup::VenAttribute,
        kinds: ValueKinds::STRING,
        min_items: 1,
        max_items: Some(1),
        minimum: None,
        maximum: None,
        min_length: Some(1),
        max_length: Some(128),
        allowed: &[],
        description: "Free-form text tersely describing a ven or resource.",
    },
    PayloadSpec {
        name: "LOCATION",
        group: PayloadGroup::VenAttribute,
        kinds: ValueKinds::NUMBER,
        min_items: 2,
        max_items: Some(2),
        minimum: Some(dec!(-180)),
        maximum: Some(dec!(180)),
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Describes a single geographic point. Values[] contains 2 floats, generally representing longitude and latitude. Demand Response programs may define their own use of these fields.",
    },
    PayloadSpec {
        name: "MAX_POWER_CONSUMPTION",
        group: PayloadGroup::VenAttribute,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Values contains a floating point number describing the maximum consumption, in kiloWatts.",
    },
    PayloadSpec {
        name: "MAX_POWER_EXPORT",
        group: PayloadGroup::VenAttribute,
        kinds: ValueKinds::NUMBER,
        min_items: 1,
        max_items: Some(1),
        minimum: Some(dec!(0)),
        maximum: None,
        min_length: None,
        max_length: None,
        allowed: &[],
        description: "Values contains a floating point number describing the maximum power the device can export, in kiloWatts.",
    },
];

/// Every unit of measure `eventPayloadDescriptor.units` enumerates.
pub(super) static UNITS: &[&str] = &[
    "KWH",
    "THERMS",
    "GHG",
    "VOLTS",
    "AMPS",
    "CELSIUS",
    "FAHRENHEIT",
    "PERCENT",
    "KW",
    "KVAH",
    "KVARH",
    "KVA",
    "KVAR",
];

/// Every reading type `reportPayloadDescriptor.readingType` enumerates.
pub(super) static READING_TYPES: &[&str] = &[
    "DIRECT_READ",
    "ESTIMATED",
    "SUMMED",
    "MEAN",
    "PEAK",
    "FORECAST",
    "AVERAGE",
    "NORMAL",
    "ERROR",
];