package org.ntlab.acanthus_client.resources.accounts;

import java.util.Collection;

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

public interface InvitedRest {
    //-----------------------------------------------------------------

    @GET("accounts/{uid}/invited")
    Call<Boolean> checkAccountInvited(
            @Path("uid") Integer ownerUid,
            @Query("aid") Integer aid
    );

    //-----------------------------------------------------------------

    @GET("accounts/{uid}/invited")
    Call<Collection<Integer>> getAccountInvited(
            @Path("uid") Integer ownerUid,
            @Query("token") Integer token
    );

    //-----------------------------------------------------------------

    @FormUrlEncoded
    @PUT("accounts/{uid}/invited")
    Call addAccountInvited(
            @Path("uid") Integer invitedUid,
            @Field("ownerUid") Integer ownerUid,
            @Field("ownerToken") String ownerToken,
            @Field("aid") Integer aid
    );

    //-----------------------------------------------------------------

    @FormUrlEncoded
    @DELETE("accounts/{uid}/invited")
    Call<String> deleteInvite(
            @Path("uid") Integer invitedUid,
            @Field("invitedToken") String invitedToken,
            @Field("aid") Integer aid
    );

}
