List of usage examples for com.squareup.okhttp Response newBuilder
public Builder newBuilder()
From source file:eu.operando.core.pdb.client.api.GETApi.java
private com.squareup.okhttp.Call regulationsRegIdGetCall(String regId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/regulations/{reg-id}/".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "reg-id" + "\\}", apiClient.escapeString(regId.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 = { };//from w w w. ja v a2 s . co m final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; 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[] {}; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:eu.operando.core.pdb.client.api.GETApi.java
private com.squareup.okhttp.Call userPrivacyPolicyGetCall(String filter, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/user_privacy_policy/".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (filter != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { };/*from w w w. j a v a2s .c o m*/ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; 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[] {}; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:eu.operando.core.pdb.client.api.GETApi.java
private com.squareup.okhttp.Call userPrivacyPolicyUserIdGetCall(String userId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/user_privacy_policy/{user-id}/".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 = { };/*w w w.j a v a2 s . c o m*/ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; 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[] {}; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:eu.operando.core.pdb.client.api.LegislationApi.java
private com.squareup.okhttp.Call regulationsPostCall(PrivacyRegulationInput regulation, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = regulation; // create path and map variables String localVarPath = "/regulations/".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 = { };// ww w . jav a 2 s. c o m final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; 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[] {}; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:eu.operando.core.pdb.client.api.LegislationApi.java
private com.squareup.okhttp.Call regulationsRegIdPutCall(String regId, PrivacyRegulationInput regulation, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = regulation; // create path and map variables String localVarPath = "/regulations/{reg-id}/".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "reg-id" + "\\}", apiClient.escapeString(regId.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 = { };/*from w w w .j a va 2s .co m*/ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; 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[] {}; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:im.ene.lab.dowy.internal.PartDownloader.java
License:Open Source License
public PartDownloader(OkHttpClient client, Request request, OnProgressListener listener) { this.client = client; this.request = request; this.listener = listener; this.client.networkInterceptors().add(new Interceptor() { @Override/*from ww w.java 2s.c o m*/ public Response intercept(Chain chain) throws IOException { Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), PartDownloader.this.listener)) .build(); } }); }
From source file:io.bouquet.v4.api.AnalyticsApi.java
License:Apache License
private Call postAnalysisCall(AnalyticsQuery body, String REFERENCE, String data, Boolean applyFormatting, String envelope, Integer timeout, String state, 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 postAnalysis(Async)"); }// www. ja v a 2 s .co m // verify the required parameter 'REFERENCE' is set if (REFERENCE == null) { throw new ApiException("Missing the required parameter 'REFERENCE' when calling postAnalysis(Async)"); } // create path and map variables String localVarPath = "/analytics/{REFERENCE}/query".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "REFERENCE" + "\\}", getApiClient().escapeString(REFERENCE.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (data != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "data", data)); if (applyFormatting != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "formatResults", applyFormatting)); if (envelope != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "envelope", envelope)); if (timeout != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "timeout", timeout)); if (state != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "state", state)); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = getApiClient().selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = getApiClient().selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { getApiClient().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[] { "kraken_auth" }; return getApiClient().buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:io.bouquet.v4.api.AnalyticsApi.java
License:Apache License
private Call runAnalysisCall(String REFERENCE, List<String> groupBy, List<String> metrics, List<String> filters, String period, List<String> timeframe, List<String> compareTo, List<String> orderBy, List<String> rollup, Long limit, Long offset, List<String> beyondLimit, Integer maxResults, Integer startIndex, String lazy, String data, Boolean applyFormatting, String style, String envelope, Integer timeout, String state, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'REFERENCE' is set if (REFERENCE == null) { throw new ApiException("Missing the required parameter 'REFERENCE' when calling runAnalysis(Async)"); }/*from ww w.ja v a2 s . co m*/ // create path and map variables String localVarPath = "/analytics/{REFERENCE}/query".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "REFERENCE" + "\\}", getApiClient().escapeString(REFERENCE.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (groupBy != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "groupBy", groupBy)); if (metrics != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "metrics", metrics)); if (filters != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "filters", filters)); if (period != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "period", period)); if (timeframe != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "timeframe", timeframe)); if (compareTo != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "compareTo", compareTo)); if (orderBy != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "orderBy", orderBy)); if (rollup != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "rollup", rollup)); if (limit != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "limit", limit)); if (offset != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "offset", offset)); if (beyondLimit != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "beyondLimit", beyondLimit)); if (maxResults != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "maxResults", maxResults)); if (startIndex != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "startIndex", startIndex)); if (lazy != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "lazy", lazy)); if (data != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "data", data)); if (applyFormatting != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "formatResults", applyFormatting)); if (style != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "style", style)); if (envelope != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "envelope", envelope)); if (timeout != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "timeout", timeout)); if (state != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "state", state)); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = getApiClient().selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = getApiClient().selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { getApiClient().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[] { "kraken_auth" }; return getApiClient().buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:io.bouquet.v4.api.AnalyticsApi.java
License:Apache License
private Call scopeAnalysisCall(String REFERENCE, String value, Integer offset, List<String> types, List<String> values, String style, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'REFERENCE' is set if (REFERENCE == null) { throw new ApiException("Missing the required parameter 'REFERENCE' when calling scopeAnalysis(Async)"); }// w ww. j a va2s . c om // create path and map variables String localVarPath = "/analytics/{REFERENCE}/scope".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "REFERENCE" + "\\}", getApiClient().escapeString(REFERENCE.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (value != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "value", value)); if (offset != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "offset", offset)); if (types != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "types", types)); if (values != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "values", values)); if (style != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "style", style)); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = getApiClient().selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = getApiClient().selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { getApiClient().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[] { "kraken_auth" }; return getApiClient().buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:io.bouquet.v4.api.AnalyticsApi.java
License:Apache License
private Call viewAnalysisCall(String REFERENCE, String x, String y, String color, String size, String column, String row, List<String> groupBy, List<String> metrics, List<String> filters, String period, List<String> timeframe, List<String> compareTo, List<String> orderBy, Long limit, Long offset, List<String> beyondLimit, Integer maxResults, Integer startIndex, String data, String style, String envelope, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'REFERENCE' is set if (REFERENCE == null) { throw new ApiException("Missing the required parameter 'REFERENCE' when calling viewAnalysis(Async)"); }//from w ww. ja va 2 s .com // create path and map variables String localVarPath = "/analytics/{REFERENCE}/view".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "REFERENCE" + "\\}", getApiClient().escapeString(REFERENCE.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (x != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "x", x)); if (y != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "y", y)); if (color != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "color", color)); if (size != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "size", size)); if (column != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "column", column)); if (row != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "row", row)); if (groupBy != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "groupBy", groupBy)); if (metrics != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "metrics", metrics)); if (filters != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "filters", filters)); if (period != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "period", period)); if (timeframe != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "timeframe", timeframe)); if (compareTo != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "compareTo", compareTo)); if (orderBy != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "orderBy", orderBy)); if (limit != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "limit", limit)); if (offset != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "offset", offset)); if (beyondLimit != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("multi", "beyondLimit", beyondLimit)); if (maxResults != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "maxResults", maxResults)); if (startIndex != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "startIndex", startIndex)); if (data != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "data", data)); if (style != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "style", style)); if (envelope != null) localVarQueryParams.addAll(getApiClient().parameterToPairs("", "envelope", envelope)); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = getApiClient().selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { }; final String localVarContentType = getApiClient().selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { getApiClient().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[] { "kraken_auth" }; return getApiClient().buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }