/**
 * *************************************************
 * Projekt: hipchat-api2
 * <p/>
 * Autor: Paweł Woźniak
 * <p/>
 * Data utworzenia: 2015-08-16
 * *************************************************
 */
package pl.ppwozniak.hipchat.api2.request.users;

import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.request.HttpRequest;
import pl.ppwozniak.hipchat.api2.common.ApiData;
import pl.ppwozniak.hipchat.api2.common.ApiRequest;

/**
 * @author wp
 */
public class GetAllUsersRequest implements ApiRequest {

    private static final String URL = "user";

    private int type;

    private int startIndex;

    private int maxResult;

    private boolean includeGuests;

    private boolean includeDeleted;

    private GetAllUsersRequest(int type, int startIndex, int maxResult, boolean includeGuests, boolean includeDeleted) {
        this.type = type;
        this.startIndex = startIndex;
        this.maxResult = maxResult;
        this.includeGuests = includeGuests;
        this.includeDeleted = includeDeleted;
    }

    public GetAllUsersRequest() {
        this(0, 0, 0, false, false);
    }

    @Override
    public HttpRequest getRequest(String token) {
        HttpRequest request;
        if (type == 0) {
            request = Unirest.get(ApiData.URL + URL).queryString(ApiData.TOKEN_PARAM_NAME, token);
        } else {
            request = null;
        }

        return request;
    }
}

@@ -574,31 +574,8 @@
 %22;%0A%0A
-    private int type;%0A%0A
     
@@ -598,16 +598,16 @@
 tIndex;%0A
+
 %0A    pri
@@ -739,18 +739,8 @@
 int 
-type, int 
 star
@@ -815,34 +815,8 @@
 ) %7B%0A
-        this.type = type;%0A
     
@@ -1032,19 +1032,18 @@
 this(0, 
+1
 0
-, 
 0, false
@@ -1135,75 +1135,14 @@
     
-HttpRequest request;%0A        if (type == 0) %7B%0A            request =
+return
  Uni
@@ -1168,16 +1168,33 @@
 L + URL)
+%0A                
 .querySt
@@ -1230,26 +1230,30 @@
 , token)
-;
 %0A
+     
         
 %7D else %7B
@@ -1248,44 +1248,167 @@
     
-%7D else %7B%0A            request = null;
+   .queryString(%22start-index%22, startIndex)%0A                .queryString(%22max-results%22, maxResult)%0A                .queryString(%22include-guests%22, includeGuests)
 %0A   
@@ -1416,19 +1416,16 @@
     
-%7D%0A%0A
         
 retu
@@ -1424,22 +1424,55 @@
     
-return request
+.queryString(%22include-deleted%22, includeDeleted)
 ;%0A  

Change GetAllUserRequest (modifying request parameters)