1 #pragma once 2 3 #include <nlohmann/json.hpp> 4 #include <registries/resource_event_message_registry.hpp> 5 6 namespace redfish 7 { 8 namespace messages 9 { 10 11 inline nlohmann::json 12 getLogResourceEvent(redfish::registries::resource_event::Index name, 13 std::span<const std::string_view> args) 14 { 15 size_t index = static_cast<size_t>(name); 16 if (index >= redfish::registries::resource_event::registry.size()) 17 { 18 return {}; 19 } 20 return getLogFromRegistry(redfish::registries::resource_event::header, 21 redfish::registries::resource_event::registry, 22 index, args); 23 } 24 25 inline nlohmann::json resourceChanged() 26 { 27 return getLogResourceEvent( 28 redfish::registries::resource_event::Index::resourceChanged, {}); 29 } 30 31 inline nlohmann::json resourceCreated() 32 { 33 return getLogResourceEvent( 34 redfish::registries::resource_event::Index::resourceCreated, {}); 35 } 36 37 inline nlohmann::json resourceRemoved() 38 { 39 return getLogResourceEvent( 40 redfish::registries::resource_event::Index::resourceCreated, {}); 41 } 42 43 } // namespace messages 44 } // namespace redfish 45