1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace chassis
5 {
6 // clang-format off
7 
8 enum class ChassisType{
9     Invalid,
10     Rack,
11     Blade,
12     Enclosure,
13     StandAlone,
14     RackMount,
15     Card,
16     Cartridge,
17     Row,
18     Pod,
19     Expansion,
20     Sidecar,
21     Zone,
22     Sled,
23     Shelf,
24     Drawer,
25     Module,
26     Component,
27     IPBasedDrive,
28     RackGroup,
29     StorageEnclosure,
30     ImmersionTank,
31     HeatExchanger,
32     PowerStrip,
33     Other,
34 };
35 
36 enum class IndicatorLED{
37     Invalid,
38     Unknown,
39     Lit,
40     Blinking,
41     Off,
42 };
43 
44 enum class IntrusionSensor{
45     Invalid,
46     Normal,
47     HardwareIntrusion,
48     TamperingDetected,
49 };
50 
51 enum class IntrusionSensorReArm{
52     Invalid,
53     Manual,
54     Automatic,
55 };
56 
57 enum class EnvironmentalClass{
58     Invalid,
59     A1,
60     A2,
61     A3,
62     A4,
63 };
64 
65 enum class ThermalDirection{
66     Invalid,
67     FrontToBack,
68     BackToFront,
69     TopExhaust,
70     Sealed,
71 };
72 
73 enum class DoorState{
74     Invalid,
75     Locked,
76     Closed,
77     LockedAndOpen,
78     Open,
79 };
80 
81 NLOHMANN_JSON_SERIALIZE_ENUM(ChassisType, {
82     {ChassisType::Invalid, "Invalid"},
83     {ChassisType::Rack, "Rack"},
84     {ChassisType::Blade, "Blade"},
85     {ChassisType::Enclosure, "Enclosure"},
86     {ChassisType::StandAlone, "StandAlone"},
87     {ChassisType::RackMount, "RackMount"},
88     {ChassisType::Card, "Card"},
89     {ChassisType::Cartridge, "Cartridge"},
90     {ChassisType::Row, "Row"},
91     {ChassisType::Pod, "Pod"},
92     {ChassisType::Expansion, "Expansion"},
93     {ChassisType::Sidecar, "Sidecar"},
94     {ChassisType::Zone, "Zone"},
95     {ChassisType::Sled, "Sled"},
96     {ChassisType::Shelf, "Shelf"},
97     {ChassisType::Drawer, "Drawer"},
98     {ChassisType::Module, "Module"},
99     {ChassisType::Component, "Component"},
100     {ChassisType::IPBasedDrive, "IPBasedDrive"},
101     {ChassisType::RackGroup, "RackGroup"},
102     {ChassisType::StorageEnclosure, "StorageEnclosure"},
103     {ChassisType::ImmersionTank, "ImmersionTank"},
104     {ChassisType::HeatExchanger, "HeatExchanger"},
105     {ChassisType::PowerStrip, "PowerStrip"},
106     {ChassisType::Other, "Other"},
107 });
108 
109 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, {
110     {IndicatorLED::Invalid, "Invalid"},
111     {IndicatorLED::Unknown, "Unknown"},
112     {IndicatorLED::Lit, "Lit"},
113     {IndicatorLED::Blinking, "Blinking"},
114     {IndicatorLED::Off, "Off"},
115 });
116 
117 NLOHMANN_JSON_SERIALIZE_ENUM(IntrusionSensor, {
118     {IntrusionSensor::Invalid, "Invalid"},
119     {IntrusionSensor::Normal, "Normal"},
120     {IntrusionSensor::HardwareIntrusion, "HardwareIntrusion"},
121     {IntrusionSensor::TamperingDetected, "TamperingDetected"},
122 });
123 
124 NLOHMANN_JSON_SERIALIZE_ENUM(IntrusionSensorReArm, {
125     {IntrusionSensorReArm::Invalid, "Invalid"},
126     {IntrusionSensorReArm::Manual, "Manual"},
127     {IntrusionSensorReArm::Automatic, "Automatic"},
128 });
129 
130 NLOHMANN_JSON_SERIALIZE_ENUM(EnvironmentalClass, {
131     {EnvironmentalClass::Invalid, "Invalid"},
132     {EnvironmentalClass::A1, "A1"},
133     {EnvironmentalClass::A2, "A2"},
134     {EnvironmentalClass::A3, "A3"},
135     {EnvironmentalClass::A4, "A4"},
136 });
137 
138 NLOHMANN_JSON_SERIALIZE_ENUM(ThermalDirection, {
139     {ThermalDirection::Invalid, "Invalid"},
140     {ThermalDirection::FrontToBack, "FrontToBack"},
141     {ThermalDirection::BackToFront, "BackToFront"},
142     {ThermalDirection::TopExhaust, "TopExhaust"},
143     {ThermalDirection::Sealed, "Sealed"},
144 });
145 
146 NLOHMANN_JSON_SERIALIZE_ENUM(DoorState, {
147     {DoorState::Invalid, "Invalid"},
148     {DoorState::Locked, "Locked"},
149     {DoorState::Closed, "Closed"},
150     {DoorState::LockedAndOpen, "LockedAndOpen"},
151     {DoorState::Open, "Open"},
152 });
153 
154 }
155 // clang-format on
156