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 NLOHMANN_JSON_SERIALIZE_ENUM(MetricTypeEnum, {
42     {MetricTypeEnum::Invalid, "Invalid"},
43     {MetricTypeEnum::Numeric, "Numeric"},
44     {MetricTypeEnum::Discrete, "Discrete"},
45 });
46 
47 NLOHMANN_JSON_SERIALIZE_ENUM(TriggerActionEnum, {
48     {TriggerActionEnum::Invalid, "Invalid"},
49     {TriggerActionEnum::LogToLogService, "LogToLogService"},
50     {TriggerActionEnum::RedfishEvent, "RedfishEvent"},
51     {TriggerActionEnum::RedfishMetricReport, "RedfishMetricReport"},
52 });
53 
54 NLOHMANN_JSON_SERIALIZE_ENUM(DiscreteTriggerConditionEnum, {
55     {DiscreteTriggerConditionEnum::Invalid, "Invalid"},
56     {DiscreteTriggerConditionEnum::Specified, "Specified"},
57     {DiscreteTriggerConditionEnum::Changed, "Changed"},
58 });
59 
60 NLOHMANN_JSON_SERIALIZE_ENUM(ThresholdActivation, {
61     {ThresholdActivation::Invalid, "Invalid"},
62     {ThresholdActivation::Increasing, "Increasing"},
63     {ThresholdActivation::Decreasing, "Decreasing"},
64     {ThresholdActivation::Either, "Either"},
65     {ThresholdActivation::Disabled, "Disabled"},
66 });
67 
68 NLOHMANN_JSON_SERIALIZE_ENUM(DirectionOfCrossingEnum, {
69     {DirectionOfCrossingEnum::Invalid, "Invalid"},
70     {DirectionOfCrossingEnum::Increasing, "Increasing"},
71     {DirectionOfCrossingEnum::Decreasing, "Decreasing"},
72 });
73 
74 }
75 // clang-format on
76