package org.kramerlab.seitan.api.services;

import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.kramerlab.seitan.api.exceptions.SEITANException;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;

import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import java.io.IOException;

@Service
public interface GroupIDService extends SEITANService {

    @GET
    @Produces({MediaType.APPLICATION_JSON})
    public String getGroup(@Context UriInfo uri,
                           @QueryParam("modal") String modal);

    @POST
    public void updateGroup(@Context UriInfo uri,
                            @FormParam("name") String newName,
                            @FormParam("description") String newDescription,
                            @FormParam("owner") String newOwner,
                            @FormParam("addReader") String newReader,
                            @FormParam("addWriter") String newWriter,
                            @FormParam("rmReader") String rmReader,
                            @FormParam("rmWriter") String rmWriter,
                            @Multipart(value = "isDelete", required = false)
                            String isDelete)
            throws SEITANException, IOException;

    @DELETE
    public void deleteGroup(@Context UriInfo uri) throws SEITANException, IOException;

}
