1*40e9b92eSEd Tanous // SPDX-License-Identifier: Apache-2.0 2*40e9b92eSEd Tanous // SPDX-FileCopyrightText: Copyright OpenBMC Authors 30ec8b83dSEd Tanous #pragma once 40ec8b83dSEd Tanous #include <nlohmann/json.hpp> 50ec8b83dSEd Tanous 60ec8b83dSEd Tanous namespace attribute_registry 70ec8b83dSEd Tanous { 80ec8b83dSEd Tanous // clang-format off 90ec8b83dSEd Tanous 100ec8b83dSEd Tanous enum class AttributeType{ 110ec8b83dSEd Tanous Invalid, 120ec8b83dSEd Tanous Enumeration, 130ec8b83dSEd Tanous String, 140ec8b83dSEd Tanous Integer, 150ec8b83dSEd Tanous Boolean, 160ec8b83dSEd Tanous Password, 170ec8b83dSEd Tanous }; 180ec8b83dSEd Tanous 190ec8b83dSEd Tanous enum class DependencyType{ 200ec8b83dSEd Tanous Invalid, 210ec8b83dSEd Tanous Map, 220ec8b83dSEd Tanous }; 230ec8b83dSEd Tanous 240ec8b83dSEd Tanous enum class MapFromCondition{ 250ec8b83dSEd Tanous Invalid, 260ec8b83dSEd Tanous EQU, 270ec8b83dSEd Tanous NEQ, 280ec8b83dSEd Tanous GTR, 290ec8b83dSEd Tanous GEQ, 300ec8b83dSEd Tanous LSS, 310ec8b83dSEd Tanous LEQ, 320ec8b83dSEd Tanous }; 330ec8b83dSEd Tanous 340ec8b83dSEd Tanous enum class MapFromProperty{ 350ec8b83dSEd Tanous Invalid, 360ec8b83dSEd Tanous CurrentValue, 370ec8b83dSEd Tanous DefaultValue, 380ec8b83dSEd Tanous ReadOnly, 390ec8b83dSEd Tanous WriteOnly, 400ec8b83dSEd Tanous GrayOut, 410ec8b83dSEd Tanous Hidden, 420ec8b83dSEd Tanous LowerBound, 430ec8b83dSEd Tanous UpperBound, 440ec8b83dSEd Tanous MinLength, 450ec8b83dSEd Tanous MaxLength, 460ec8b83dSEd Tanous ScalarIncrement, 470ec8b83dSEd Tanous }; 480ec8b83dSEd Tanous 490ec8b83dSEd Tanous enum class MapTerms{ 500ec8b83dSEd Tanous Invalid, 510ec8b83dSEd Tanous AND, 520ec8b83dSEd Tanous OR, 530ec8b83dSEd Tanous }; 540ec8b83dSEd Tanous 550ec8b83dSEd Tanous enum class MapToProperty{ 560ec8b83dSEd Tanous Invalid, 570ec8b83dSEd Tanous CurrentValue, 580ec8b83dSEd Tanous DefaultValue, 590ec8b83dSEd Tanous ReadOnly, 600ec8b83dSEd Tanous WriteOnly, 610ec8b83dSEd Tanous GrayOut, 620ec8b83dSEd Tanous Hidden, 630ec8b83dSEd Tanous Immutable, 640ec8b83dSEd Tanous HelpText, 650ec8b83dSEd Tanous WarningText, 660ec8b83dSEd Tanous DisplayName, 670ec8b83dSEd Tanous DisplayOrder, 680ec8b83dSEd Tanous LowerBound, 690ec8b83dSEd Tanous UpperBound, 700ec8b83dSEd Tanous MinLength, 710ec8b83dSEd Tanous MaxLength, 720ec8b83dSEd Tanous ScalarIncrement, 730ec8b83dSEd Tanous ValueExpression, 740ec8b83dSEd Tanous }; 750ec8b83dSEd Tanous 760ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(AttributeType, { 770ec8b83dSEd Tanous {AttributeType::Invalid, "Invalid"}, 780ec8b83dSEd Tanous {AttributeType::Enumeration, "Enumeration"}, 790ec8b83dSEd Tanous {AttributeType::String, "String"}, 800ec8b83dSEd Tanous {AttributeType::Integer, "Integer"}, 810ec8b83dSEd Tanous {AttributeType::Boolean, "Boolean"}, 820ec8b83dSEd Tanous {AttributeType::Password, "Password"}, 830ec8b83dSEd Tanous }); 840ec8b83dSEd Tanous 850ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(DependencyType, { 860ec8b83dSEd Tanous {DependencyType::Invalid, "Invalid"}, 870ec8b83dSEd Tanous {DependencyType::Map, "Map"}, 880ec8b83dSEd Tanous }); 890ec8b83dSEd Tanous 900ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(MapFromCondition, { 910ec8b83dSEd Tanous {MapFromCondition::Invalid, "Invalid"}, 920ec8b83dSEd Tanous {MapFromCondition::EQU, "EQU"}, 930ec8b83dSEd Tanous {MapFromCondition::NEQ, "NEQ"}, 940ec8b83dSEd Tanous {MapFromCondition::GTR, "GTR"}, 950ec8b83dSEd Tanous {MapFromCondition::GEQ, "GEQ"}, 960ec8b83dSEd Tanous {MapFromCondition::LSS, "LSS"}, 970ec8b83dSEd Tanous {MapFromCondition::LEQ, "LEQ"}, 980ec8b83dSEd Tanous }); 990ec8b83dSEd Tanous 1000ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(MapFromProperty, { 1010ec8b83dSEd Tanous {MapFromProperty::Invalid, "Invalid"}, 1020ec8b83dSEd Tanous {MapFromProperty::CurrentValue, "CurrentValue"}, 1030ec8b83dSEd Tanous {MapFromProperty::DefaultValue, "DefaultValue"}, 1040ec8b83dSEd Tanous {MapFromProperty::ReadOnly, "ReadOnly"}, 1050ec8b83dSEd Tanous {MapFromProperty::WriteOnly, "WriteOnly"}, 1060ec8b83dSEd Tanous {MapFromProperty::GrayOut, "GrayOut"}, 1070ec8b83dSEd Tanous {MapFromProperty::Hidden, "Hidden"}, 1080ec8b83dSEd Tanous {MapFromProperty::LowerBound, "LowerBound"}, 1090ec8b83dSEd Tanous {MapFromProperty::UpperBound, "UpperBound"}, 1100ec8b83dSEd Tanous {MapFromProperty::MinLength, "MinLength"}, 1110ec8b83dSEd Tanous {MapFromProperty::MaxLength, "MaxLength"}, 1120ec8b83dSEd Tanous {MapFromProperty::ScalarIncrement, "ScalarIncrement"}, 1130ec8b83dSEd Tanous }); 1140ec8b83dSEd Tanous 1150ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(MapTerms, { 1160ec8b83dSEd Tanous {MapTerms::Invalid, "Invalid"}, 1170ec8b83dSEd Tanous {MapTerms::AND, "AND"}, 1180ec8b83dSEd Tanous {MapTerms::OR, "OR"}, 1190ec8b83dSEd Tanous }); 1200ec8b83dSEd Tanous 1210ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(MapToProperty, { 1220ec8b83dSEd Tanous {MapToProperty::Invalid, "Invalid"}, 1230ec8b83dSEd Tanous {MapToProperty::CurrentValue, "CurrentValue"}, 1240ec8b83dSEd Tanous {MapToProperty::DefaultValue, "DefaultValue"}, 1250ec8b83dSEd Tanous {MapToProperty::ReadOnly, "ReadOnly"}, 1260ec8b83dSEd Tanous {MapToProperty::WriteOnly, "WriteOnly"}, 1270ec8b83dSEd Tanous {MapToProperty::GrayOut, "GrayOut"}, 1280ec8b83dSEd Tanous {MapToProperty::Hidden, "Hidden"}, 1290ec8b83dSEd Tanous {MapToProperty::Immutable, "Immutable"}, 1300ec8b83dSEd Tanous {MapToProperty::HelpText, "HelpText"}, 1310ec8b83dSEd Tanous {MapToProperty::WarningText, "WarningText"}, 1320ec8b83dSEd Tanous {MapToProperty::DisplayName, "DisplayName"}, 1330ec8b83dSEd Tanous {MapToProperty::DisplayOrder, "DisplayOrder"}, 1340ec8b83dSEd Tanous {MapToProperty::LowerBound, "LowerBound"}, 1350ec8b83dSEd Tanous {MapToProperty::UpperBound, "UpperBound"}, 1360ec8b83dSEd Tanous {MapToProperty::MinLength, "MinLength"}, 1370ec8b83dSEd Tanous {MapToProperty::MaxLength, "MaxLength"}, 1380ec8b83dSEd Tanous {MapToProperty::ScalarIncrement, "ScalarIncrement"}, 1390ec8b83dSEd Tanous {MapToProperty::ValueExpression, "ValueExpression"}, 1400ec8b83dSEd Tanous }); 1410ec8b83dSEd Tanous 1420ec8b83dSEd Tanous } 1430ec8b83dSEd Tanous // clang-format on 144