1 #ifndef XAPP_MODEL_SubscriptionInstance_H
2 #define XAPP_MODEL_SubscriptionInstance_H
8 struct SubscriptionInstance: ModelBase {
10 std::string ErrorCause;
11 std::string ErrorSource;
12 std::string TimeoutType;
13 int XappEventInstanceID;
15 json validator_schema = R"(
17 "$schema": "http://json-schema.org/draft-07/schema#",
18 "title": "SubscriptionInstance",
19 "description": "xApp service address and port",
21 "XappEventInstanceId": {
26 "E2EventInstanceId": {
32 "description": "Descriptive error cause. Empty string when no error.",
36 "description": "Source of error cause.",
38 "enum": ["SUBMGR", "RTMGR", "DBAAS", "ASN1", "E2Node"]
41 "description": "Type timeout. xApp should retry if timeout occurs.",
43 "enum": ["E2-Timeout", "RTMGR-Timeout", "DBAAS-Timeout"]
47 "XappEventInstanceId",
53 virtual json get_validator_schema() const { return validator_schema; }
56 void from_json(const json& j, SubscriptionInstance& ref) {
58 std::cout << __PRETTY_FUNCTION__ << std::endl;
61 j.at("XappEventInstanceId").get_to(ref.XappEventInstanceID);
62 j.at("E2EventInstanceId").get_to(ref.E2EventInstanceID);
63 j.at("ErrorCause").get_to(ref.ErrorCause);
64 j.at("ErrorSource").get_to(ref.ErrorSource);
65 j.at("TimeoutType").get_to(ref.TimeoutType);
68 void to_json(json& j, const SubscriptionInstance& ref) {
71 {"XappEventInstanceId", ref.XappEventInstanceID},
72 {"E2EventInstanceId", ref.E2EventInstanceID},
73 {"ErrorCause", ref.ErrorCause},
74 {"ErrorSource", ref.ErrorSource},
75 {"TimeoutType", ref.TimeoutType}
79 using SubscriptionInstances = std::vector<SubscriptionInstance>;
83 #endif /*XAPP_MODEL_SubscriptionInstance_H*/