package com.example.tampopo_client.resources;


import com.example.tampopo_client.models.FriendRequest;

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 FriendRequestsResource {

    //このAPIではリクエストのボディをx-www-form-urlencoded という形式で送ります
    @FormUrlEncoded
    @POST("friend-requests")
    Call<String> postFriendRequest(
            @Field("sender-id") String senderId,
            @Field("receiver-id") String receiverId,
            @Field("token") String token
    );

    @GET("friend-requests")
    Call<List<FriendRequest>> getFriendRequests(
            @Query("token") String token
    );

    @DELETE("friend-requests/{friend-request-id}")
    Call<Void> deleteFriendRequest(
            @Path("friend-request-id") String friendRequestId,
            @Query("token") String token
    );
}