X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frest%2Fmodel%2FActionToBeSetup.h;fp=src%2Frest%2Fmodel%2FActionToBeSetup.h;h=0000000000000000000000000000000000000000;hb=e64778dac480d66d93449efd3e9767cea4f980f9;hp=6bb8d55808e275498bcaf65eb28e553a8848a317;hpb=56044b79a2282e50a8c271b36289b1724cb40cd8;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/rest/model/ActionToBeSetup.h b/src/rest/model/ActionToBeSetup.h deleted file mode 100644 index 6bb8d55..0000000 --- a/src/rest/model/ActionToBeSetup.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef XAPP_MODEL_ActionToBeSetup_H -#define XAPP_MODEL_ActionToBeSetup_H -#include "ModelBase.h" -#include "SubsequentAction.h" - -namespace xapp { -namespace model { - -using namespace xapp::model; -using ActionDefinition = std::vector; - -struct ActionToBeSetup: ModelBase { - ActionDefinition m_ActionDefinition; - int ActionID; - std::string ActionType; - SubsequentAction m_SubsequentAction; - - json validator_schema = R"( - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "SubsequentAction", - "properties": { - "ActionDefinition": { - "description": "Action Definition", - "type": "array", - "items": { - "type": "integer" - } - }, - "ActionID": { - "description": "Identification of Action", - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "ActionType": { - "description": "Type of Action", - "type": "string", - "enum": ["policy", "insert", "report"] - }, - "SubsequentAction": { - "description": "Subsequent Action", - "type": "object" - } - }, - "required": [ - "ActionDefinition", - "ActionID", - "ActionType", - "SubsequentAction" - ], - "type": "object" - })"_json; - - virtual json get_validator_schema() const { return validator_schema; } -}; - -void from_json(const json& j, ActionToBeSetup& ref) { - - std::cout << __PRETTY_FUNCTION__ << std::endl; - ref.validate_json(j); - j.at("ActionDefinition").get_to(ref.m_ActionDefinition); - j.at("ActionID").get_to(ref.ActionID); - j.at("ActionType").get_to(ref.ActionType); - j.at("SubsequentAction").get_to(ref.m_SubsequentAction); - -} - -void to_json(json& j, const ActionToBeSetup& ref) { - - j = json { - {"ActionDefinition", ref.m_ActionDefinition}, - {"ActionID", ref.ActionID}, - {"ActionType", ref.ActionType}, - {"SubsequentAction", ref.m_SubsequentAction} - }; -} - -using ActionsToBeSetup = std::vector; - -} /*namespace model*/ -} /*namespace xapp*/ - -#endif /* XAPP_MODEL_ActionToBeSetup_H */ -