@@ -33261,6 +33261,193 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
3326133261 apiClient.executeAsync(call, localVarReturnType, callback);
3326233262 return call;
3326333263 }
33264+ /**
33265+ * Build call for postDocumentPagesResize
33266+ * @param name The document name. (required)
33267+ * @param height Page Height (required)
33268+ * @param width Page width (required)
33269+ * @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33270+ * @param storage The document storage. (optional)
33271+ * @param folder The document folder. (optional)
33272+ * @param password Base64 encoded password. (optional)
33273+ * @param progressListener Progress listener
33274+ * @param progressRequestListener Progress request listener
33275+ * @return Call to execute
33276+ * @throws ApiException If fail to serialize the request body object
33277+ */
33278+ public com.squareup.okhttp.Call postDocumentPagesResizeCall(String name, Double height, Double width, String pages, String storage, String folder, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
33279+ Object localVarPostBody = null;
33280+
33281+ // create path and map variables
33282+ String localVarPath = "/pdf/{name}/resize"
33283+ .replaceAll("\\{" + "name" + "\\}", apiClient.escapePathSegmentString(name.toString()));
33284+
33285+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
33286+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
33287+ if (height != null)
33288+ localVarQueryParams.addAll(apiClient.parameterToPair("height", height));
33289+ if (width != null)
33290+ localVarQueryParams.addAll(apiClient.parameterToPair("width", width));
33291+ if (pages != null)
33292+ localVarQueryParams.addAll(apiClient.parameterToPair("pages", pages));
33293+ if (storage != null)
33294+ localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage));
33295+ if (folder != null)
33296+ localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder));
33297+ if (password != null)
33298+ localVarQueryParams.addAll(apiClient.parameterToPair("password", password));
33299+
33300+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
33301+
33302+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
33303+
33304+ final String[] localVarAccepts = {
33305+ "application/json"
33306+ };
33307+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
33308+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
33309+
33310+ final String[] localVarContentTypes = {
33311+ "application/json"
33312+ };
33313+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
33314+ localVarHeaderParams.put("Content-Type", localVarContentType);
33315+
33316+ if(progressListener != null) {
33317+ apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
33318+ @Override
33319+ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
33320+ com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
33321+ return originalResponse.newBuilder()
33322+ .body(new ProgressResponseBody(originalResponse.body(), progressListener))
33323+ .build();
33324+ }
33325+ });
33326+ }
33327+
33328+ String[] localVarAuthNames = new String[] { "JWT" };
33329+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
33330+ }
33331+
33332+ @SuppressWarnings("rawtypes")
33333+ private com.squareup.okhttp.Call postDocumentPagesResizeValidateBeforeCall(String name, Double height, Double width, String pages, String storage, String folder, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
33334+
33335+ // verify the required parameter 'name' is set
33336+ if (name == null) {
33337+ throw new ApiException("Missing the required parameter 'name' when calling postDocumentPagesResize(Async)");
33338+ }
33339+
33340+ // verify the required parameter 'height' is set
33341+ if (height == null) {
33342+ throw new ApiException("Missing the required parameter 'height' when calling postDocumentPagesResize(Async)");
33343+ }
33344+
33345+ // verify the required parameter 'width' is set
33346+ if (width == null) {
33347+ throw new ApiException("Missing the required parameter 'width' when calling postDocumentPagesResize(Async)");
33348+ }
33349+
33350+ // verify the required parameter 'pages' is set
33351+ if (pages == null) {
33352+ throw new ApiException("Missing the required parameter 'pages' when calling postDocumentPagesResize(Async)");
33353+ }
33354+
33355+
33356+ com.squareup.okhttp.Call call = postDocumentPagesResizeCall(name, height, width, pages, storage, folder, password, progressListener, progressRequestListener);
33357+ return call;
33358+
33359+ }
33360+
33361+ /**
33362+ * Rsize PDF document.
33363+ *
33364+ * @param name The document name. (required)
33365+ * @param height Page Height (required)
33366+ * @param width Page width (required)
33367+ * @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33368+ * @param storage The document storage. (optional)
33369+ * @param folder The document folder. (optional)
33370+ * @param password Base64 encoded password. (optional)
33371+ * @return AsposeResponse
33372+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
33373+ */
33374+ public AsposeResponse postDocumentPagesResize(String name, Double height, Double width, String pages, String storage, String folder, String password) throws ApiException {
33375+ try
33376+ {
33377+ ApiResponse<AsposeResponse> resp = postDocumentPagesResizeWithHttpInfo(name, height, width, pages, storage, folder, password);
33378+ return resp.getData();
33379+ }
33380+ catch (ApiException ex)
33381+ {
33382+ if (ex.getCode() == 401)
33383+ {
33384+ apiClient.requestToken();
33385+ ApiResponse<AsposeResponse> resp = postDocumentPagesResizeWithHttpInfo(name, height, width, pages, storage, folder, password);
33386+ return resp.getData();
33387+ }
33388+ throw ex;
33389+ }
33390+ }
33391+
33392+ /**
33393+ * Rsize PDF document.
33394+ *
33395+ * @param name The document name. (required)
33396+ * @param height Page Height (required)
33397+ * @param width Page width (required)
33398+ * @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33399+ * @param storage The document storage. (optional)
33400+ * @param folder The document folder. (optional)
33401+ * @param password Base64 encoded password. (optional)
33402+ * @return ApiResponse<AsposeResponse>
33403+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
33404+ */
33405+ public ApiResponse<AsposeResponse> postDocumentPagesResizeWithHttpInfo(String name, Double height, Double width, String pages, String storage, String folder, String password) throws ApiException {
33406+ com.squareup.okhttp.Call call = postDocumentPagesResizeValidateBeforeCall(name, height, width, pages, storage, folder, password, null, null);
33407+ Type localVarReturnType = new TypeToken<AsposeResponse>(){}.getType();
33408+ return apiClient.execute(call, localVarReturnType);
33409+ }
33410+
33411+ /**
33412+ * Rsize PDF document. (asynchronously)
33413+ *
33414+ * @param name The document name. (required)
33415+ * @param height Page Height (required)
33416+ * @param width Page width (required)
33417+ * @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33418+ * @param storage The document storage. (optional)
33419+ * @param folder The document folder. (optional)
33420+ * @param password Base64 encoded password. (optional)
33421+ * @param callback The callback to be executed when the API call finishes
33422+ * @return The request call
33423+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
33424+ */
33425+ public com.squareup.okhttp.Call postDocumentPagesResizeAsync(String name, Double height, Double width, String pages, String storage, String folder, String password, final ApiCallback<AsposeResponse> callback) throws ApiException {
33426+
33427+ ProgressResponseBody.ProgressListener progressListener = null;
33428+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
33429+
33430+ if (callback != null) {
33431+ progressListener = new ProgressResponseBody.ProgressListener() {
33432+ @Override
33433+ public void update(long bytesRead, long contentLength, boolean done) {
33434+ callback.onDownloadProgress(bytesRead, contentLength, done);
33435+ }
33436+ };
33437+
33438+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
33439+ @Override
33440+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
33441+ callback.onUploadProgress(bytesWritten, contentLength, done);
33442+ }
33443+ };
33444+ }
33445+
33446+ com.squareup.okhttp.Call call = postDocumentPagesResizeValidateBeforeCall(name, height, width, pages, storage, folder, password, progressListener, progressRequestListener);
33447+ Type localVarReturnType = new TypeToken<AsposeResponse>(){}.getType();
33448+ apiClient.executeAsync(call, localVarReturnType, callback);
33449+ return call;
33450+ }
3326433451 /**
3326533452 * Build call for postDocumentPagesRotate
3326633453 * @param name The document name. (required)
0 commit comments