1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace update_service
5 {
6 // clang-format off
7 
8 enum class TransferProtocolType{
9     Invalid,
10     CIFS,
11     FTP,
12     SFTP,
13     HTTP,
14     HTTPS,
15     NSF,
16     SCP,
17     TFTP,
18     OEM,
19     NFS,
20 };
21 
22 enum class ApplyTime{
23     Invalid,
24     Immediate,
25     OnReset,
26     AtMaintenanceWindowStart,
27     InMaintenanceWindowOnReset,
28     OnStartUpdateRequest,
29 };
30 
31 enum class SupportedUpdateImageFormatType{
32     Invalid,
33     PLDMv1_0,
34     PLDMv1_1,
35     PLDMv1_2,
36     PLDMv1_3,
37     UEFICapsule,
38     VendorDefined,
39 };
40 
41 NLOHMANN_JSON_SERIALIZE_ENUM(TransferProtocolType, {
42     {TransferProtocolType::Invalid, "Invalid"},
43     {TransferProtocolType::CIFS, "CIFS"},
44     {TransferProtocolType::FTP, "FTP"},
45     {TransferProtocolType::SFTP, "SFTP"},
46     {TransferProtocolType::HTTP, "HTTP"},
47     {TransferProtocolType::HTTPS, "HTTPS"},
48     {TransferProtocolType::NSF, "NSF"},
49     {TransferProtocolType::SCP, "SCP"},
50     {TransferProtocolType::TFTP, "TFTP"},
51     {TransferProtocolType::OEM, "OEM"},
52     {TransferProtocolType::NFS, "NFS"},
53 });
54 
55 NLOHMANN_JSON_SERIALIZE_ENUM(ApplyTime, {
56     {ApplyTime::Invalid, "Invalid"},
57     {ApplyTime::Immediate, "Immediate"},
58     {ApplyTime::OnReset, "OnReset"},
59     {ApplyTime::AtMaintenanceWindowStart, "AtMaintenanceWindowStart"},
60     {ApplyTime::InMaintenanceWindowOnReset, "InMaintenanceWindowOnReset"},
61     {ApplyTime::OnStartUpdateRequest, "OnStartUpdateRequest"},
62 });
63 
64 NLOHMANN_JSON_SERIALIZE_ENUM(SupportedUpdateImageFormatType, {
65     {SupportedUpdateImageFormatType::Invalid, "Invalid"},
66     {SupportedUpdateImageFormatType::PLDMv1_0, "PLDMv1_0"},
67     {SupportedUpdateImageFormatType::PLDMv1_1, "PLDMv1_1"},
68     {SupportedUpdateImageFormatType::PLDMv1_2, "PLDMv1_2"},
69     {SupportedUpdateImageFormatType::PLDMv1_3, "PLDMv1_3"},
70     {SupportedUpdateImageFormatType::UEFICapsule, "UEFICapsule"},
71     {SupportedUpdateImageFormatType::VendorDefined, "VendorDefined"},
72 });
73 
74 }
75 // clang-format on
76