X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frest%2Fmodel%2FSubscriptionDetail.h;fp=src%2Frest%2Fmodel%2FSubscriptionDetail.h;h=0000000000000000000000000000000000000000;hb=e64778dac480d66d93449efd3e9767cea4f980f9;hp=1651619224f74263c0f46f0cfe3c9365dd6aafde;hpb=56044b79a2282e50a8c271b36289b1724cb40cd8;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/rest/model/SubscriptionDetail.h b/src/rest/model/SubscriptionDetail.h deleted file mode 100644 index 1651619..0000000 --- a/src/rest/model/SubscriptionDetail.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef XAPP_MODEL_SubscriptionDetail_H -#define XAPP_MODEL_SubscriptionDetail_H -#include "ModelBase.h" -#include "ActionToBeSetup.h" - -namespace xapp { -namespace model { - -using EventTriggerDefinition = std::vector; - -struct SubscriptionDetail: ModelBase { - ActionsToBeSetup ActionToBeSetupList; - EventTriggerDefinition EventTriggers; - int XappEventInstanceID; - json validator_schema = R"( - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Subscription detail", - "properties": { - "XappEventInstanceId": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "EventTriggers": { - "description": "Identification of Action", - "type": "array", - "items": { - "type": "integer" - } - }, - "ActionToBeSetupList": { - "type": "array" - } - }, - "required": [ - "XappEventInstanceId", - "EventTriggers", - "ActionToBeSetupList" - ], - "type": "object" - })"_json; - - virtual json get_validator_schema() const { return validator_schema; } - -}; - -void from_json(const json& j, SubscriptionDetail& ref) { - - std::cout << __PRETTY_FUNCTION__ << std::endl; - ref.validate_json(j); - - j.at("XappEventInstanceId").get_to(ref.XappEventInstanceID); - j.at("EventTriggers").get_to(ref.EventTriggers); - j.at("ActionToBeSetupList").get_to(ref.ActionToBeSetupList); -} - -void to_json(json& j, const SubscriptionDetail& ref) { - - j = json { - {"XappEventInstanceId", ref.XappEventInstanceID}, - {"EventTriggers", ref.EventTriggers}, - {"ActionToBeSetupList", ref.ActionToBeSetupList}, - }; -} - -using SubscriptionDetailsList = std::vector; - -} /*namespace model*/ -} /*namespace xapp*/ -#endif /*XAPP_MODEL_SubscriptionDetail_H*/