1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace computer_system
5 {
6 // clang-format off
7 
8 enum class BootSource{
9     Invalid,
10     None,
11     Pxe,
12     Floppy,
13     Cd,
14     Usb,
15     Hdd,
16     BiosSetup,
17     Utilities,
18     Diags,
19     UefiShell,
20     UefiTarget,
21     SDCard,
22     UefiHttp,
23     RemoteDrive,
24     UefiBootNext,
25     Recovery,
26 };
27 
28 enum class SystemType{
29     Invalid,
30     Physical,
31     Virtual,
32     OS,
33     PhysicallyPartitioned,
34     VirtuallyPartitioned,
35     Composed,
36     DPU,
37 };
38 
39 enum class IndicatorLED{
40     Invalid,
41     Unknown,
42     Lit,
43     Blinking,
44     Off,
45 };
46 
47 enum class BootSourceOverrideEnabled{
48     Invalid,
49     Disabled,
50     Once,
51     Continuous,
52 };
53 
54 enum class MemoryMirroring{
55     Invalid,
56     System,
57     DIMM,
58     Hybrid,
59     None,
60 };
61 
62 enum class BootSourceOverrideMode{
63     Invalid,
64     Legacy,
65     UEFI,
66 };
67 
68 enum class InterfaceType{
69     Invalid,
70     TPM1_2,
71     TPM2_0,
72     TCM1_0,
73 };
74 
75 enum class HostingRole{
76     Invalid,
77     ApplicationServer,
78     StorageServer,
79     Switch,
80     Appliance,
81     BareMetalServer,
82     VirtualMachineServer,
83     ContainerServer,
84 };
85 
86 enum class InterfaceTypeSelection{
87     Invalid,
88     None,
89     FirmwareUpdate,
90     BiosSetting,
91     OemMethod,
92 };
93 
94 enum class WatchdogWarningActions{
95     Invalid,
96     None,
97     DiagnosticInterrupt,
98     SMI,
99     MessagingInterrupt,
100     SCI,
101     OEM,
102 };
103 
104 enum class WatchdogTimeoutActions{
105     Invalid,
106     None,
107     ResetSystem,
108     PowerCycle,
109     PowerDown,
110     OEM,
111 };
112 
113 enum class PowerRestorePolicyTypes{
114     Invalid,
115     AlwaysOn,
116     AlwaysOff,
117     LastState,
118 };
119 
120 enum class BootOrderTypes{
121     Invalid,
122     BootOrder,
123     AliasBootOrder,
124 };
125 
126 enum class AutomaticRetryConfig{
127     Invalid,
128     Disabled,
129     RetryAttempts,
130     RetryAlways,
131 };
132 
133 enum class BootProgressTypes{
134     Invalid,
135     None,
136     PrimaryProcessorInitializationStarted,
137     BusInitializationStarted,
138     MemoryInitializationStarted,
139     SecondaryProcessorInitializationStarted,
140     PCIResourceConfigStarted,
141     SystemHardwareInitializationComplete,
142     SetupEntered,
143     OSBootStarted,
144     OSRunning,
145     OEM,
146 };
147 
148 enum class GraphicalConnectTypesSupported{
149     Invalid,
150     KVMIP,
151     OEM,
152 };
153 
154 enum class TrustedModuleRequiredToBoot{
155     Invalid,
156     Disabled,
157     Required,
158 };
159 
160 enum class StopBootOnFault{
161     Invalid,
162     Never,
163     AnyFault,
164 };
165 
166 enum class PowerMode{
167     Invalid,
168     MaximumPerformance,
169     BalancedPerformance,
170     PowerSaving,
171     Static,
172     OSControlled,
173     OEM,
174 };
175 
176 enum class CompositionUseCase{
177     Invalid,
178     ResourceBlockCapable,
179     ExpandableSystem,
180 };
181 
182 enum class KMIPCachePolicy{
183     Invalid,
184     None,
185     AfterFirstUse,
186 };
187 
188 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, {
189     {BootSource::Invalid, "Invalid"},
190     {BootSource::None, "None"},
191     {BootSource::Pxe, "Pxe"},
192     {BootSource::Floppy, "Floppy"},
193     {BootSource::Cd, "Cd"},
194     {BootSource::Usb, "Usb"},
195     {BootSource::Hdd, "Hdd"},
196     {BootSource::BiosSetup, "BiosSetup"},
197     {BootSource::Utilities, "Utilities"},
198     {BootSource::Diags, "Diags"},
199     {BootSource::UefiShell, "UefiShell"},
200     {BootSource::UefiTarget, "UefiTarget"},
201     {BootSource::SDCard, "SDCard"},
202     {BootSource::UefiHttp, "UefiHttp"},
203     {BootSource::RemoteDrive, "RemoteDrive"},
204     {BootSource::UefiBootNext, "UefiBootNext"},
205     {BootSource::Recovery, "Recovery"},
206 });
207 
208 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, {
209     {SystemType::Invalid, "Invalid"},
210     {SystemType::Physical, "Physical"},
211     {SystemType::Virtual, "Virtual"},
212     {SystemType::OS, "OS"},
213     {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"},
214     {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"},
215     {SystemType::Composed, "Composed"},
216     {SystemType::DPU, "DPU"},
217 });
218 
219 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, {
220     {IndicatorLED::Invalid, "Invalid"},
221     {IndicatorLED::Unknown, "Unknown"},
222     {IndicatorLED::Lit, "Lit"},
223     {IndicatorLED::Blinking, "Blinking"},
224     {IndicatorLED::Off, "Off"},
225 });
226 
227 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, {
228     {BootSourceOverrideEnabled::Invalid, "Invalid"},
229     {BootSourceOverrideEnabled::Disabled, "Disabled"},
230     {BootSourceOverrideEnabled::Once, "Once"},
231     {BootSourceOverrideEnabled::Continuous, "Continuous"},
232 });
233 
234 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, {
235     {MemoryMirroring::Invalid, "Invalid"},
236     {MemoryMirroring::System, "System"},
237     {MemoryMirroring::DIMM, "DIMM"},
238     {MemoryMirroring::Hybrid, "Hybrid"},
239     {MemoryMirroring::None, "None"},
240 });
241 
242 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, {
243     {BootSourceOverrideMode::Invalid, "Invalid"},
244     {BootSourceOverrideMode::Legacy, "Legacy"},
245     {BootSourceOverrideMode::UEFI, "UEFI"},
246 });
247 
248 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, {
249     {InterfaceType::Invalid, "Invalid"},
250     {InterfaceType::TPM1_2, "TPM1_2"},
251     {InterfaceType::TPM2_0, "TPM2_0"},
252     {InterfaceType::TCM1_0, "TCM1_0"},
253 });
254 
255 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, {
256     {HostingRole::Invalid, "Invalid"},
257     {HostingRole::ApplicationServer, "ApplicationServer"},
258     {HostingRole::StorageServer, "StorageServer"},
259     {HostingRole::Switch, "Switch"},
260     {HostingRole::Appliance, "Appliance"},
261     {HostingRole::BareMetalServer, "BareMetalServer"},
262     {HostingRole::VirtualMachineServer, "VirtualMachineServer"},
263     {HostingRole::ContainerServer, "ContainerServer"},
264 });
265 
266 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, {
267     {InterfaceTypeSelection::Invalid, "Invalid"},
268     {InterfaceTypeSelection::None, "None"},
269     {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"},
270     {InterfaceTypeSelection::BiosSetting, "BiosSetting"},
271     {InterfaceTypeSelection::OemMethod, "OemMethod"},
272 });
273 
274 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, {
275     {WatchdogWarningActions::Invalid, "Invalid"},
276     {WatchdogWarningActions::None, "None"},
277     {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"},
278     {WatchdogWarningActions::SMI, "SMI"},
279     {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"},
280     {WatchdogWarningActions::SCI, "SCI"},
281     {WatchdogWarningActions::OEM, "OEM"},
282 });
283 
284 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, {
285     {WatchdogTimeoutActions::Invalid, "Invalid"},
286     {WatchdogTimeoutActions::None, "None"},
287     {WatchdogTimeoutActions::ResetSystem, "ResetSystem"},
288     {WatchdogTimeoutActions::PowerCycle, "PowerCycle"},
289     {WatchdogTimeoutActions::PowerDown, "PowerDown"},
290     {WatchdogTimeoutActions::OEM, "OEM"},
291 });
292 
293 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, {
294     {PowerRestorePolicyTypes::Invalid, "Invalid"},
295     {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"},
296     {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"},
297     {PowerRestorePolicyTypes::LastState, "LastState"},
298 });
299 
300 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, {
301     {BootOrderTypes::Invalid, "Invalid"},
302     {BootOrderTypes::BootOrder, "BootOrder"},
303     {BootOrderTypes::AliasBootOrder, "AliasBootOrder"},
304 });
305 
306 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, {
307     {AutomaticRetryConfig::Invalid, "Invalid"},
308     {AutomaticRetryConfig::Disabled, "Disabled"},
309     {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"},
310     {AutomaticRetryConfig::RetryAlways, "RetryAlways"},
311 });
312 
313 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, {
314     {BootProgressTypes::Invalid, "Invalid"},
315     {BootProgressTypes::None, "None"},
316     {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"},
317     {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"},
318     {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"},
319     {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"},
320     {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"},
321     {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"},
322     {BootProgressTypes::SetupEntered, "SetupEntered"},
323     {BootProgressTypes::OSBootStarted, "OSBootStarted"},
324     {BootProgressTypes::OSRunning, "OSRunning"},
325     {BootProgressTypes::OEM, "OEM"},
326 });
327 
328 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, {
329     {GraphicalConnectTypesSupported::Invalid, "Invalid"},
330     {GraphicalConnectTypesSupported::KVMIP, "KVMIP"},
331     {GraphicalConnectTypesSupported::OEM, "OEM"},
332 });
333 
334 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, {
335     {TrustedModuleRequiredToBoot::Invalid, "Invalid"},
336     {TrustedModuleRequiredToBoot::Disabled, "Disabled"},
337     {TrustedModuleRequiredToBoot::Required, "Required"},
338 });
339 
340 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, {
341     {StopBootOnFault::Invalid, "Invalid"},
342     {StopBootOnFault::Never, "Never"},
343     {StopBootOnFault::AnyFault, "AnyFault"},
344 });
345 
346 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, {
347     {PowerMode::Invalid, "Invalid"},
348     {PowerMode::MaximumPerformance, "MaximumPerformance"},
349     {PowerMode::BalancedPerformance, "BalancedPerformance"},
350     {PowerMode::PowerSaving, "PowerSaving"},
351     {PowerMode::Static, "Static"},
352     {PowerMode::OSControlled, "OSControlled"},
353     {PowerMode::OEM, "OEM"},
354 });
355 
356 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, {
357     {CompositionUseCase::Invalid, "Invalid"},
358     {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"},
359     {CompositionUseCase::ExpandableSystem, "ExpandableSystem"},
360 });
361 
362 NLOHMANN_JSON_SERIALIZE_ENUM(KMIPCachePolicy, {
363     {KMIPCachePolicy::Invalid, "Invalid"},
364     {KMIPCachePolicy::None, "None"},
365     {KMIPCachePolicy::AfterFirstUse, "AfterFirstUse"},
366 });
367 
368 }
369 // clang-format on
370