1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace triggers
5 {
6 // clang-format off
7 
8 enum class MetricTypeEnum{
9     Invalid,
10     Numeric,
11     Discrete,
12 };
13 
14 enum class TriggerActionEnum{
15     Invalid,
16     LogToLogService,
17     RedfishEvent,
18     RedfishMetricReport,
19 };
20 
21 enum class DiscreteTriggerConditionEnum{
22     Invalid,
23     Specified,
24     Changed,
25 };
26 
27 enum class ThresholdActivation{
28     Invalid,
29     Increasing,
30     Decreasing,
31     Either,
32     Disabled,
33 };
34 
35 enum class DirectionOfCrossingEnum{
36     Invalid,
37     Increasing,
38     Decreasing,
39 };
40 
41 enum class TriggerActionMessage{
42     Invalid,
43     Telemetry,
44     DriveMediaLife,
45     ConnectionSpeed,
46 };
47 
48 NLOHMANN_JSON_SERIALIZE_ENUM(MetricTypeEnum, {
49     {MetricTypeEnum::Invalid, "Invalid"},
50     {MetricTypeEnum::Numeric, "Numeric"},
51     {MetricTypeEnum::Discrete, "Discrete"},
52 });
53 
54 NLOHMANN_JSON_SERIALIZE_ENUM(TriggerActionEnum, {
55     {TriggerActionEnum::Invalid, "Invalid"},
56     {TriggerActionEnum::LogToLogService, "LogToLogService"},
57     {TriggerActionEnum::RedfishEvent, "RedfishEvent"},
58     {TriggerActionEnum::RedfishMetricReport, "RedfishMetricReport"},
59 });
60 
61 NLOHMANN_JSON_SERIALIZE_ENUM(DiscreteTriggerConditionEnum, {
62     {DiscreteTriggerConditionEnum::Invalid, "Invalid"},
63     {DiscreteTriggerConditionEnum::Specified, "Specified"},
64     {DiscreteTriggerConditionEnum::Changed, "Changed"},
65 });
66 
67 NLOHMANN_JSON_SERIALIZE_ENUM(ThresholdActivation, {
68     {ThresholdActivation::Invalid, "Invalid"},
69     {ThresholdActivation::Increasing, "Increasing"},
70     {ThresholdActivation::Decreasing, "Decreasing"},
71     {ThresholdActivation::Either, "Either"},
72     {ThresholdActivation::Disabled, "Disabled"},
73 });
74 
75 NLOHMANN_JSON_SERIALIZE_ENUM(DirectionOfCrossingEnum, {
76     {DirectionOfCrossingEnum::Invalid, "Invalid"},
77     {DirectionOfCrossingEnum::Increasing, "Increasing"},
78     {DirectionOfCrossingEnum::Decreasing, "Decreasing"},
79 });
80 
81 NLOHMANN_JSON_SERIALIZE_ENUM(TriggerActionMessage, {
82     {TriggerActionMessage::Invalid, "Invalid"},
83     {TriggerActionMessage::Telemetry, "Telemetry"},
84     {TriggerActionMessage::DriveMediaLife, "DriveMediaLife"},
85     {TriggerActionMessage::ConnectionSpeed, "ConnectionSpeed"},
86 });
87 
88 }
89 // clang-format on
90