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