Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are allowed.
Doing this found two places where we had structs that didn't fulfill the
schema. They have been commented, but will be fixed with a breaking
change at some point in the future.
Tested: WIP
Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index cd7fa0f..c43c71d 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -18,6 +18,7 @@
#include "app.hpp"
#include "dbus_utility.hpp"
+#include "generated/enums/power.hpp"
#include "query.hpp"
#include "registries/privilege_registry.hpp"
#include "sensors.hpp"
@@ -183,7 +184,8 @@
// LimitException is Mandatory attribute as per OCP
// Baseline Profile – v1.0.0, so currently making it
// "NoAction" as default value to make it OCP Compliant.
- sensorJson["PowerLimit"]["LimitException"] = "NoAction";
+ sensorJson["PowerLimit"]["LimitException"] =
+ power::PowerLimitException::NoAction;
if (enabled)
{