X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frest%2Fmodel%2FSubscriptionInstance.h;fp=src%2Frest%2Fmodel%2FSubscriptionInstance.h;h=0000000000000000000000000000000000000000;hb=e64778dac480d66d93449efd3e9767cea4f980f9;hp=f427e791c31ca8fb9e89c42859bb8aca9479a525;hpb=56044b79a2282e50a8c271b36289b1724cb40cd8;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/rest/model/SubscriptionInstance.h b/src/rest/model/SubscriptionInstance.h deleted file mode 100644 index f427e79..0000000 --- a/src/rest/model/SubscriptionInstance.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef XAPP_MODEL_SubscriptionInstance_H -#define XAPP_MODEL_SubscriptionInstance_H -#include "ModelBase.h" - -namespace xapp { -namespace model { - -struct SubscriptionInstance: ModelBase { - int E2EventInstanceID; - std::string ErrorCause; - std::string ErrorSource; - std::string TimeoutType; - int XappEventInstanceID; - - json validator_schema = R"( - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "SubscriptionInstance", - "description": "xApp service address and port", - "properties": { - "XappEventInstanceId": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "E2EventInstanceId": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "ErrorCause": { - "description": "Descriptive error cause. Empty string when no error.", - "type": "string" - }, - "ErrorSource": { - "description": "Source of error cause.", - "type": "string", - "enum": ["SUBMGR", "RTMGR", "DBAAS", "ASN1", "E2Node"] - }, - "TimeoutType": { - "description": "Type timeout. xApp should retry if timeout occurs.", - "type": "string", - "enum": ["E2-Timeout", "RTMGR-Timeout", "DBAAS-Timeout"] - } - }, - "required": [ - "XappEventInstanceId", - "E2EventInstanceId" - ], - "type": "object" - })"_json; - - virtual json get_validator_schema() const { return validator_schema; } -}; - -void from_json(const json& j, SubscriptionInstance& ref) { - - std::cout << __PRETTY_FUNCTION__ << std::endl; - ref.validate_json(j); - - j.at("XappEventInstanceId").get_to(ref.XappEventInstanceID); - j.at("E2EventInstanceId").get_to(ref.E2EventInstanceID); - j.at("ErrorCause").get_to(ref.ErrorCause); - j.at("ErrorSource").get_to(ref.ErrorSource); - j.at("TimeoutType").get_to(ref.TimeoutType); -} - -void to_json(json& j, const SubscriptionInstance& ref) { - - j = json { - {"XappEventInstanceId", ref.XappEventInstanceID}, - {"E2EventInstanceId", ref.E2EventInstanceID}, - {"ErrorCause", ref.ErrorCause}, - {"ErrorSource", ref.ErrorSource}, - {"TimeoutType", ref.TimeoutType} - }; -} - -using SubscriptionInstances = std::vector; - -} /*namespace model*/ -} /*namespace xapp*/ -#endif /*XAPP_MODEL_SubscriptionInstance_H*/