Updates of the policy agent NBI
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / controllers / PolicyInfo.java
index 040ca3a..1736c18 100644 (file)
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
+
 package org.oransc.policyagent.controllers;
 
-import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
 import org.immutables.gson.Gson;
-import org.immutables.value.Value;
 
-@Value.Immutable
 @Gson.TypeAdapters
-public interface PolicyInfo {
+@ApiModel(value = "PolicyInfo")
+public class PolicyInfo {
+
+    @ApiModelProperty(value = "identity of the policy")
+    public String id;
+
+    @ApiModelProperty(value = "name of the policy type")
+    public String type;
+
+    @ApiModelProperty(value = "identity the target NearRT RIC")
+    public String ric;
+
+    @ApiModelProperty(value = "the configuration of the policy")
+    public Object json;
+
+    @ApiModelProperty(value = "the name of the service owning the policy")
+    public String service;
 
-    @SerializedName("id")
-    public String name();
+    @ApiModelProperty(value = "timestamp, last modification time")
+    public String lastModified;
 
-    @SerializedName("type")
-    public String type();
+    PolicyInfo() {
+    }
 
-    @SerializedName("ric")
-    public String ric();
+    public boolean validate() {
+        return id != null && type != null && ric != null && json != null && service != null && lastModified != null;
+    }
 
-    @SerializedName("json")
-    public String json();
 }