package it.unisannio.ding.ids.wedroid.wrapper.api; import java.util.List; import it.unisannio.ding.ids.wedroid.wrapper.entity.Board; import it.unisannio.ding.ids.wedroid.wrapper.entity.BoardPrototype; import it.unisannio.ding.ids.wedroid.wrapper.entity.LabelPrototype; import it.unisannio.ding.ids.wedroid.wrapper.entity.MemberPermission; import retrofit2.Call; import retrofit2.http.*; public interface BoardService { /** * Get all public boards. * * @return the list with all public boards */ @GET("api/boards") Call> getPublicBoards(); /** * Create a board. * * @param boardPrototype the prototype of the new board * @return the new board * @see BoardPrototype */ @POST("api/boards") Call newBoard(@Body BoardPrototype boardPrototype); /** * Get the board with that particular ID. * * @param boardId The ID of the board * @return The board with the matching ID */ @GET("api/boards/{boardId}") Call getBoard(@Path("boardId") String boardId); /** * Delete the board with that particular ID * * @param boardId The ID of the board */ @DELETE("api/boards/{boardId}") Call deleteBoard(@Path("boardId") String boardId); /** * Add a label to a board. * * @param boardId The ID of the board * @param labelPrototype The prototype of new label * @return The ID of new label * @see LabelPrototype */ @PUT("/api/boards/{boardId}/labels") Call addLabel( @Path("boardId") String boardId, @Body LabelPrototype labelPrototype ); /** * Change the permission of a member of a board. * * @param boardId The ID of the board * @param memberId The ID of the member * @param memberPermission The new role of the member * @see MemberPermission */ @POST("/api/boards/{boardId}/members/{memberId}") Call setMemberPermission( @Path("boardId") String boardId, @Path("memberId") String memberId, @Body MemberPermission memberPermission ); /** * Get all boards attached to a user. * * @param userId The ID of the user * @return The list with all user's boards */ @GET("api/users/{userId}/boards") Call> getBoardsFromUser(@Path("userId") String userId); }