Java tutorial
/** * AS24 API v4.1 * No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v4.1 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package abtlibrary.utils.as24ApiClient.api; import abtlibrary.utils.as24ApiClient.ApiCallback; import abtlibrary.utils.as24ApiClient.ApiClient; import abtlibrary.utils.as24ApiClient.ApiException; import abtlibrary.utils.as24ApiClient.ApiResponse; import abtlibrary.utils.as24ApiClient.Configuration; import abtlibrary.utils.as24ApiClient.Pair; import abtlibrary.utils.as24ApiClient.ProgressRequestBody; import abtlibrary.utils.as24ApiClient.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; import abtlibrary.utils.as24ApiClient.model.ResponseMessageSearchJob; import abtlibrary.utils.as24ApiClient.model.ResponseMessageCollectionListSearchJob; import abtlibrary.utils.as24ApiClient.model.ResponseMessageCollectionListAd; import abtlibrary.utils.as24ApiClient.model.SearchJob; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class SearchJobsApi { private ApiClient apiClient; public SearchJobsApi() { this(Configuration.getDefaultApiClient()); } public SearchJobsApi(ApiClient apiClient) { this.apiClient = apiClient; } public ApiClient getApiClient() { return apiClient; } public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } /* Build call for dELETEpublicV41Searchjobs */ private com.squareup.okhttp.Call dELETEpublicV41SearchjobsCall( final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/public/v4.1/searchjobs".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", "text/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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @return ResponseMessageSearchJob * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageSearchJob dELETEpublicV41Searchjobs() throws ApiException { ApiResponse<ResponseMessageSearchJob> resp = dELETEpublicV41SearchjobsWithHttpInfo(); return resp.getData(); } /** * * * @return ApiResponse<ResponseMessageSearchJob> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageSearchJob> dELETEpublicV41SearchjobsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = dELETEpublicV41SearchjobsCall(null, null); Type localVarReturnType = new TypeToken<ResponseMessageSearchJob>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call dELETEpublicV41SearchjobsAsync( final ApiCallback<ResponseMessageSearchJob> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = dELETEpublicV41SearchjobsCall(progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageSearchJob>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for dELETEpublicV41SearchjobsSearchjobid */ private com.squareup.okhttp.Call dELETEpublicV41SearchjobsSearchjobidCall(Integer searchJobId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'searchJobId' is set if (searchJobId == null) { throw new ApiException( "Missing the required parameter 'searchJobId' when calling dELETEpublicV41SearchjobsSearchjobid(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/searchjobs/{searchJobId}".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "searchJobId" + "\\}", apiClient.escapeString(searchJobId.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", "text/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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @param searchJobId (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public void dELETEpublicV41SearchjobsSearchjobid(Integer searchJobId) throws ApiException { dELETEpublicV41SearchjobsSearchjobidWithHttpInfo(searchJobId); } /** * * * @param searchJobId (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<Void> dELETEpublicV41SearchjobsSearchjobidWithHttpInfo(Integer searchJobId) throws ApiException { com.squareup.okhttp.Call call = dELETEpublicV41SearchjobsSearchjobidCall(searchJobId, null, null); return apiClient.execute(call); } /** * (asynchronously) * * @param searchJobId (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call dELETEpublicV41SearchjobsSearchjobidAsync(Integer searchJobId, final ApiCallback<Void> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = dELETEpublicV41SearchjobsSearchjobidCall(searchJobId, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } /* Build call for gETpublicV41Searchjobs */ private com.squareup.okhttp.Call gETpublicV41SearchjobsCall( final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/public/v4.1/searchjobs".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", "text/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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @return ResponseMessageCollectionListSearchJob * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageCollectionListSearchJob gETpublicV41Searchjobs() throws ApiException { ApiResponse<ResponseMessageCollectionListSearchJob> resp = gETpublicV41SearchjobsWithHttpInfo(); return resp.getData(); } /** * * * @return ApiResponse<ResponseMessageCollectionListSearchJob> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageCollectionListSearchJob> gETpublicV41SearchjobsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = gETpublicV41SearchjobsCall(null, null); Type localVarReturnType = new TypeToken<ResponseMessageCollectionListSearchJob>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call gETpublicV41SearchjobsAsync( final ApiCallback<ResponseMessageCollectionListSearchJob> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = gETpublicV41SearchjobsCall(progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageCollectionListSearchJob>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for gETpublicV41SearchjobsVehicles */ private com.squareup.okhttp.Call gETpublicV41SearchjobsVehiclesCall( final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/public/v4.1/searchjobs/vehicles".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", "text/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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @return ResponseMessageCollectionListAd * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageCollectionListAd gETpublicV41SearchjobsVehicles() throws ApiException { ApiResponse<ResponseMessageCollectionListAd> resp = gETpublicV41SearchjobsVehiclesWithHttpInfo(); return resp.getData(); } /** * * * @return ApiResponse<ResponseMessageCollectionListAd> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageCollectionListAd> gETpublicV41SearchjobsVehiclesWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = gETpublicV41SearchjobsVehiclesCall(null, null); Type localVarReturnType = new TypeToken<ResponseMessageCollectionListAd>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call gETpublicV41SearchjobsVehiclesAsync( final ApiCallback<ResponseMessageCollectionListAd> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = gETpublicV41SearchjobsVehiclesCall(progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageCollectionListAd>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pOSTpublicV41Searchjobs */ private com.squareup.okhttp.Call pOSTpublicV41SearchjobsCall(SearchJob searchJob, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = searchJob; // verify the required parameter 'searchJob' is set if (searchJob == null) { throw new ApiException( "Missing the required parameter 'searchJob' when calling pOSTpublicV41Searchjobs(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/searchjobs".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", "text/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json", "text/json", "application/x-www-form-urlencoded" }; 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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @param searchJob (required) * @return ResponseMessageSearchJob * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageSearchJob pOSTpublicV41Searchjobs(SearchJob searchJob) throws ApiException { ApiResponse<ResponseMessageSearchJob> resp = pOSTpublicV41SearchjobsWithHttpInfo(searchJob); return resp.getData(); } /** * * * @param searchJob (required) * @return ApiResponse<ResponseMessageSearchJob> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageSearchJob> pOSTpublicV41SearchjobsWithHttpInfo(SearchJob searchJob) throws ApiException { com.squareup.okhttp.Call call = pOSTpublicV41SearchjobsCall(searchJob, null, null); Type localVarReturnType = new TypeToken<ResponseMessageSearchJob>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param searchJob (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call pOSTpublicV41SearchjobsAsync(SearchJob searchJob, final ApiCallback<ResponseMessageSearchJob> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = pOSTpublicV41SearchjobsCall(searchJob, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageSearchJob>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41SearchjobsExtend */ private com.squareup.okhttp.Call pUTpublicV41SearchjobsExtendCall(List<Integer> searchJobIds, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = searchJobIds; // verify the required parameter 'searchJobIds' is set if (searchJobIds == null) { throw new ApiException( "Missing the required parameter 'searchJobIds' when calling pUTpublicV41SearchjobsExtend(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/searchjobs/extend".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", "text/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json", "text/json", "application/x-www-form-urlencoded" }; 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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @param searchJobIds (required) * @return ResponseMessageCollectionListSearchJob * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageCollectionListSearchJob pUTpublicV41SearchjobsExtend(List<Integer> searchJobIds) throws ApiException { ApiResponse<ResponseMessageCollectionListSearchJob> resp = pUTpublicV41SearchjobsExtendWithHttpInfo( searchJobIds); return resp.getData(); } /** * * * @param searchJobIds (required) * @return ApiResponse<ResponseMessageCollectionListSearchJob> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageCollectionListSearchJob> pUTpublicV41SearchjobsExtendWithHttpInfo( List<Integer> searchJobIds) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41SearchjobsExtendCall(searchJobIds, null, null); Type localVarReturnType = new TypeToken<ResponseMessageCollectionListSearchJob>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param searchJobIds (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call pUTpublicV41SearchjobsExtendAsync(List<Integer> searchJobIds, final ApiCallback<ResponseMessageCollectionListSearchJob> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = pUTpublicV41SearchjobsExtendCall(searchJobIds, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageCollectionListSearchJob>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41SearchjobsSearchjobidExtend */ private com.squareup.okhttp.Call pUTpublicV41SearchjobsSearchjobidExtendCall(Integer searchJobId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'searchJobId' is set if (searchJobId == null) { throw new ApiException( "Missing the required parameter 'searchJobId' when calling pUTpublicV41SearchjobsSearchjobidExtend(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/searchjobs/{searchJobId}/extend".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "searchJobId" + "\\}", apiClient.escapeString(searchJobId.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", "text/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[] { "oauth2" }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @param searchJobId (required) * @return ResponseMessageSearchJob * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageSearchJob pUTpublicV41SearchjobsSearchjobidExtend(Integer searchJobId) throws ApiException { ApiResponse<ResponseMessageSearchJob> resp = pUTpublicV41SearchjobsSearchjobidExtendWithHttpInfo( searchJobId); return resp.getData(); } /** * * * @param searchJobId (required) * @return ApiResponse<ResponseMessageSearchJob> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageSearchJob> pUTpublicV41SearchjobsSearchjobidExtendWithHttpInfo( Integer searchJobId) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41SearchjobsSearchjobidExtendCall(searchJobId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageSearchJob>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param searchJobId (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call pUTpublicV41SearchjobsSearchjobidExtendAsync(Integer searchJobId, final ApiCallback<ResponseMessageSearchJob> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = pUTpublicV41SearchjobsSearchjobidExtendCall(searchJobId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageSearchJob>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } }