blob: aaf146ae5827486409228f8c3d40ff9dd27479df [file] [log] [blame]
Matt Spinleracb7c102020-01-10 13:49:22 -06001#pragma once
2
Matt Spinler81bc5612023-06-01 16:48:19 -05003#include <cstdint>
Matt Spinleracb7c102020-01-10 13:49:22 -06004#include <optional>
5#include <string>
6#include <vector>
7
8namespace openpower::pels::user_data
9{
10
11/**
12 * @brief Returns the UserData contents as a formatted JSON string.
13 *
14 * @param[in] componentID - The comp ID from the UserData section header
15 * @param[in] subType - The subtype from the UserData section header
16 * @param[in] version - The version from the UserData section header
17 * @param[in] data - The section data
Harisuddin Mohamed Isaf67bafd2020-07-06 17:51:21 +080018 * @param[in] creatorID - Creator Subsystem ID from Private Header
Harisuddin Mohamed Isa3fdcd4e2020-08-26 11:56:42 +080019 * @param[in] plugins - Vector of strings of plugins found in filesystem
Matt Spinleracb7c102020-01-10 13:49:22 -060020 * @return std::optional<std::string> - The JSON string if it could be created,
21 * else std::nullopt.
22 */
Patrick Williams075c7922024-08-16 15:19:49 -040023std::optional<std::string>
24 getJSON(uint16_t componentID, uint8_t subType, uint8_t version,
25 const std::vector<uint8_t>& data, uint8_t creatorID,
26 const std::vector<std::string>& plugins);
Matt Spinleracb7c102020-01-10 13:49:22 -060027
28} // namespace openpower::pels::user_data