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  *
18  * @return std::optional<std::string> - The JSON string if it could be created,
19  *                                      else std::nullopt.
20  */
21 std::optional<std::string> getJSON(uint16_t componentID, uint8_t subType,
22                                    uint8_t version,
23                                    const std::vector<uint8_t>& data);
24 
25 } // namespace openpower::pels::user_data
26