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     OnTargetReset,
30 };
31 
32 enum class SupportedUpdateImageFormatType{
33     Invalid,
34     PLDMv1_0,
35     PLDMv1_1,
36     PLDMv1_2,
37     PLDMv1_3,
38     UEFICapsule,
39     VendorDefined,
40 };
41 
42 NLOHMANN_JSON_SERIALIZE_ENUM(TransferProtocolType, {
43     {TransferProtocolType::Invalid, "Invalid"},
44     {TransferProtocolType::CIFS, "CIFS"},
45     {TransferProtocolType::FTP, "FTP"},
46     {TransferProtocolType::SFTP, "SFTP"},
47     {TransferProtocolType::HTTP, "HTTP"},
48     {TransferProtocolType::HTTPS, "HTTPS"},
49     {TransferProtocolType::NSF, "NSF"},
50     {TransferProtocolType::SCP, "SCP"},
51     {TransferProtocolType::TFTP, "TFTP"},
52     {TransferProtocolType::OEM, "OEM"},
53     {TransferProtocolType::NFS, "NFS"},
54 });
55 
56 NLOHMANN_JSON_SERIALIZE_ENUM(ApplyTime, {
57     {ApplyTime::Invalid, "Invalid"},
58     {ApplyTime::Immediate, "Immediate"},
59     {ApplyTime::OnReset, "OnReset"},
60     {ApplyTime::AtMaintenanceWindowStart, "AtMaintenanceWindowStart"},
61     {ApplyTime::InMaintenanceWindowOnReset, "InMaintenanceWindowOnReset"},
62     {ApplyTime::OnStartUpdateRequest, "OnStartUpdateRequest"},
63     {ApplyTime::OnTargetReset, "OnTargetReset"},
64 });
65 
66 NLOHMANN_JSON_SERIALIZE_ENUM(SupportedUpdateImageFormatType, {
67     {SupportedUpdateImageFormatType::Invalid, "Invalid"},
68     {SupportedUpdateImageFormatType::PLDMv1_0, "PLDMv1_0"},
69     {SupportedUpdateImageFormatType::PLDMv1_1, "PLDMv1_1"},
70     {SupportedUpdateImageFormatType::PLDMv1_2, "PLDMv1_2"},
71     {SupportedUpdateImageFormatType::PLDMv1_3, "PLDMv1_3"},
72     {SupportedUpdateImageFormatType::UEFICapsule, "UEFICapsule"},
73     {SupportedUpdateImageFormatType::VendorDefined, "VendorDefined"},
74 });
75 
76 }
77 // clang-format on
78