|
|
|
@ -18,17 +18,29 @@
|
|
|
|
|
*/
|
|
|
|
|
package org.wso2.carbon.device.mgt.jaxrs.service.api;
|
|
|
|
|
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
import io.swagger.annotations.ApiResponse;
|
|
|
|
|
import io.swagger.annotations.ApiResponses;
|
|
|
|
|
import io.swagger.annotations.ResponseHeader;
|
|
|
|
|
import org.wso2.carbon.apimgt.annotations.api.API;
|
|
|
|
|
import org.wso2.carbon.apimgt.annotations.api.Permission;
|
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceTypeList;
|
|
|
|
|
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
|
|
|
|
|
|
|
|
|
import javax.ws.rs.*;
|
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
|
import javax.ws.rs.Consumes;
|
|
|
|
|
import javax.ws.rs.GET;
|
|
|
|
|
import javax.ws.rs.HeaderParam;
|
|
|
|
|
import javax.ws.rs.Path;
|
|
|
|
|
import javax.ws.rs.PathParam;
|
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
|
|
|
|
|
@API(name = "Device Type Management", version = "1.0.0", context = "/api/device-mgt/v1.0/admin/device-types", tags = {"devicemgt_admin"})
|
|
|
|
|
@API(name = "Device Type Management", version = "1.0.0", context = "/api/device-mgt/v1.0/admin/device-types",
|
|
|
|
|
tags = {"devicemgt_admin"})
|
|
|
|
|
|
|
|
|
|
@Path("/device-types")
|
|
|
|
|
@Api(value = "Device Type Management", description = "This API corresponds to all tasks related to device " +
|
|
|
|
@ -60,14 +72,17 @@ public interface DeviceTypeManagementService {
|
|
|
|
|
"Used by caches, or in conditional requests."),
|
|
|
|
|
@ResponseHeader(
|
|
|
|
|
name = "Last-Modified",
|
|
|
|
|
description = "Date and time the resource has been modified the last time.\n" +
|
|
|
|
|
"Used by caches, or in conditional requests."),
|
|
|
|
|
description =
|
|
|
|
|
"Date and time the resource has been modified the last time.\n" +
|
|
|
|
|
"Used by caches, or in conditional requests."),
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 304,
|
|
|
|
|
message = "Not Modified. \n Empty body because the client has already the latest version of " +
|
|
|
|
|
"the requested resource."),
|
|
|
|
|
message =
|
|
|
|
|
"Not Modified. \n Empty body because the client has already the latest version of" +
|
|
|
|
|
" " +
|
|
|
|
|
"the requested resource."),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 406,
|
|
|
|
|
message = "Not Acceptable.\n The requested media type is not supported"),
|
|
|
|
@ -85,6 +100,66 @@ public interface DeviceTypeManagementService {
|
|
|
|
|
value = "Validates if the requested variant has not been modified since the time specified",
|
|
|
|
|
required = false)
|
|
|
|
|
@HeaderParam("If-Modified-Since")
|
|
|
|
|
String ifModifiedSince);
|
|
|
|
|
String ifModifiedSince);
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@ApiOperation(
|
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
|
httpMethod = "GET",
|
|
|
|
|
value = "Get the list of features for a give device type.",
|
|
|
|
|
notes = "Retrieves the list of features of a given device type.",
|
|
|
|
|
tags = "Device Type Management")
|
|
|
|
|
@ApiResponses(
|
|
|
|
|
value = {
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 200,
|
|
|
|
|
message = "OK. \n Successfully fetched the list of supported features.",
|
|
|
|
|
response = DeviceTypeList.class,
|
|
|
|
|
responseHeaders = {
|
|
|
|
|
@ResponseHeader(
|
|
|
|
|
name = "Content-Type",
|
|
|
|
|
description = "The content type of the body"),
|
|
|
|
|
@ResponseHeader(
|
|
|
|
|
name = "ETag",
|
|
|
|
|
description = "Entity Tag of the response resource.\n" +
|
|
|
|
|
"Used by caches, or in conditional requests."),
|
|
|
|
|
@ResponseHeader(
|
|
|
|
|
name = "Last-Modified",
|
|
|
|
|
description =
|
|
|
|
|
"Date and time the resource has been modified the last time.\n" +
|
|
|
|
|
"Used by caches, or in conditional requests."),
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 304,
|
|
|
|
|
message =
|
|
|
|
|
"Not Modified. \n Empty body because the client has already the latest version of" +
|
|
|
|
|
" " +
|
|
|
|
|
"the requested resource."),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 406,
|
|
|
|
|
message = "Not Acceptable.\n The requested media type is not supported"),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 500,
|
|
|
|
|
message = "Internal Server Error. \n Server error occurred while fetching the " +
|
|
|
|
|
"list of supported device types.",
|
|
|
|
|
response = ErrorResponse.class)
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
@Permission(name = "View Device Types", permission = "/device-mgt/devices/owning-device/view")
|
|
|
|
|
Response getFeatures(
|
|
|
|
|
@ApiParam(
|
|
|
|
|
name = "type",
|
|
|
|
|
value = "The device type, such as ios, android or windows.",
|
|
|
|
|
required = true)
|
|
|
|
|
@PathParam("type")
|
|
|
|
|
@Size(max = 45)
|
|
|
|
|
String type,
|
|
|
|
|
@ApiParam(
|
|
|
|
|
name = "If-Modified-Since",
|
|
|
|
|
value = "Validates if the requested variant has not been modified since the time specified",
|
|
|
|
|
required = false)
|
|
|
|
|
@HeaderParam("If-Modified-Since")
|
|
|
|
|
String ifModifiedSince);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|