package com.fastaccess.data.service; import androidx.annotation.NonNull; import com.fastaccess.data.dao.Pageable; import com.fastaccess.data.dao.model.Event; import com.fastaccess.data.dao.model.Login; import com.fastaccess.data.dao.model.Repo; import com.fastaccess.data.dao.model.User; import java.util.Map; import io.reactivex.Observable; import retrofit2.Response; import retrofit2.http.DELETE; import retrofit2.http.GET; import retrofit2.http.Headers; import retrofit2.http.PUT; import retrofit2.http.Path; import retrofit2.http.Query; import retrofit2.http.QueryMap; import retrofit2.http.Url; /** * Created by Kosh on 08 Feb 2017, 8:54 PM */ public interface UserRestService { @GET("user") Observable getUser(); @GET("users/{username}") Observable getUser(@Path("username") @NonNull String username); @GET("users/{username}/received_events") Observable> getReceivedEvents(@NonNull @Path("username") String userName, @Query("page") int page); @GET("users/{username}/events") Observable> getUserEvents(@NonNull @Path("username") String userName, @Query("page") int page); @GET("users/{username}/repos") Observable> getRepos(@Path("username") @NonNull String username, @QueryMap(encoded = true) Map filterParams, @Query("page") int page); @GET("user/repos") Observable> getRepos(@QueryMap(encoded = true) Map filterParams, @Query(value = "page") int page); @GET("users/{username}/starred") Observable> getStarred(@Path("username") @NonNull String username, @Query("page") int page); @GET("users/{username}/starred?per_page=1") Observable> getStarredCount(@Path("username") @NonNull String username); @GET("users/{username}/following") Observable> getFollowing(@Path("username") @NonNull String username, @Query("page") int page); @GET("users/{username}/followers") Observable> getFollowers(@Path("username") @NonNull String username, @Query("page") int page); @GET("user/following/{username}") Observable> getFollowStatus(@Path("username") @NonNull String username); @PUT("user/following/{username}") Observable> followUser(@Path("username") @NonNull String username); @DELETE("user/following/{username}") Observable> unfollowUser(@Path("username") @NonNull String username); @GET Observable getContributions(@Url String url); @GET("user/blocks/{username}") @Headers("Accept: application/vnd.github.giant-sentry-fist-preview+json") Observable> isUserBlocked(@Path("username") @NonNull String username); @PUT("user/blocks/{username}") @Headers("Accept: application/vnd.github.giant-sentry-fist-preview+json") Observable> blockUser(@Path("username") @NonNull String username); @DELETE("user/blocks/{username}") @Headers("Accept: application/vnd.github.giant-sentry-fist-preview+json") Observable> unBlockUser(@Path("username") @NonNull String username); }