package net.somethingdreadful.MAL.api;

import java.util.ArrayList;

import net.somethingdreadful.MAL.api.response.Anime;
import net.somethingdreadful.MAL.api.response.AnimeList;
import net.somethingdreadful.MAL.api.response.Manga;
import net.somethingdreadful.MAL.api.response.MangaList;
import retrofit.client.Response;
import retrofit.http.DELETE;
import retrofit.http.GET;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Part;
import retrofit.http.Path;
import retrofit.http.Query;

public interface MALInterface {
	@GET("/account/verify_credentials")
	Response verifyAuthentication();

	@GET("/anime/{anime_id}")
	Anime getAnime(@Path("anime_id") int anime_id);
	@GET("/anime/search")
	ArrayList<Anime> searchAnime(@Query("q") String query);
	@GET("/anime/popular")
	ArrayList<Anime> getPopularAnime(@Query("page") int page);
	@GET("/anime/top")
	ArrayList<Anime> getTopRatedAnime(@Query("page") int page);
	@GET("/anime/upcoming")
	ArrayList<Anime> getUpcomingAnime(@Query("page") int page);
	@GET("/anime/just_added")
	ArrayList<Anime> getJustAddedAnime(@Query("page") int page);
	@GET("/animelist/{username}")
	AnimeList getAnimeList(@Path("username") String username);
	@DELETE("/animelist/anime/{anime_id}")
	Response deleteAnime(@Path("anime_id") int anime_id);
	@Multipart
	@POST("/animelist/anime")
	Response addAnime(@Part("anime_id") int id, @Part("status") String status, @Part("episodes") int episodes, 
			@Part("score") int score);
	@Multipart
	@PUT("/animelist/anime/{anime_id}")
	Response updateAnime(@Path("anime_id") int id, @Part("status") String status, @Part("episodes") int episodes, 
			@Part("score") int score);
	
	@GET("/manga/{manga_id}")
	Manga getManga(@Path("manga_id") int manga_id);
	@GET("/manga/search")
	ArrayList<Manga> searchManga(@Query("q") String query);
	@GET("/manga/popular")
	ArrayList<Manga> getPopularManga(@Query("page") int page);
	@GET("/manga/top")
	ArrayList<Manga> getTopRatedManga(@Query("page") int page);
	@GET("/manga/upcoming")
	ArrayList<Manga> getUpcomingManga(@Query("page") int page);
	@GET("/manga/just_added")
	ArrayList<Manga> getJustAddedManga(@Query("page") int page);
	@GET("/mangalist/{username}")
	MangaList getMangaList(@Path("username") String username);
	@DELETE("/mangalist/manga/{manga_id}")
	Response deleteManga(@Path("manga_id") int manga_id);
	@Multipart
	@POST("/mangalist/manga")
	Response addManga(@Part("manga_id") int id, @Part("status") String status, @Part("chapters") int chapters, 
			@Part("volumes") int volumes, @Part("score") int score);
	@Multipart
	@PUT("/mangalist/manga/{manga_id}")
	Response updateManga(@Path("manga_id") int id, @Part("status") String status, @Part("chapters") int chapters, 
			@Part("volumes") int volumes, @Part("score") int score);
}

@@ -365,19 +365,21 @@
 it.http.
-GET
+Field
 ;%0Aimport
@@ -393,25 +393,56 @@
 it.http.
-Multipart
+FormUrlEncoded;%0Aimport retrofit.http.GET
 ;%0Aimport
@@ -492,35 +492,8 @@
 UT;%0A
-import retrofit.http.Part;%0A
 impo
@@ -1328,33 +1328,38 @@
 nime_id);%0A%09@
-Multipart
+FormUrlEncoded
 %0A%09@POST(%22/an
@@ -1394,20 +1394,21 @@
 dAnime(@
-Part
+Field
 (%22anime_
@@ -1413,36 +1413,37 @@
 e_id%22) int id, @
-Part
+Field
 (%22status%22) Strin
@@ -1445,36 +1445,37 @@
 String status, @
-Part
+Field
 (%22episodes%22) int
@@ -1479,39 +1479,46 @@
 int episodes, %0A%09
-%09%09@Part
+        @Field
 (%22score%22) int sc
@@ -1521,33 +1521,38 @@
 t score);%0A%09@
-Multipart
+FormUrlEncoded
 %0A%09@PUT(%22/ani
@@ -1618,36 +1618,37 @@
 e_id%22) int id, @
-Part
+Field
 (%22status%22) Strin
@@ -1658,20 +1658,21 @@
 tatus, @
-Part
+Field
 (%22episod
@@ -1695,20 +1695,21 @@
 s, %0A%09%09%09@
-Part
+Field
 (%22score%22
@@ -2404,33 +2404,38 @@
 anga_id);%0A%09@
-Multipart
+FormUrlEncoded
 %0A%09@POST(%22/ma
@@ -2470,20 +2470,21 @@
 dManga(@
-Part
+Field
 (%22manga_
@@ -2489,36 +2489,37 @@
 a_id%22) int id, @
-Part
+Field
 (%22status%22) Strin
@@ -2521,36 +2521,37 @@
 String status, @
-Part
+Field
 (%22chapters%22) int
@@ -2555,39 +2555,46 @@
 int chapters, %0A%09
-%09%09@Part
+        @Field
 (%22volumes%22) int 
@@ -2595,36 +2595,37 @@
 ) int volumes, @
-Part
+Field
 (%22score%22) int sc
@@ -2636,17 +2636,22 @@
 ;%0A%09@
-Multipart
+FormUrlEncoded
 %0A%09@P
@@ -2733,20 +2733,21 @@
 nt id, @
-Part
+Field
 (%22status
@@ -2765,20 +2765,21 @@
 tatus, @
-Part
+Field
 (%22chapte
@@ -2803,15 +2803,22 @@
 , %0A%09
-%09%09@Part
+        @Field
 (%22vo
@@ -2843,12 +2843,13 @@
 s, @
-Part
+Field
 (%22sc

fix anime-/mangalist updates with the new API