blob: 2f9575e617481a4ecf2c38bc2093086696c71a75 [file] [log] [blame]
Ed Tanousa8a5bc12024-12-02 15:43:16 -08001/****************************************************************
2 * READ THIS WARNING FIRST
3 * This is an auto-generated header which contains definitions
4 * for Redfish DMTF defined messages.
5 * DO NOT modify this registry outside of running the
6 * parse_registries.py script. The definitions contained within
7 * this file are owned by DMTF. Any modifications to these files
8 * should be first pushed to the relevant registry in the DMTF
9 * github organization.
10 ***************************************************************/
11#include "heartbeat_messages.hpp"
12
13#include "registries.hpp"
14#include "registries/heartbeat_event_message_registry.hpp"
15
16#include <nlohmann/json.hpp>
17
18#include <array>
19#include <cstddef>
20#include <span>
21#include <string_view>
22
23// Clang can't seem to decide whether this header needs to be included or not,
24// and is inconsistent. Include it for now
25// NOLINTNEXTLINE(misc-include-cleaner)
26#include <utility>
27
28namespace redfish
29{
30
31namespace messages
32{
33
Patrick Williams4a102cd2025-02-27 14:52:54 -050034static nlohmann::json getLog(redfish::registries::HeartbeatEvent::Index name,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080035 std::span<const std::string_view> args)
36{
37 size_t index = static_cast<size_t>(name);
Patrick Williams4a102cd2025-02-27 14:52:54 -050038 if (index >= redfish::registries::HeartbeatEvent::registry.size())
Ed Tanousa8a5bc12024-12-02 15:43:16 -080039 {
40 return {};
41 }
Patrick Williams4a102cd2025-02-27 14:52:54 -050042 return getLogFromRegistry(redfish::registries::HeartbeatEvent::header,
43 redfish::registries::HeartbeatEvent::registry,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080044 index, args);
45}
46
47/**
48 * @internal
49 * @brief Formats RedfishServiceFunctional message into JSON
50 *
51 * See header file for more information
52 * @endinternal
53 */
54nlohmann::json redfishServiceFunctional()
55{
56 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -050057 redfish::registries::HeartbeatEvent::Index::redfishServiceFunctional,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080058 {});
59}
60
61} // namespace messages
62} // namespace redfish