X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Fcontrollers%2FPolicyInfo.java;h=1736c18ed2b3390815d1b17c67769eadfe328d37;hb=776c8156aae66f505ab234063923e66e7e610a01;hp=040ca3a6b92cf4e6ddb83772076821d462123a4c;hpb=4a7dd457d5b179dd0f588663fc1476dacfca4f22;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyInfo.java b/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyInfo.java index 040ca3a6..1736c18e 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyInfo.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyInfo.java @@ -17,26 +17,41 @@ * 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(); }