From e75afb8020806332f90fbfda86360c7e7088b09b Mon Sep 17 00:00:00 2001 From: Madhawa Perera Date: Fri, 13 May 2016 07:07:55 +0530 Subject: [PATCH] Adding swagger annotations to beans --- .../carbon/device/mgt/jaxrs/beans/Profile.java | 14 ++++++++++++++ .../device/mgt/jaxrs/beans/ProfileFeature.java | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java index 25ad8ab215..cad8906371 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java @@ -20,6 +20,8 @@ package org.wso2.carbon.device.mgt.jaxrs.beans; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -27,14 +29,26 @@ import java.sql.Timestamp; import java.util.List; @XmlRootElement +@ApiModel(value = "Profile", description = "This class carries all information related to policy profiles") public class Profile { + @ApiModelProperty(name = "profileId", value = "The ID of each profile that is in the selected policy", + required = true) private int profileId; + @ApiModelProperty(name = "profileName", value = "The name of the profile", required = true) private String profileName; + @ApiModelProperty(name = "tenantId", value = "The ID of the tenant that added the policy", required = true) private int tenantId; + @ApiModelProperty(name = "deviceType", value = "Contains the device type details the policy was created " + + "for", required = true) private DeviceType deviceType; + @ApiModelProperty(name = "createdDate", value = "The date the policy was created", required = true) private Timestamp createdDate; + @ApiModelProperty(name = "updatedDate", value = "The date the changes made to the policy was published to" + + " the devices registered with the EMM", required = true) private Timestamp updatedDate; + @ApiModelProperty(name = "profileFeaturesList", value = "Contains the features specific to each profile " + + "in the policy", required = true) private List profileFeaturesList; // Features included in the policies. public DeviceType getDeviceType() { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java index d52f30281b..81d8032799 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java @@ -19,15 +19,30 @@ package org.wso2.carbon.device.mgt.jaxrs.beans; import com.google.gson.Gson; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + import java.io.Serializable; +@ApiModel(value = "ProfileFeature", description = "This class carries all information related to profile " + + "features") public class ProfileFeature implements Serializable { + @ApiModelProperty(name = "id", value = "Define the ID", required = true) private int id; + @ApiModelProperty(name = "featureCode", value = "Provide the code that defines the policy you wish to add", + required = true) private String featureCode; + @ApiModelProperty(name = "profileId", value = "Define the ID of the profile", required = true) private int profileId; + @ApiModelProperty(name = "deviceTypeId", value = "The ID used to define the type of the device platform", + required = true) private int deviceTypeId; + @ApiModelProperty(name = "content", value = "The list of parameters that define the policy", + required = true) private Object content; + @ApiModelProperty(name = "payLoad", value = "The payload which is submitted to each feature", + required = true) private String payLoad; public int getId() {