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.ResponseMessageBoolean; import abtlibrary.utils.as24ApiClient.model.ResponseMessageMyListingVehicleReadOnly; import abtlibrary.utils.as24ApiClient.model.ResponseMessageCount; import abtlibrary.utils.as24ApiClient.model.ResponseMessageCollectionMyListingVehicle; import abtlibrary.utils.as24ApiClient.model.ResponseMessageListMyListingVehicleStatus; import abtlibrary.utils.as24ApiClient.model.MyListingVehicle; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class MyListingApi { private ApiClient apiClient; public MyListingApi() { this(Configuration.getDefaultApiClient()); } public MyListingApi(ApiClient apiClient) { this.apiClient = apiClient; } public ApiClient getApiClient() { return apiClient; } public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } /* Build call for dELETEpublicV41MylistingVehiclesVehicleid */ private com.squareup.okhttp.Call dELETEpublicV41MylistingVehiclesVehicleidCall(Integer vehicleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling dELETEpublicV41MylistingVehiclesVehicleid(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 vehicleId (required) * @return ResponseMessageBoolean * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageBoolean dELETEpublicV41MylistingVehiclesVehicleid(Integer vehicleId) throws ApiException { ApiResponse<ResponseMessageBoolean> resp = dELETEpublicV41MylistingVehiclesVehicleidWithHttpInfo(vehicleId); return resp.getData(); } /** * * * @param vehicleId (required) * @return ApiResponse<ResponseMessageBoolean> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageBoolean> dELETEpublicV41MylistingVehiclesVehicleidWithHttpInfo( Integer vehicleId) throws ApiException { com.squareup.okhttp.Call call = dELETEpublicV41MylistingVehiclesVehicleidCall(vehicleId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageBoolean>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (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 dELETEpublicV41MylistingVehiclesVehicleidAsync(Integer vehicleId, final ApiCallback<ResponseMessageBoolean> 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 = dELETEpublicV41MylistingVehiclesVehicleidCall(vehicleId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageBoolean>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for dELETEpublicV41MylistingVehiclesVehicleidImages */ private com.squareup.okhttp.Call dELETEpublicV41MylistingVehiclesVehicleidImagesCall(Integer vehicleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling dELETEpublicV41MylistingVehiclesVehicleidImages(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}/images" .replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 vehicleId (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly dELETEpublicV41MylistingVehiclesVehicleidImages( Integer vehicleId) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = dELETEpublicV41MylistingVehiclesVehicleidImagesWithHttpInfo( vehicleId); return resp.getData(); } /** * * * @param vehicleId (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> dELETEpublicV41MylistingVehiclesVehicleidImagesWithHttpInfo( Integer vehicleId) throws ApiException { com.squareup.okhttp.Call call = dELETEpublicV41MylistingVehiclesVehicleidImagesCall(vehicleId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (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 dELETEpublicV41MylistingVehiclesVehicleidImagesAsync(Integer vehicleId, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = dELETEpublicV41MylistingVehiclesVehicleidImagesCall(vehicleId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for dELETEpublicV41MylistingVehiclesVehicleidImagesFilename */ private com.squareup.okhttp.Call dELETEpublicV41MylistingVehiclesVehicleidImagesFilenameCall(Integer vehicleId, String filename, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling dELETEpublicV41MylistingVehiclesVehicleidImagesFilename(Async)"); } // verify the required parameter 'filename' is set if (filename == null) { throw new ApiException( "Missing the required parameter 'filename' when calling dELETEpublicV41MylistingVehiclesVehicleidImagesFilename(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}/images/{filename}" .replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.toString())) .replaceAll("\\{" + "filename" + "\\}", apiClient.escapeString(filename.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 vehicleId (required) * @param filename (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly dELETEpublicV41MylistingVehiclesVehicleidImagesFilename( Integer vehicleId, String filename) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = dELETEpublicV41MylistingVehiclesVehicleidImagesFilenameWithHttpInfo( vehicleId, filename); return resp.getData(); } /** * * * @param vehicleId (required) * @param filename (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> dELETEpublicV41MylistingVehiclesVehicleidImagesFilenameWithHttpInfo( Integer vehicleId, String filename) throws ApiException { com.squareup.okhttp.Call call = dELETEpublicV41MylistingVehiclesVehicleidImagesFilenameCall(vehicleId, filename, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (required) * @param filename (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 dELETEpublicV41MylistingVehiclesVehicleidImagesFilenameAsync(Integer vehicleId, String filename, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = dELETEpublicV41MylistingVehiclesVehicleidImagesFilenameCall(vehicleId, filename, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for gETpublicV41MylistingFreeslots */ private com.squareup.okhttp.Call gETpublicV41MylistingFreeslotsCall( final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/public/v4.1/mylisting/freeslots".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 ResponseMessageCount * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageCount gETpublicV41MylistingFreeslots() throws ApiException { ApiResponse<ResponseMessageCount> resp = gETpublicV41MylistingFreeslotsWithHttpInfo(); return resp.getData(); } /** * * * @return ApiResponse<ResponseMessageCount> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageCount> gETpublicV41MylistingFreeslotsWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = gETpublicV41MylistingFreeslotsCall(null, null); Type localVarReturnType = new TypeToken<ResponseMessageCount>() { }.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 gETpublicV41MylistingFreeslotsAsync( final ApiCallback<ResponseMessageCount> 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 = gETpublicV41MylistingFreeslotsCall(progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageCount>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for gETpublicV41MylistingVehicles */ private com.squareup.okhttp.Call gETpublicV41MylistingVehiclesCall(Integer skip, Integer take, String filter, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'skip' is set if (skip == null) { throw new ApiException( "Missing the required parameter 'skip' when calling gETpublicV41MylistingVehicles(Async)"); } // verify the required parameter 'take' is set if (take == null) { throw new ApiException( "Missing the required parameter 'take' when calling gETpublicV41MylistingVehicles(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles".replaceAll("\\{format\\}", "json"); List<Pair> localVarQueryParams = new ArrayList<Pair>(); if (skip != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip)); if (take != null) localVarQueryParams.addAll(apiClient.parameterToPairs("", "take", take)); 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 = { "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); } /** * * * @param skip (required) * @param take (required) * @param filter (optional) * @return ResponseMessageCollectionMyListingVehicle * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageCollectionMyListingVehicle gETpublicV41MylistingVehicles(Integer skip, Integer take, String filter) throws ApiException { ApiResponse<ResponseMessageCollectionMyListingVehicle> resp = gETpublicV41MylistingVehiclesWithHttpInfo( skip, take, filter); return resp.getData(); } /** * * * @param skip (required) * @param take (required) * @param filter (optional) * @return ApiResponse<ResponseMessageCollectionMyListingVehicle> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageCollectionMyListingVehicle> gETpublicV41MylistingVehiclesWithHttpInfo( Integer skip, Integer take, String filter) throws ApiException { com.squareup.okhttp.Call call = gETpublicV41MylistingVehiclesCall(skip, take, filter, null, null); Type localVarReturnType = new TypeToken<ResponseMessageCollectionMyListingVehicle>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param skip (required) * @param take (required) * @param filter (optional) * @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 gETpublicV41MylistingVehiclesAsync(Integer skip, Integer take, String filter, final ApiCallback<ResponseMessageCollectionMyListingVehicle> 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 = gETpublicV41MylistingVehiclesCall(skip, take, filter, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageCollectionMyListingVehicle>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for gETpublicV41MylistingVehiclesCount */ private com.squareup.okhttp.Call gETpublicV41MylistingVehiclesCountCall(String filter, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/count".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 = { "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); } /** * * * @param filter (optional) * @return ResponseMessageCount * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageCount gETpublicV41MylistingVehiclesCount(String filter) throws ApiException { ApiResponse<ResponseMessageCount> resp = gETpublicV41MylistingVehiclesCountWithHttpInfo(filter); return resp.getData(); } /** * * * @param filter (optional) * @return ApiResponse<ResponseMessageCount> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageCount> gETpublicV41MylistingVehiclesCountWithHttpInfo(String filter) throws ApiException { com.squareup.okhttp.Call call = gETpublicV41MylistingVehiclesCountCall(filter, null, null); Type localVarReturnType = new TypeToken<ResponseMessageCount>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param filter (optional) * @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 gETpublicV41MylistingVehiclesCountAsync(String filter, final ApiCallback<ResponseMessageCount> 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 = gETpublicV41MylistingVehiclesCountCall(filter, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageCount>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for gETpublicV41MylistingVehiclesStatusoverview */ private com.squareup.okhttp.Call gETpublicV41MylistingVehiclesStatusoverviewCall( final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/statusoverview".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 ResponseMessageListMyListingVehicleStatus * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageListMyListingVehicleStatus gETpublicV41MylistingVehiclesStatusoverview() throws ApiException { ApiResponse<ResponseMessageListMyListingVehicleStatus> resp = gETpublicV41MylistingVehiclesStatusoverviewWithHttpInfo(); return resp.getData(); } /** * * * @return ApiResponse<ResponseMessageListMyListingVehicleStatus> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageListMyListingVehicleStatus> gETpublicV41MylistingVehiclesStatusoverviewWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = gETpublicV41MylistingVehiclesStatusoverviewCall(null, null); Type localVarReturnType = new TypeToken<ResponseMessageListMyListingVehicleStatus>() { }.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 gETpublicV41MylistingVehiclesStatusoverviewAsync( final ApiCallback<ResponseMessageListMyListingVehicleStatus> 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 = gETpublicV41MylistingVehiclesStatusoverviewCall(progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageListMyListingVehicleStatus>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for gETpublicV41MylistingVehiclesVehicleid */ private com.squareup.okhttp.Call gETpublicV41MylistingVehiclesVehicleidCall(Integer vehicleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling gETpublicV41MylistingVehiclesVehicleid(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } /** * * * @param vehicleId (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly gETpublicV41MylistingVehiclesVehicleid(Integer vehicleId) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = gETpublicV41MylistingVehiclesVehicleidWithHttpInfo( vehicleId); return resp.getData(); } /** * * * @param vehicleId (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> gETpublicV41MylistingVehiclesVehicleidWithHttpInfo( Integer vehicleId) throws ApiException { com.squareup.okhttp.Call call = gETpublicV41MylistingVehiclesVehicleidCall(vehicleId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (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 gETpublicV41MylistingVehiclesVehicleidAsync(Integer vehicleId, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = gETpublicV41MylistingVehiclesVehicleidCall(vehicleId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41MylistingVehiclesVehicleid */ private com.squareup.okhttp.Call pUTpublicV41MylistingVehiclesVehicleidCall(Integer vehicleId, MyListingVehicle myListingVehicle, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = myListingVehicle; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling pUTpublicV41MylistingVehiclesVehicleid(Async)"); } // verify the required parameter 'myListingVehicle' is set if (myListingVehicle == null) { throw new ApiException( "Missing the required parameter 'myListingVehicle' when calling pUTpublicV41MylistingVehiclesVehicleid(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 = { "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 vehicleId (required) * @param myListingVehicle (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly pUTpublicV41MylistingVehiclesVehicleid(Integer vehicleId, MyListingVehicle myListingVehicle) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = pUTpublicV41MylistingVehiclesVehicleidWithHttpInfo( vehicleId, myListingVehicle); return resp.getData(); } /** * * * @param vehicleId (required) * @param myListingVehicle (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> pUTpublicV41MylistingVehiclesVehicleidWithHttpInfo( Integer vehicleId, MyListingVehicle myListingVehicle) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41MylistingVehiclesVehicleidCall(vehicleId, myListingVehicle, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (required) * @param myListingVehicle (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 pUTpublicV41MylistingVehiclesVehicleidAsync(Integer vehicleId, MyListingVehicle myListingVehicle, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = pUTpublicV41MylistingVehiclesVehicleidCall(vehicleId, myListingVehicle, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41MylistingVehiclesVehicleidActivate */ private com.squareup.okhttp.Call pUTpublicV41MylistingVehiclesVehicleidActivateCall(Integer vehicleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling pUTpublicV41MylistingVehiclesVehicleidActivate(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}/activate" .replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 vehicleId (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly pUTpublicV41MylistingVehiclesVehicleidActivate(Integer vehicleId) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = pUTpublicV41MylistingVehiclesVehicleidActivateWithHttpInfo( vehicleId); return resp.getData(); } /** * * * @param vehicleId (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> pUTpublicV41MylistingVehiclesVehicleidActivateWithHttpInfo( Integer vehicleId) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41MylistingVehiclesVehicleidActivateCall(vehicleId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (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 pUTpublicV41MylistingVehiclesVehicleidActivateAsync(Integer vehicleId, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = pUTpublicV41MylistingVehiclesVehicleidActivateCall(vehicleId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41MylistingVehiclesVehicleidDeactivate */ private com.squareup.okhttp.Call pUTpublicV41MylistingVehiclesVehicleidDeactivateCall(Integer vehicleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling pUTpublicV41MylistingVehiclesVehicleidDeactivate(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}/deactivate" .replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 vehicleId (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly pUTpublicV41MylistingVehiclesVehicleidDeactivate( Integer vehicleId) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = pUTpublicV41MylistingVehiclesVehicleidDeactivateWithHttpInfo( vehicleId); return resp.getData(); } /** * * * @param vehicleId (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> pUTpublicV41MylistingVehiclesVehicleidDeactivateWithHttpInfo( Integer vehicleId) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41MylistingVehiclesVehicleidDeactivateCall(vehicleId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (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 pUTpublicV41MylistingVehiclesVehicleidDeactivateAsync(Integer vehicleId, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = pUTpublicV41MylistingVehiclesVehicleidDeactivateCall(vehicleId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41MylistingVehiclesVehicleidImages */ private com.squareup.okhttp.Call pUTpublicV41MylistingVehiclesVehicleidImagesCall(Integer vehicleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling pUTpublicV41MylistingVehiclesVehicleidImages(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}/images" .replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 vehicleId (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly pUTpublicV41MylistingVehiclesVehicleidImages(Integer vehicleId) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = pUTpublicV41MylistingVehiclesVehicleidImagesWithHttpInfo( vehicleId); return resp.getData(); } /** * * * @param vehicleId (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> pUTpublicV41MylistingVehiclesVehicleidImagesWithHttpInfo( Integer vehicleId) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41MylistingVehiclesVehicleidImagesCall(vehicleId, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (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 pUTpublicV41MylistingVehiclesVehicleidImagesAsync(Integer vehicleId, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = pUTpublicV41MylistingVehiclesVehicleidImagesCall(vehicleId, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } /* Build call for pUTpublicV41MylistingVehiclesVehicleidImagesSort */ private com.squareup.okhttp.Call pUTpublicV41MylistingVehiclesVehicleidImagesSortCall(Integer vehicleId, List<String> filenames, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = filenames; // verify the required parameter 'vehicleId' is set if (vehicleId == null) { throw new ApiException( "Missing the required parameter 'vehicleId' when calling pUTpublicV41MylistingVehiclesVehicleidImagesSort(Async)"); } // verify the required parameter 'filenames' is set if (filenames == null) { throw new ApiException( "Missing the required parameter 'filenames' when calling pUTpublicV41MylistingVehiclesVehicleidImagesSort(Async)"); } // create path and map variables String localVarPath = "/public/v4.1/mylisting/vehicles/{vehicleId}/images/sort" .replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "vehicleId" + "\\}", apiClient.escapeString(vehicleId.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 = { "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 vehicleId (required) * @param filenames (required) * @return ResponseMessageMyListingVehicleReadOnly * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ResponseMessageMyListingVehicleReadOnly pUTpublicV41MylistingVehiclesVehicleidImagesSort( Integer vehicleId, List<String> filenames) throws ApiException { ApiResponse<ResponseMessageMyListingVehicleReadOnly> resp = pUTpublicV41MylistingVehiclesVehicleidImagesSortWithHttpInfo( vehicleId, filenames); return resp.getData(); } /** * * * @param vehicleId (required) * @param filenames (required) * @return ApiResponse<ResponseMessageMyListingVehicleReadOnly> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<ResponseMessageMyListingVehicleReadOnly> pUTpublicV41MylistingVehiclesVehicleidImagesSortWithHttpInfo( Integer vehicleId, List<String> filenames) throws ApiException { com.squareup.okhttp.Call call = pUTpublicV41MylistingVehiclesVehicleidImagesSortCall(vehicleId, filenames, null, null); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); return apiClient.execute(call, localVarReturnType); } /** * (asynchronously) * * @param vehicleId (required) * @param filenames (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 pUTpublicV41MylistingVehiclesVehicleidImagesSortAsync(Integer vehicleId, List<String> filenames, final ApiCallback<ResponseMessageMyListingVehicleReadOnly> 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 = pUTpublicV41MylistingVehiclesVehicleidImagesSortCall(vehicleId, filenames, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<ResponseMessageMyListingVehicleReadOnly>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } }