1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace drive
5 {
6 // clang-format off
7 
8 enum class MediaType{
9     Invalid,
10     HDD,
11     SSD,
12     SMR,
13 };
14 
15 enum class HotspareType{
16     Invalid,
17     None,
18     Global,
19     Chassis,
20     Dedicated,
21 };
22 
23 enum class EncryptionAbility{
24     Invalid,
25     None,
26     SelfEncryptingDrive,
27     Other,
28 };
29 
30 enum class EncryptionStatus{
31     Invalid,
32     Unecrypted,
33     Unlocked,
34     Locked,
35     Foreign,
36     Unencrypted,
37 };
38 
39 enum class StatusIndicator{
40     Invalid,
41     OK,
42     Fail,
43     Rebuild,
44     PredictiveFailureAnalysis,
45     Hotspare,
46     InACriticalArray,
47     InAFailedArray,
48 };
49 
50 enum class HotspareReplacementModeType{
51     Invalid,
52     Revertible,
53     NonRevertible,
54 };
55 
56 enum class DataSanitizationType{
57     Invalid,
58     BlockErase,
59     CryptographicErase,
60     Overwrite,
61 };
62 
63 enum class FormFactor{
64     Invalid,
65     Drive3_5,
66     Drive2_5,
67     EDSFF_1U_Long,
68     EDSFF_1U_Short,
69     EDSFF_E3_Short,
70     EDSFF_E3_Long,
71     M2_2230,
72     M2_2242,
73     M2_2260,
74     M2_2280,
75     M2_22110,
76     U2,
77     PCIeSlotFullLength,
78     PCIeSlotLowProfile,
79     PCIeHalfLength,
80     OEM,
81 };
82 
83 NLOHMANN_JSON_SERIALIZE_ENUM(MediaType, {
84     {MediaType::Invalid, "Invalid"},
85     {MediaType::HDD, "HDD"},
86     {MediaType::SSD, "SSD"},
87     {MediaType::SMR, "SMR"},
88 });
89 
90 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareType, {
91     {HotspareType::Invalid, "Invalid"},
92     {HotspareType::None, "None"},
93     {HotspareType::Global, "Global"},
94     {HotspareType::Chassis, "Chassis"},
95     {HotspareType::Dedicated, "Dedicated"},
96 });
97 
98 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionAbility, {
99     {EncryptionAbility::Invalid, "Invalid"},
100     {EncryptionAbility::None, "None"},
101     {EncryptionAbility::SelfEncryptingDrive, "SelfEncryptingDrive"},
102     {EncryptionAbility::Other, "Other"},
103 });
104 
105 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionStatus, {
106     {EncryptionStatus::Invalid, "Invalid"},
107     {EncryptionStatus::Unecrypted, "Unecrypted"},
108     {EncryptionStatus::Unlocked, "Unlocked"},
109     {EncryptionStatus::Locked, "Locked"},
110     {EncryptionStatus::Foreign, "Foreign"},
111     {EncryptionStatus::Unencrypted, "Unencrypted"},
112 });
113 
114 NLOHMANN_JSON_SERIALIZE_ENUM(StatusIndicator, {
115     {StatusIndicator::Invalid, "Invalid"},
116     {StatusIndicator::OK, "OK"},
117     {StatusIndicator::Fail, "Fail"},
118     {StatusIndicator::Rebuild, "Rebuild"},
119     {StatusIndicator::PredictiveFailureAnalysis, "PredictiveFailureAnalysis"},
120     {StatusIndicator::Hotspare, "Hotspare"},
121     {StatusIndicator::InACriticalArray, "InACriticalArray"},
122     {StatusIndicator::InAFailedArray, "InAFailedArray"},
123 });
124 
125 NLOHMANN_JSON_SERIALIZE_ENUM(HotspareReplacementModeType, {
126     {HotspareReplacementModeType::Invalid, "Invalid"},
127     {HotspareReplacementModeType::Revertible, "Revertible"},
128     {HotspareReplacementModeType::NonRevertible, "NonRevertible"},
129 });
130 
131 NLOHMANN_JSON_SERIALIZE_ENUM(DataSanitizationType, {
132     {DataSanitizationType::Invalid, "Invalid"},
133     {DataSanitizationType::BlockErase, "BlockErase"},
134     {DataSanitizationType::CryptographicErase, "CryptographicErase"},
135     {DataSanitizationType::Overwrite, "Overwrite"},
136 });
137 
138 NLOHMANN_JSON_SERIALIZE_ENUM(FormFactor, {
139     {FormFactor::Invalid, "Invalid"},
140     {FormFactor::Drive3_5, "Drive3_5"},
141     {FormFactor::Drive2_5, "Drive2_5"},
142     {FormFactor::EDSFF_1U_Long, "EDSFF_1U_Long"},
143     {FormFactor::EDSFF_1U_Short, "EDSFF_1U_Short"},
144     {FormFactor::EDSFF_E3_Short, "EDSFF_E3_Short"},
145     {FormFactor::EDSFF_E3_Long, "EDSFF_E3_Long"},
146     {FormFactor::M2_2230, "M2_2230"},
147     {FormFactor::M2_2242, "M2_2242"},
148     {FormFactor::M2_2260, "M2_2260"},
149     {FormFactor::M2_2280, "M2_2280"},
150     {FormFactor::M2_22110, "M2_22110"},
151     {FormFactor::U2, "U2"},
152     {FormFactor::PCIeSlotFullLength, "PCIeSlotFullLength"},
153     {FormFactor::PCIeSlotLowProfile, "PCIeSlotLowProfile"},
154     {FormFactor::PCIeHalfLength, "PCIeHalfLength"},
155     {FormFactor::OEM, "OEM"},
156 });
157 
158 }
159 // clang-format on
160