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     EfficiencyFavorPower,
175     EfficiencyFavorPerformance,
176 };
177 
178 enum class CompositionUseCase{
179     Invalid,
180     ResourceBlockCapable,
181     ExpandableSystem,
182 };
183 
184 enum class KMIPCachePolicy{
185     Invalid,
186     None,
187     AfterFirstUse,
188 };
189 
190 enum class DecommissionType{
191     Invalid,
192     All,
193     UserData,
194     ManagerConfig,
195     BIOSConfig,
196     NetworkConfig,
197     StorageConfig,
198     Logs,
199 };
200 
201 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, {
202     {BootSource::Invalid, "Invalid"},
203     {BootSource::None, "None"},
204     {BootSource::Pxe, "Pxe"},
205     {BootSource::Floppy, "Floppy"},
206     {BootSource::Cd, "Cd"},
207     {BootSource::Usb, "Usb"},
208     {BootSource::Hdd, "Hdd"},
209     {BootSource::BiosSetup, "BiosSetup"},
210     {BootSource::Utilities, "Utilities"},
211     {BootSource::Diags, "Diags"},
212     {BootSource::UefiShell, "UefiShell"},
213     {BootSource::UefiTarget, "UefiTarget"},
214     {BootSource::SDCard, "SDCard"},
215     {BootSource::UefiHttp, "UefiHttp"},
216     {BootSource::RemoteDrive, "RemoteDrive"},
217     {BootSource::UefiBootNext, "UefiBootNext"},
218     {BootSource::Recovery, "Recovery"},
219 });
220 
221 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, {
222     {SystemType::Invalid, "Invalid"},
223     {SystemType::Physical, "Physical"},
224     {SystemType::Virtual, "Virtual"},
225     {SystemType::OS, "OS"},
226     {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"},
227     {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"},
228     {SystemType::Composed, "Composed"},
229     {SystemType::DPU, "DPU"},
230 });
231 
232 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, {
233     {IndicatorLED::Invalid, "Invalid"},
234     {IndicatorLED::Unknown, "Unknown"},
235     {IndicatorLED::Lit, "Lit"},
236     {IndicatorLED::Blinking, "Blinking"},
237     {IndicatorLED::Off, "Off"},
238 });
239 
240 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, {
241     {BootSourceOverrideEnabled::Invalid, "Invalid"},
242     {BootSourceOverrideEnabled::Disabled, "Disabled"},
243     {BootSourceOverrideEnabled::Once, "Once"},
244     {BootSourceOverrideEnabled::Continuous, "Continuous"},
245 });
246 
247 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, {
248     {MemoryMirroring::Invalid, "Invalid"},
249     {MemoryMirroring::System, "System"},
250     {MemoryMirroring::DIMM, "DIMM"},
251     {MemoryMirroring::Hybrid, "Hybrid"},
252     {MemoryMirroring::None, "None"},
253 });
254 
255 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, {
256     {BootSourceOverrideMode::Invalid, "Invalid"},
257     {BootSourceOverrideMode::Legacy, "Legacy"},
258     {BootSourceOverrideMode::UEFI, "UEFI"},
259 });
260 
261 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, {
262     {InterfaceType::Invalid, "Invalid"},
263     {InterfaceType::TPM1_2, "TPM1_2"},
264     {InterfaceType::TPM2_0, "TPM2_0"},
265     {InterfaceType::TCM1_0, "TCM1_0"},
266 });
267 
268 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, {
269     {HostingRole::Invalid, "Invalid"},
270     {HostingRole::ApplicationServer, "ApplicationServer"},
271     {HostingRole::StorageServer, "StorageServer"},
272     {HostingRole::Switch, "Switch"},
273     {HostingRole::Appliance, "Appliance"},
274     {HostingRole::BareMetalServer, "BareMetalServer"},
275     {HostingRole::VirtualMachineServer, "VirtualMachineServer"},
276     {HostingRole::ContainerServer, "ContainerServer"},
277 });
278 
279 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, {
280     {InterfaceTypeSelection::Invalid, "Invalid"},
281     {InterfaceTypeSelection::None, "None"},
282     {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"},
283     {InterfaceTypeSelection::BiosSetting, "BiosSetting"},
284     {InterfaceTypeSelection::OemMethod, "OemMethod"},
285 });
286 
287 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, {
288     {WatchdogWarningActions::Invalid, "Invalid"},
289     {WatchdogWarningActions::None, "None"},
290     {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"},
291     {WatchdogWarningActions::SMI, "SMI"},
292     {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"},
293     {WatchdogWarningActions::SCI, "SCI"},
294     {WatchdogWarningActions::OEM, "OEM"},
295 });
296 
297 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, {
298     {WatchdogTimeoutActions::Invalid, "Invalid"},
299     {WatchdogTimeoutActions::None, "None"},
300     {WatchdogTimeoutActions::ResetSystem, "ResetSystem"},
301     {WatchdogTimeoutActions::PowerCycle, "PowerCycle"},
302     {WatchdogTimeoutActions::PowerDown, "PowerDown"},
303     {WatchdogTimeoutActions::OEM, "OEM"},
304 });
305 
306 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, {
307     {PowerRestorePolicyTypes::Invalid, "Invalid"},
308     {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"},
309     {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"},
310     {PowerRestorePolicyTypes::LastState, "LastState"},
311 });
312 
313 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, {
314     {BootOrderTypes::Invalid, "Invalid"},
315     {BootOrderTypes::BootOrder, "BootOrder"},
316     {BootOrderTypes::AliasBootOrder, "AliasBootOrder"},
317 });
318 
319 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, {
320     {AutomaticRetryConfig::Invalid, "Invalid"},
321     {AutomaticRetryConfig::Disabled, "Disabled"},
322     {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"},
323     {AutomaticRetryConfig::RetryAlways, "RetryAlways"},
324 });
325 
326 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, {
327     {BootProgressTypes::Invalid, "Invalid"},
328     {BootProgressTypes::None, "None"},
329     {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"},
330     {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"},
331     {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"},
332     {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"},
333     {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"},
334     {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"},
335     {BootProgressTypes::SetupEntered, "SetupEntered"},
336     {BootProgressTypes::OSBootStarted, "OSBootStarted"},
337     {BootProgressTypes::OSRunning, "OSRunning"},
338     {BootProgressTypes::OEM, "OEM"},
339 });
340 
341 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, {
342     {GraphicalConnectTypesSupported::Invalid, "Invalid"},
343     {GraphicalConnectTypesSupported::KVMIP, "KVMIP"},
344     {GraphicalConnectTypesSupported::OEM, "OEM"},
345 });
346 
347 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, {
348     {TrustedModuleRequiredToBoot::Invalid, "Invalid"},
349     {TrustedModuleRequiredToBoot::Disabled, "Disabled"},
350     {TrustedModuleRequiredToBoot::Required, "Required"},
351 });
352 
353 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, {
354     {StopBootOnFault::Invalid, "Invalid"},
355     {StopBootOnFault::Never, "Never"},
356     {StopBootOnFault::AnyFault, "AnyFault"},
357 });
358 
359 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, {
360     {PowerMode::Invalid, "Invalid"},
361     {PowerMode::MaximumPerformance, "MaximumPerformance"},
362     {PowerMode::BalancedPerformance, "BalancedPerformance"},
363     {PowerMode::PowerSaving, "PowerSaving"},
364     {PowerMode::Static, "Static"},
365     {PowerMode::OSControlled, "OSControlled"},
366     {PowerMode::OEM, "OEM"},
367     {PowerMode::EfficiencyFavorPower, "EfficiencyFavorPower"},
368     {PowerMode::EfficiencyFavorPerformance, "EfficiencyFavorPerformance"},
369 });
370 
371 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, {
372     {CompositionUseCase::Invalid, "Invalid"},
373     {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"},
374     {CompositionUseCase::ExpandableSystem, "ExpandableSystem"},
375 });
376 
377 NLOHMANN_JSON_SERIALIZE_ENUM(KMIPCachePolicy, {
378     {KMIPCachePolicy::Invalid, "Invalid"},
379     {KMIPCachePolicy::None, "None"},
380     {KMIPCachePolicy::AfterFirstUse, "AfterFirstUse"},
381 });
382 
383 NLOHMANN_JSON_SERIALIZE_ENUM(DecommissionType, {
384     {DecommissionType::Invalid, "Invalid"},
385     {DecommissionType::All, "All"},
386     {DecommissionType::UserData, "UserData"},
387     {DecommissionType::ManagerConfig, "ManagerConfig"},
388     {DecommissionType::BIOSConfig, "BIOSConfig"},
389     {DecommissionType::NetworkConfig, "NetworkConfig"},
390     {DecommissionType::StorageConfig, "StorageConfig"},
391     {DecommissionType::Logs, "Logs"},
392 });
393 
394 }
395 // clang-format on
396