package org.ntlab.acanthus_client.resources.gallery;

import org.ntlab.acanthus_client.entities.Account;

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

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

    @GET("gallery/{aid}/invites")
    Call<Collection<Account>> isGalleryInvites(
            @Path("aid") Integer aid,
            @Query("invited") String invitedUid,
            @Query("invitedUserToken") String invitedUserToken,
            @Query("ownerToken") String ownerToken
    );

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

    @FormUrlEncoded
    @PUT("gallery/{aid}/invites")
    Call<String> addInvite(
            @Path("aid") Integer aid,
            @Field("ownerUid") String ownerUid,
            @Field("invitedUid") String invitedUid,
            @Field("ownerToken") String ownerToken
    );

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

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

    //-----------------------------------------------------------------
}
