package com.example.tampopo_client.resources;

import com.example.tampopo_client.models.Activity;

import java.util.HashMap;
import java.util.List;

import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ActivitiesResource {
    @GET("users/{user_id}/activities")
    Call<HashMap<String, Activity>> getActivities(@Path("user_id") String userId, @Query("filter") String filter);

    @POST("users/{user_id}/activities")
    @FormUrlEncoded
    Call<String> addActivity(@Path("user_id") String userId, @Field("token") String token, @Field("new-activity") String newActivity); // FIXME: We need to rename new-activity to new_activity

    @GET("users/{user_id}/activities/{activity_id}")
    Call<Activity> getActivity(@Path("user_id") String userId, @Path("activity_id") String activityId);

    @DELETE("users/{user_id}/activities/{activity_id}")
    Call<Activity> deleteActivity(@Path("user_id") String userId, @Path("activity_id") String activityId, @Query("token") String token);

    @GET("users/{user_id}/activities/{activity_id}/text")
    Call<String> getText(@Path("user_id") String userId, @Path("activity_id") String activityId);

    @GET("users/{user_id}/activities/{activity_id}/updated-time")
    Call<String> getUpdatedTime(@Path("user_id") String userId, @Path("activity_id") String activityId);

    @GET("users/{user_id}/activities/last-updated-time")
    Call<String> getLastUpdatedTime(@Path("user_id") String userId, @Path("activity_id") String activityId);
}
