1 #pragma once
2 
3 #include <optional>
4 #include <string>
5 #include <vector>
6 
7 namespace openpower::pels::user_data
8 {
9 
10 /**
11  * @brief  Returns the UserData contents as a formatted JSON string.
12  *
13  * @param[in] componentID - The comp ID from the UserData section header
14  * @param[in] subType - The subtype from the UserData section header
15  * @param[in] version - The version from the UserData section header
16  * @param[in] data - The section data
17  * @param[in] creatorID - Creator Subsystem ID from Private Header
18  * @param[in] plugins - Vector of strings of plugins found in filesystem
19  * @return std::optional<std::string> - The JSON string if it could be created,
20  *                                      else std::nullopt.
21  */
22 std::optional<std::string> getJSON(uint16_t componentID, uint8_t subType,
23                                    uint8_t version,
24                                    const std::vector<uint8_t>& data,
25                                    uint8_t creatorID,
26                                    const std::vector<std::string>& plugins);
27 
28 } // namespace openpower::pels::user_data
29