package com.hubspot.singularity.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.hubspot.singularity.SingularityService;
import com.hubspot.singularity.SingularityUserSettings;
import com.hubspot.singularity.data.UserManager;
import com.wordnik.swagger.annotations.ApiParam;

@Path(UserResource.PATH)
@Produces({ MediaType.APPLICATION_JSON })
public class UserResource {
  public static final String PATH = SingularityService.API_BASE_PATH + "/user";

  private final UserManager userManager;

  @Inject
  public UserResource(UserManager userManager) {
    this.userManager = userManager;
  }

  @GET
  @Path("/settings")
  public Optional<SingularityUserSettings> getUserSettings(
      @ApiParam("The user id to use") @PathParam("id") String id) {
    return userManager.getUserSettings(id);
  }
}

@@ -52,18 +52,66 @@
 java
-x.ws.rs.GE
+.util.Set;%0A%0Aimport javax.ws.rs.GET;%0Aimport javax.ws.rs.POS
 T;%0Ai
@@ -1029,11 +1029,322 @@
 id);%0A  %7D
+%0A%0A  @POST%0A  @Path(%22/settings%22)%0A  public void setUserSettings(%0A      @ApiParam(%22The user id to use%22) @PathParam(%22id%22) String id,%0A      @ApiParam(%22The new settings%22) @PathParam(%22settings%22) Set%3CString%3E starredRequestIds) %7B%0A    userManager.updateUserSettings(id, new SingularityUserSettings(starredRequestIds));%0A  %7D
 %0A%7D%0A

Add setUserSettings