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/processor.hpp b/redfish-core/lib/processor.hpp
index 8015369..b49f13b 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -20,6 +20,7 @@
 #include "dbus_utility.hpp"
 #include "error_messages.hpp"
 #include "generated/enums/processor.hpp"
+#include "generated/enums/resource.hpp"
 #include "query.hpp"
 #include "registries/privilege_registry.hpp"
 #include "utils/collection.hpp"
@@ -83,8 +84,8 @@
     BMCWEB_LOG_DEBUG("Get CPU resources by interface.");
 
     // Set the default value of state
-    asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
-    asyncResp->res.jsonValue["Status"]["Health"] = "OK";
+    asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled;
+    asyncResp->res.jsonValue["Status"]["Health"] = resource::Health::OK;
 
     for (const auto& interface : cpuInterfacesProperties)
     {
@@ -102,7 +103,8 @@
                 if (!*cpuPresent)
                 {
                     // Slot is not populated
-                    asyncResp->res.jsonValue["Status"]["State"] = "Absent";
+                    asyncResp->res.jsonValue["Status"]["State"] =
+                        resource::State::Absent;
                 }
             }
             else if (property.first == "Functional")
@@ -115,7 +117,8 @@
                 }
                 if (!*cpuFunctional)
                 {
-                    asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
+                    asyncResp->res.jsonValue["Status"]["Health"] =
+                        resource::Health::Critical;
                 }
             }
             else if (property.first == "CoreCount")
@@ -240,7 +243,8 @@
         }
         asyncResp->res.jsonValue["Id"] = cpuId;
         asyncResp->res.jsonValue["Name"] = "Processor";
-        asyncResp->res.jsonValue["ProcessorType"] = "CPU";
+        asyncResp->res.jsonValue["ProcessorType"] =
+            processor::ProcessorType::CPU;
 
         bool slotPresent = false;
         std::string corePath = objPath + "/core";
@@ -542,7 +546,8 @@
         asyncResp->res.jsonValue["Name"] = "Processor";
         asyncResp->res.jsonValue["Status"]["State"] = state;
         asyncResp->res.jsonValue["Status"]["Health"] = health;
-        asyncResp->res.jsonValue["ProcessorType"] = "Accelerator";
+        asyncResp->res.jsonValue["ProcessorType"] =
+            processor::ProcessorType::Accelerator;
     });
 }