package io.b1ackr0se.bridddle.data.remote.dribbble;


import java.util.List;

import io.b1ackr0se.bridddle.data.model.AccessToken;
import io.b1ackr0se.bridddle.data.model.Comment;
import io.b1ackr0se.bridddle.data.model.Like;
import io.b1ackr0se.bridddle.data.model.LikedShot;
import io.b1ackr0se.bridddle.data.model.Shot;
import io.b1ackr0se.bridddle.data.model.User;
import okhttp3.ResponseBody;
import retrofit2.Response;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

public interface DribbbleApi {
    String ENDPOINT = "https://api.dribbble.com/";

    @GET("v1/shots")
    Observable<List<Shot>> getPopular(@Query("page") Integer page, @Query("per_page") Integer pageSize);

    @GET("v1/user")
    Observable<User> getAuthenticatedUser();

    @GET("v1/user/likes")
    Observable<List<LikedShot>> getLikesOfAuthenticatedUser();

    @GET("v1/users/{id}")
    Observable<User> getUser(@Path("id") int id);

    @GET("v1/user/following/{user}")
    Observable<Response<Void>> following(@Path("user") int userId);

    @PUT("v1/users/{user}/follow")
    Observable<Void> follow(@Path("user") int userId);

    @DELETE("v1/users/{user}/follow")
    Observable<Void> unfollow(@Path("user") int userId);

    @GET("v1/users/{id}/shots")
    Observable<List<Shot>> getUserShots(@Path("id") int id,  @Query("page") Integer page, @Query("per_page") Integer pageSize);

    @GET("v1/shots/{id}/comments")
    Observable<List<Comment>> getComments(@Path("id") int id, @Query("page") Integer page, @Query("per_page") Integer pageSize);

    @GET("v1/shots/{id}/like")
    Observable<Like> liked(@Path("id") int shotId);

    @POST("v1/shots/{id}/like")
    Observable<Like> like(@Path("id") int shotId);

    @DELETE("v1/shots/{id}/like")
    Observable<Void> unlike(@Path("id") int shotId);
}

@@ -475,16 +475,46 @@
 tp.GET;%0A
+import retrofit2.http.Header;%0A
 import r
@@ -721,16 +721,58 @@
 e.com/%22;
+%0A    String AUTH_HEADER = %22Authorization%22;
 %0A%0A    @G
@@ -824,16 +824,59 @@
 Popular(
+@Header(AUTH_HEADER) String authorization, 
 @Query(%22
@@ -989,32 +989,73 @@
 thenticatedUser(
+@Header(AUTH_HEADER) String authorization
 );%0A%0A    @GET(%22v1
@@ -1128,16 +1128,57 @@
 tedUser(
+@Header(AUTH_HEADER) String authorization
 );%0A%0A    
@@ -1228,16 +1228,59 @@
 getUser(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22i
@@ -1371,16 +1371,59 @@
 llowing(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22u
@@ -1501,24 +1501,67 @@
 oid%3E follow(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22user%22
@@ -1644,16 +1644,59 @@
 nfollow(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22u
@@ -1787,16 +1787,59 @@
 erShots(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22i
@@ -1996,16 +1996,59 @@
 omments(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22i
@@ -2185,16 +2185,59 @@
 %3E liked(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22i
@@ -2308,24 +2308,67 @@
 %3CLike%3E like(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22id%22) 
@@ -2443,16 +2443,59 @@
  unlike(
+@Header(AUTH_HEADER) String authorization, 
 @Path(%22i

Change the way Retrofit accepts request header because once it has been created, there's no way to change the access token