List of usage examples for com.squareup.okhttp Response newBuilder
public Builder newBuilder()
From source file:co.uk.crowdemotion.UserApi.java
License:Apache License
private com.squareup.okhttp.Call userIdGetCall(Integer id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling userIdGet(Async)"); }//from w w w. ja v a 2 s .c o m // create path and map variables String localVarPath = "/user/{id}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:co.uk.crowdemotion.UserApi.java
License:Apache License
private com.squareup.okhttp.Call userIdPutCall(String id, UserUpdateBody body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling userIdPut(Async)"); }//from www . ja va 2s . c om // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling userIdPut(Async)"); } // create path and map variables String localVarPath = "/user/{id}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:co.uk.crowdemotion.UserApi.java
License:Apache License
private com.squareup.okhttp.Call userLoginPostCall(Login body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling userLoginPost(Async)"); }/*from w w w . j av a 2 s . c o m*/ // create path and map variables String localVarPath = "/user/login".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:co.uk.crowdemotion.UserApi.java
License:Apache License
private com.squareup.okhttp.Call userUserIdMetadataGetCall(Integer userId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException( "Missing the required parameter 'userId' when calling userUserIdMetadataGet(Async)"); }/* w ww.j ava2 s . c om*/ // create path and map variables String localVarPath = "/user/{user_id}/metadata".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:co.uk.crowdemotion.UserApi.java
License:Apache License
private com.squareup.okhttp.Call userUserIdMetadataPostCall(Integer userId, UserMetadata body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException( "Missing the required parameter 'userId' when calling userUserIdMetadataPost(Async)"); }//from w ww . java 2 s. c o m // verify the required parameter 'body' is set if (body == null) { throw new ApiException( "Missing the required parameter 'body' when calling userUserIdMetadataPost(Async)"); } // create path and map variables String localVarPath = "/user/{user_id}/metadata".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:co.waitlisted.api.ReservationApi.java
License:Apache License
private com.squareup.okhttp.Call activateReservationCall(ReservationRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object wllocalVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling activateReservation(Async)"); }/*from w w w .j a v a2 s. com*/ // create path and map variables String wllocalVarPath = "/reservations/activate".replaceAll("\\{format\\}", "json"); List<Pair> wllocalVarQueryParams = new ArrayList<Pair>(); Map<String, String> wllocalVarHeaderParams = new HashMap<String, String>(); Map<String, Object> wllocalVarFormParams = new HashMap<String, Object>(); final String[] wllocalVarAccepts = { "application/json" }; final String wllocalVarAccept = wlapiClient.selectHeaderAccept(wllocalVarAccepts); if (wllocalVarAccept != null) wllocalVarHeaderParams.put("Accept", wllocalVarAccept); final String[] wllocalVarContentTypes = { "application/json" }; final String wllocalVarContentType = wlapiClient.selectHeaderContentType(wllocalVarContentTypes); wllocalVarHeaderParams.put("Content-Type", wllocalVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] wllocalVarAuthNames = new String[] { "api_key" }; return wlapiClient.buildCall(wllocalVarPath, "POST", wllocalVarQueryParams, wllocalVarPostBody, wllocalVarHeaderParams, wllocalVarFormParams, wllocalVarAuthNames, progressRequestListener); }
From source file:co.waitlisted.api.ReservationApi.java
License:Apache License
private com.squareup.okhttp.Call createReservationCall(Reservation body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object wllocalVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createReservation(Async)"); }/* www. j ava 2 s.c om*/ // create path and map variables String wllocalVarPath = "/reservations".replaceAll("\\{format\\}", "json"); List<Pair> wllocalVarQueryParams = new ArrayList<Pair>(); Map<String, String> wllocalVarHeaderParams = new HashMap<String, String>(); Map<String, Object> wllocalVarFormParams = new HashMap<String, Object>(); final String[] wllocalVarAccepts = { "application/json" }; final String wllocalVarAccept = wlapiClient.selectHeaderAccept(wllocalVarAccepts); if (wllocalVarAccept != null) wllocalVarHeaderParams.put("Accept", wllocalVarAccept); final String[] wllocalVarContentTypes = { "application/json" }; final String wllocalVarContentType = wlapiClient.selectHeaderContentType(wllocalVarContentTypes); wllocalVarHeaderParams.put("Content-Type", wllocalVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] wllocalVarAuthNames = new String[] {}; return wlapiClient.buildCall(wllocalVarPath, "POST", wllocalVarQueryParams, wllocalVarPostBody, wllocalVarHeaderParams, wllocalVarFormParams, wllocalVarAuthNames, progressRequestListener); }
From source file:co.waitlisted.api.ReservationApi.java
License:Apache License
private com.squareup.okhttp.Call deleteReservationCall(ReservationRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object wllocalVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling deleteReservation(Async)"); }/*from w w w . j a va2 s.c om*/ // create path and map variables String wllocalVarPath = "/reservations".replaceAll("\\{format\\}", "json"); List<Pair> wllocalVarQueryParams = new ArrayList<Pair>(); Map<String, String> wllocalVarHeaderParams = new HashMap<String, String>(); Map<String, Object> wllocalVarFormParams = new HashMap<String, Object>(); final String[] wllocalVarAccepts = { "application/json" }; final String wllocalVarAccept = wlapiClient.selectHeaderAccept(wllocalVarAccepts); if (wllocalVarAccept != null) wllocalVarHeaderParams.put("Accept", wllocalVarAccept); final String[] wllocalVarContentTypes = { "application/json" }; final String wllocalVarContentType = wlapiClient.selectHeaderContentType(wllocalVarContentTypes); wllocalVarHeaderParams.put("Content-Type", wllocalVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] wllocalVarAuthNames = new String[] { "api_key" }; return wlapiClient.buildCall(wllocalVarPath, "DELETE", wllocalVarQueryParams, wllocalVarPostBody, wllocalVarHeaderParams, wllocalVarFormParams, wllocalVarAuthNames, progressRequestListener); }
From source file:co.waitlisted.api.ReservationApi.java
License:Apache License
private com.squareup.okhttp.Call getReservationCall(String email, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object wllocalVarPostBody = null; // verify the required parameter 'email' is set if (email == null) { throw new ApiException("Missing the required parameter 'email' when calling getReservation(Async)"); }//ww w . j a v a 2s. c om // create path and map variables String wllocalVarPath = "/reservations".replaceAll("\\{format\\}", "json"); List<Pair> wllocalVarQueryParams = new ArrayList<Pair>(); if (email != null) wllocalVarQueryParams.addAll(wlapiClient.parameterToPairs("", "email", email)); Map<String, String> wllocalVarHeaderParams = new HashMap<String, String>(); Map<String, Object> wllocalVarFormParams = new HashMap<String, Object>(); final String[] wllocalVarAccepts = { "application/json" }; final String wllocalVarAccept = wlapiClient.selectHeaderAccept(wllocalVarAccepts); if (wllocalVarAccept != null) wllocalVarHeaderParams.put("Accept", wllocalVarAccept); final String[] wllocalVarContentTypes = { "application/json" }; final String wllocalVarContentType = wlapiClient.selectHeaderContentType(wllocalVarContentTypes); wllocalVarHeaderParams.put("Content-Type", wllocalVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] wllocalVarAuthNames = new String[] {}; return wlapiClient.buildCall(wllocalVarPath, "GET", wllocalVarQueryParams, wllocalVarPostBody, wllocalVarHeaderParams, wllocalVarFormParams, wllocalVarAuthNames, progressRequestListener); }
From source file:co.waitlisted.api.SiteApi.java
License:Apache License
private com.squareup.okhttp.Call getSiteCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object wllocalVarPostBody = null; // create path and map variables String wllocalVarPath = "/site".replaceAll("\\{format\\}", "json"); List<Pair> wllocalVarQueryParams = new ArrayList<Pair>(); Map<String, String> wllocalVarHeaderParams = new HashMap<String, String>(); Map<String, Object> wllocalVarFormParams = new HashMap<String, Object>(); final String[] wllocalVarAccepts = { "application/json" }; final String wllocalVarAccept = wlapiClient.selectHeaderAccept(wllocalVarAccepts); if (wllocalVarAccept != null) wllocalVarHeaderParams.put("Accept", wllocalVarAccept); final String[] wllocalVarContentTypes = { "application/json" }; final String wllocalVarContentType = wlapiClient.selectHeaderContentType(wllocalVarContentTypes); wllocalVarHeaderParams.put("Content-Type", wllocalVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override//from w w w .j a v a 2 s.c o m public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] wllocalVarAuthNames = new String[] {}; return wlapiClient.buildCall(wllocalVarPath, "GET", wllocalVarQueryParams, wllocalVarPostBody, wllocalVarHeaderParams, wllocalVarFormParams, wllocalVarAuthNames, progressRequestListener); }