|
1 | 1 | /** |
2 | 2 | * -------------------------------------------------------------------------------------------------------------------- |
3 | | - * <copyright company="Aspose Pty Ltd" file="ConversionApi.java"> |
| 3 | + * <copyright company="Aspose Pty Ltd" file="ConvertApi.java"> |
4 | 4 | * Copyright (c) 2003-2018 Aspose Pty Ltd |
5 | 5 | * </copyright> |
6 | 6 | * <summary> |
|
40 | 40 | import com.groupdocs.cloud.conversion.model.*; |
41 | 41 | import com.groupdocs.cloud.conversion.model.requests.*; |
42 | 42 |
|
43 | | -public class ConversionApi { |
| 43 | +public class ConvertApi { |
44 | 44 | private ApiClient apiClient; |
45 | 45 |
|
46 | 46 | /** |
47 | | - * Initializes new instance of ConversionApi |
| 47 | + * Initializes new instance of ConvertApi |
48 | 48 | * @param appSid Application identifier (App SID) |
49 | 49 | * @param appKey Application private key (App Key) |
50 | 50 | */ |
51 | | - public ConversionApi(String appSid, String appKey) { |
| 51 | + public ConvertApi(String appSid, String appKey) { |
52 | 52 | this(new Configuration(appSid, appKey)); |
53 | 53 | } |
54 | 54 |
|
55 | 55 | /** |
56 | | - * Initializes new instance of ConversionApi |
| 56 | + * Initializes new instance of ConvertApi |
57 | 57 | * @param configuration Configuration The configuration |
58 | 58 | */ |
59 | | - public ConversionApi(Configuration configuration) { |
| 59 | + public ConvertApi(Configuration configuration) { |
60 | 60 | this.apiClient = new ApiClient(configuration); |
61 | 61 | } |
62 | 62 |
|
@@ -322,129 +322,5 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don |
322 | 322 | return call; |
323 | 323 | } |
324 | 324 |
|
325 | | - /** |
326 | | - * Build call for getSupportedConversionTypes |
327 | | - * @param request The request model |
328 | | - * @param progressListener Progress listener |
329 | | - * @param progressRequestListener Progress request listener |
330 | | - * @return Call to execute |
331 | | - * @throws ApiException If fail to serialize the request body object |
332 | | - */ |
333 | | - public com.squareup.okhttp.Call getSupportedConversionTypesCall(GetSupportedConversionTypesRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
334 | | - Object localVarPostBody = null; |
335 | | - |
336 | | - // create path and map variables |
337 | | - String localVarPath = "/conversion/formats"; |
338 | | - |
339 | | - List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
340 | | - List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
341 | | - if (request.getFilePath() != null) |
342 | | - localVarQueryParams.addAll(apiClient.parameterToPair("filePath", request.getFilePath())); |
343 | | - if (request.getStorageName() != null) |
344 | | - localVarQueryParams.addAll(apiClient.parameterToPair("storageName", request.getStorageName())); |
345 | | - if (request.getformat() != null) |
346 | | - localVarQueryParams.addAll(apiClient.parameterToPair("format", request.getformat())); |
347 | | - |
348 | | - Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
349 | | - |
350 | | - Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
351 | | - |
352 | | - final String[] localVarAccepts = { |
353 | | - "application/json" |
354 | | - }; |
355 | | - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
356 | | - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
357 | | - |
358 | | - final String[] localVarContentTypes = { |
359 | | - "application/json" |
360 | | - }; |
361 | | - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
362 | | - localVarHeaderParams.put("Content-Type", localVarContentType); |
363 | | - |
364 | | - if(progressListener != null) { |
365 | | - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
366 | | - @Override |
367 | | - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
368 | | - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
369 | | - return originalResponse.newBuilder() |
370 | | - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
371 | | - .build(); |
372 | | - } |
373 | | - }); |
374 | | - } |
375 | | - |
376 | | - String[] localVarAuthNames = new String[] { "JWT" }; |
377 | | - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
378 | | - } |
379 | | - |
380 | | - @SuppressWarnings("rawtypes") |
381 | | - private com.squareup.okhttp.Call getSupportedConversionTypesValidateBeforeCall(GetSupportedConversionTypesRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
382 | | - |
383 | | - |
384 | | - com.squareup.okhttp.Call call = getSupportedConversionTypesCall(request, progressListener, progressRequestListener); |
385 | | - return call; |
386 | | - |
387 | | - } |
388 | | - |
389 | | - /** |
390 | | - * Returns all supported conversion types |
391 | | - * |
392 | | - * @param request The request model |
393 | | - * @return List<SupportedFormat> |
394 | | - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
395 | | - */ |
396 | | - public List<SupportedFormat> getSupportedConversionTypes(GetSupportedConversionTypesRequest request) throws ApiException { |
397 | | - ApiResponse<List<SupportedFormat>> resp = getSupportedConversionTypesWithHttpInfo(request); |
398 | | - return resp.getData(); |
399 | | - } |
400 | | - |
401 | | - /** |
402 | | - * Returns all supported conversion types |
403 | | - * |
404 | | - * @param request The request model |
405 | | - * @return ApiResponse<List<SupportedFormat>> |
406 | | - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
407 | | - */ |
408 | | - public ApiResponse<List<SupportedFormat>> getSupportedConversionTypesWithHttpInfo(GetSupportedConversionTypesRequest request) throws ApiException { |
409 | | - com.squareup.okhttp.Call call = getSupportedConversionTypesValidateBeforeCall(request, null, null); |
410 | | - Type localVarReturnType = new TypeToken<List<SupportedFormat>>(){}.getType(); |
411 | | - return apiClient.execute(call, localVarReturnType); |
412 | | - } |
413 | | - |
414 | | - /** |
415 | | - * Returns all supported conversion types (asynchronously) |
416 | | - * |
417 | | - * @param request The request model |
418 | | - * @param callback The callback to be executed when the API call finishes |
419 | | - * @return The request call |
420 | | - * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
421 | | - */ |
422 | | - public com.squareup.okhttp.Call getSupportedConversionTypesAsync(GetSupportedConversionTypesRequest request, final ApiCallback<List<SupportedFormat>> callback) throws ApiException { |
423 | | - |
424 | | - ProgressResponseBody.ProgressListener progressListener = null; |
425 | | - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
426 | | - |
427 | | - if (callback != null) { |
428 | | - progressListener = new ProgressResponseBody.ProgressListener() { |
429 | | - @Override |
430 | | - public void update(long bytesRead, long contentLength, boolean done) { |
431 | | - callback.onDownloadProgress(bytesRead, contentLength, done); |
432 | | - } |
433 | | - }; |
434 | | - |
435 | | - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
436 | | - @Override |
437 | | - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
438 | | - callback.onUploadProgress(bytesWritten, contentLength, done); |
439 | | - } |
440 | | - }; |
441 | | - } |
442 | | - |
443 | | - com.squareup.okhttp.Call call = getSupportedConversionTypesValidateBeforeCall(request, progressListener, progressRequestListener); |
444 | | - Type localVarReturnType = new TypeToken<List<SupportedFormat>>(){}.getType(); |
445 | | - apiClient.executeAsync(call, localVarReturnType, callback); |
446 | | - return call; |
447 | | - } |
448 | | - |
449 | 325 | } |
450 | 326 |
|
0 commit comments