<commit_before>package org.vasttrafik.wso2.carbon.identity.api;

import org.vasttrafik.wso2.carbon.identity.api.beans.*;
import org.vasttrafik.wso2.carbon.identity.api.impl.UsersApiServiceImpl;
import org.vasttrafik.wso2.carbon.identity.api.utils.IdentityResourceBundleAware;
import org.vasttrafik.wso2.carbon.common.api.utils.ResponseUtils;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.*;

/**
 * 
 * @author <NAME>, Vsttrafik 2015
 *
 */
@Path("/users")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON  })
public class Users implements IdentityResourceBundleAware {

   private final UsersApiServiceImpl delegate = new UsersApiServiceImpl();

    @PUT
    public Response confirmUserRegistration(
    		@HeaderParam("Accept") String accept, 
    		@HeaderParam("Content-Type") String contentType, 
    		UserConfirmation confirmation)
    	throws BadRequestException, InternalServerErrorException, NotFoundException
    {
    	ResponseUtils.checkParameter(
    			resourceBundle,
    			"username", 
    			true, 
    			new String[]{}, 
    			confirmation.getUsername());
    	
        return delegate.confirmUserRegistration(confirmation);
    }
	
    @POST
    public Response registerUser(
    		@HeaderParam("Accept") String accept, 
    		@HeaderParam("Content-Type") String contentType, 
    		User user)
    	throws BadRequestException, InternalServerErrorException
    {
    	ResponseUtils.checkParameter(
    			resourceBundle,
    			"username", 
    			true, 
    			new String[]{}, 
    			user.getUserName());
    	
        return delegate.registerUser(user);
    }
	
    @GET
    @Path("/{userId}")
    public Response getUser(
    		@PathParam("userId") Integer userId,
    		@HeaderParam("Accept") String accept,
    		@HeaderParam("Authorization") String authorization,
    		@HeaderParam("If-None-Match") String ifNoneMatch, 
    		@HeaderParam("If-Modified-Since") String ifModifiedSince)
    	throws InternalServerErrorException, NotAuthorizedException, NotFoundException
    {
    	return delegate.getUser(userId, authorization, ifNoneMatch, ifModifiedSince);
    }
	
    @PUT
    @Path("/{userId}")
    public Response updateUser(
    		@PathParam("userId") Integer userId, 
    		@QueryParam("action") String action, 
    		@HeaderParam("Accept") String accept,
    		@HeaderParam("Authorization") String authorization,
    		@HeaderParam("Content-Type") String contentType, 
    		User user)
    	throws BadRequestException,  InternalServerErrorException, NotAuthorizedException, NotFoundException
    {
    	ResponseUtils.checkParameter(<commit_msg>Removed http-headers.<commit_after>package org.vasttrafik.wso2.carbon.identity.api;

import org.vasttrafik.wso2.carbon.identity.api.beans.*;
import org.vasttrafik.wso2.carbon.identity.api.impl.UsersApiServiceImpl;
import org.vasttrafik.wso2.carbon.identity.api.utils.IdentityResourceBundleAware;
import org.vasttrafik.wso2.carbon.common.api.utils.ResponseUtils;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.*;

/**
 * 
 * @author <NAME>, Vsttrafik 2015
 *
 */
@Path("/users")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON  })
public class Users implements IdentityResourceBundleAware {

	private final UsersApiServiceImpl delegate = new UsersApiServiceImpl();

    @PUT
    public Response confirmUserRegistration(
    		@HeaderParam("Accept") String accept, 
    		@HeaderParam("Content-Type") String contentType, 
    		UserConfirmation confirmation)
    	throws BadRequestException, InternalServerErrorException, NotFoundException
    {
    	ResponseUtils.checkParameter(
    			resourceBundle,
    			"username", 
    			true, 
    			new String[]{}, 
    			confirmation.getUsername());
    	
        return delegate.confirmUserRegistration(confirmation);
    }
	
    @POST
    public Response registerUser(
    		@HeaderParam("Accept") String accept, 
    		@HeaderParam("Content-Type") String contentType, 
    		User user)
    	throws BadRequestException, InternalServerErrorException
    {
    	ResponseUtils.checkParameter(
    			resourceBundle,
    			"username", 
    			true, 
    			new String[]{}, 
    			user.getUserName());
    	
        return delegate.registerUser(user);
    }
	
    @GET
    @Path("/{userId}")
    public Response getUser(
    		@PathParam("userId") Integer userId,
    		@HeaderParam("Accept") String accept,
    		@HeaderParam("Authorization") String authorization)
    	throws InternalServerErrorException, NotAuthorizedException, NotFoundException
    {
		return delegate.getUser(userId, authorization);
    }
	
    @PUT
    @Path("/{userId}")
    public Response updateUser(
    		@PathParam("userId") Integer userId, 
    		@QueryParam("action") String action, 
    		@HeaderParam("Accept") String accept,
    		@HeaderParam("Authorization") String authorization,
    		@HeaderParam("Content-Type") String contentType, 
    		User user)
    	throws BadRequestException,  InternalServerErrorException, NotAuthorizedException, NotFoundException
    {
    	ResponseUtils.checkParameter(
{'fraction_non_alphanumeric': 0.10383572258814414, 'fraction_numerical': 0.003487020534676482, 'mean_word_length': 3.6681735985533455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5452602', 'n_tokens_mistral': 1598, 'n_tokens_neox': 1516, 'n_words': 276}