List of usage examples for com.squareup.okhttp Response newBuilder
public Builder newBuilder()
From source file:cloud.artik.api.ExportApi.java
License:Apache License
private com.squareup.okhttp.Call exportRequestCall(ExportRequestInfo exportRequestInfo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = exportRequestInfo; // verify the required parameter 'exportRequestInfo' is set if (exportRequestInfo == null) { throw new ApiException( "Missing the required parameter 'exportRequestInfo' when calling exportRequest(Async)"); }// ww w . j ava 2 s. c o m // create path and map variables String localVarPath = "/messages/export".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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.ExportApi.java
License:Apache License
private com.squareup.okhttp.Call getExportHistoryCall(String trialId, Integer count, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/messages/export/history".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (trialId != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "trialId", trialId)); if (count != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "count", count)); if (offset != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); 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 = { };/*from w w w. j av a 2s.c om*/ 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.ExportApi.java
License:Apache License
private com.squareup.okhttp.Call getExportResultCall(String exportId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'exportId' is set if (exportId == null) { throw new ApiException("Missing the required parameter 'exportId' when calling getExportResult(Async)"); }/*from ww w .ja v a 2s . co m*/ // create path and map variables String localVarPath = "/messages/export/{exportId}/result".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "exportId" + "\\}", apiClient.escapeString(exportId.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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.ExportApi.java
License:Apache License
private com.squareup.okhttp.Call getExportStatusCall(String exportId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'exportId' is set if (exportId == null) { throw new ApiException("Missing the required parameter 'exportId' when calling getExportStatus(Async)"); }/*from w w w .ja va2s . c o m*/ // create path and map variables String localVarPath = "/messages/export/{exportId}/status".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "exportId" + "\\}", apiClient.escapeString(exportId.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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.MessagesApi.java
License:Apache License
private com.squareup.okhttp.Call getAggregatesHistogramCall(Long startDate, Long endDate, String sdid, String field, String interval, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'startDate' is set if (startDate == null) { throw new ApiException( "Missing the required parameter 'startDate' when calling getAggregatesHistogram(Async)"); }/*from w ww. j a v a 2 s . c o m*/ // verify the required parameter 'endDate' is set if (endDate == null) { throw new ApiException( "Missing the required parameter 'endDate' when calling getAggregatesHistogram(Async)"); } // create path and map variables String localVarPath = "/messages/analytics/histogram".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (startDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "startDate", startDate)); if (endDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "endDate", endDate)); if (sdid != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdid", sdid)); if (field != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "field", field)); if (interval != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "interval", interval)); 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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.MessagesApi.java
License:Apache License
private com.squareup.okhttp.Call getFieldPresenceCall(Long startDate, Long endDate, String interval, String sdid, String fieldPresence, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'startDate' is set if (startDate == null) { throw new ApiException( "Missing the required parameter 'startDate' when calling getFieldPresence(Async)"); }/* w w w . j ava 2 s. co m*/ // verify the required parameter 'endDate' is set if (endDate == null) { throw new ApiException("Missing the required parameter 'endDate' when calling getFieldPresence(Async)"); } // verify the required parameter 'interval' is set if (interval == null) { throw new ApiException( "Missing the required parameter 'interval' when calling getFieldPresence(Async)"); } // create path and map variables String localVarPath = "/messages/presence".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (sdid != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdid", sdid)); if (fieldPresence != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "fieldPresence", fieldPresence)); if (startDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "startDate", startDate)); if (endDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "endDate", endDate)); if (interval != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "interval", interval)); 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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.MessagesApi.java
License:Apache License
private com.squareup.okhttp.Call getLastNormalizedMessagesCall(Integer count, String sdids, String fieldPresence, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/messages/last".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (count != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "count", count)); if (sdids != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdids", sdids)); if (fieldPresence != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "fieldPresence", fieldPresence)); 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 = { };//from w ww. ja v a2 s .c o m 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.MessagesApi.java
License:Apache License
private com.squareup.okhttp.Call getMessageAggregatesCall(String sdid, String field, Long startDate, Long endDate, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'sdid' is set if (sdid == null) { throw new ApiException( "Missing the required parameter 'sdid' when calling getMessageAggregates(Async)"); }/*from ww w .ja v a 2s. c om*/ // verify the required parameter 'field' is set if (field == null) { throw new ApiException( "Missing the required parameter 'field' when calling getMessageAggregates(Async)"); } // verify the required parameter 'startDate' is set if (startDate == null) { throw new ApiException( "Missing the required parameter 'startDate' when calling getMessageAggregates(Async)"); } // verify the required parameter 'endDate' is set if (endDate == null) { throw new ApiException( "Missing the required parameter 'endDate' when calling getMessageAggregates(Async)"); } // create path and map variables String localVarPath = "/messages/analytics/aggregates".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (sdid != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdid", sdid)); if (field != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "field", field)); if (startDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "startDate", startDate)); if (endDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "endDate", endDate)); 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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.MessagesApi.java
License:Apache License
private com.squareup.okhttp.Call getMessageSnapshotsCall(String sdids, Boolean includeTimestamp, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'sdids' is set if (sdids == null) { throw new ApiException( "Missing the required parameter 'sdids' when calling getMessageSnapshots(Async)"); }//from w w w . ja va2 s . com // create path and map variables String localVarPath = "/messages/snapshots".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (sdids != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdids", sdids)); if (includeTimestamp != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "includeTimestamp", includeTimestamp)); 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 = { }; 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }
From source file:cloud.artik.api.MessagesApi.java
License:Apache License
private com.squareup.okhttp.Call getNormalizedActionsCall(String uid, String ddid, String mid, String offset, Integer count, Long startDate, Long endDate, String order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/actions".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (uid != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "uid", uid)); if (ddid != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "ddid", ddid)); if (mid != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "mid", mid)); if (offset != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); if (count != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "count", count)); if (startDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "startDate", startDate)); if (endDate != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "endDate", endDate)); if (order != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "order", order)); 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 = { };/*from w w w . j ava 2 s. com*/ 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[] { "artikcloud_oauth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); }