@@ -322,5 +322,141 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
322322 return call ;
323323 }
324324
325+ /**
326+ * Build call for convertDocumentDirect
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 convertDocumentDirectCall (ConvertDocumentDirectRequest 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" ;
338+
339+ List <Pair > localVarQueryParams = new ArrayList <Pair >();
340+ List <Pair > localVarCollectionQueryParams = new ArrayList <Pair >();
341+ if (request .getformat () != null )
342+ localVarQueryParams .addAll (apiClient .parameterToPair ("format" , request .getformat ()));
343+ if (request .getfromPage () != null )
344+ localVarQueryParams .addAll (apiClient .parameterToPair ("fromPage" , request .getfromPage ()));
345+ if (request .getpagesCount () != null )
346+ localVarQueryParams .addAll (apiClient .parameterToPair ("pagesCount" , request .getpagesCount ()));
347+
348+ Map <String , String > localVarHeaderParams = new HashMap <String , String >();
349+
350+ Map <String , Object > localVarFormParams = new HashMap <String , Object >();
351+ if (request .getFile () != null )
352+ localVarFormParams .put ("File" , request .getFile ());
353+
354+ final String [] localVarAccepts = {
355+ "application/json"
356+ };
357+ final String localVarAccept = apiClient .selectHeaderAccept (localVarAccepts );
358+ if (localVarAccept != null ) localVarHeaderParams .put ("Accept" , localVarAccept );
359+
360+ final String [] localVarContentTypes = {
361+ "multipart/form-data"
362+ };
363+ final String localVarContentType = apiClient .selectHeaderContentType (localVarContentTypes );
364+ localVarHeaderParams .put ("Content-Type" , localVarContentType );
365+
366+ if (progressListener != null ) {
367+ apiClient .getHttpClient ().networkInterceptors ().add (new com .squareup .okhttp .Interceptor () {
368+ @ Override
369+ public com .squareup .okhttp .Response intercept (com .squareup .okhttp .Interceptor .Chain chain ) throws IOException {
370+ com .squareup .okhttp .Response originalResponse = chain .proceed (chain .request ());
371+ return originalResponse .newBuilder ()
372+ .body (new ProgressResponseBody (originalResponse .body (), progressListener ))
373+ .build ();
374+ }
375+ });
376+ }
377+
378+ String [] localVarAuthNames = new String [] { "JWT" };
379+ return apiClient .buildCall (localVarPath , "PUT" , localVarQueryParams , localVarCollectionQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAuthNames , progressRequestListener );
380+ }
381+
382+ @ SuppressWarnings ("rawtypes" )
383+ private com .squareup .okhttp .Call convertDocumentDirectValidateBeforeCall (ConvertDocumentDirectRequest request , final ProgressResponseBody .ProgressListener progressListener , final ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
384+
385+ // verify the required parameter 'format' is set
386+ if (request .getformat () == null ) {
387+ throw new ApiException ("Missing the required parameter 'format' when calling convertDocumentDirect(Async)" );
388+ }
389+
390+ // verify the required parameter 'file' is set
391+ if (request .getFile () == null ) {
392+ throw new ApiException ("Missing the required parameter 'file' when calling convertDocumentDirect(Async)" );
393+ }
394+
395+
396+ com .squareup .okhttp .Call call = convertDocumentDirectCall (request , progressListener , progressRequestListener );
397+ return call ;
398+
399+ }
400+
401+ /**
402+ * Converts input document file to format specified
403+ *
404+ * @param request The request model
405+ * @return File
406+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
407+ */
408+ public File convertDocumentDirect (ConvertDocumentDirectRequest request ) throws ApiException {
409+ ApiResponse <File > resp = convertDocumentDirectWithHttpInfo (request );
410+ return resp .getData ();
411+ }
412+
413+ /**
414+ * Converts input document file to format specified
415+ *
416+ * @param request The request model
417+ * @return ApiResponse<File>
418+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
419+ */
420+ public ApiResponse <File > convertDocumentDirectWithHttpInfo (ConvertDocumentDirectRequest request ) throws ApiException {
421+ com .squareup .okhttp .Call call = convertDocumentDirectValidateBeforeCall (request , null , null );
422+ Type localVarReturnType = new TypeToken <File >(){}.getType ();
423+ return apiClient .execute (call , localVarReturnType );
424+ }
425+
426+ /**
427+ * Converts input document file to format specified (asynchronously)
428+ *
429+ * @param request The request model
430+ * @param callback The callback to be executed when the API call finishes
431+ * @return The request call
432+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
433+ */
434+ public com .squareup .okhttp .Call convertDocumentDirectAsync (ConvertDocumentDirectRequest request , final ApiCallback <File > callback ) throws ApiException {
435+
436+ ProgressResponseBody .ProgressListener progressListener = null ;
437+ ProgressRequestBody .ProgressRequestListener progressRequestListener = null ;
438+
439+ if (callback != null ) {
440+ progressListener = new ProgressResponseBody .ProgressListener () {
441+ @ Override
442+ public void update (long bytesRead , long contentLength , boolean done ) {
443+ callback .onDownloadProgress (bytesRead , contentLength , done );
444+ }
445+ };
446+
447+ progressRequestListener = new ProgressRequestBody .ProgressRequestListener () {
448+ @ Override
449+ public void onRequestProgress (long bytesWritten , long contentLength , boolean done ) {
450+ callback .onUploadProgress (bytesWritten , contentLength , done );
451+ }
452+ };
453+ }
454+
455+ com .squareup .okhttp .Call call = convertDocumentDirectValidateBeforeCall (request , progressListener , progressRequestListener );
456+ Type localVarReturnType = new TypeToken <File >(){}.getType ();
457+ apiClient .executeAsync (call , localVarReturnType , callback );
458+ return call ;
459+ }
460+
325461}
326462
0 commit comments