clients/java/src/main/java/io/swagger/client/api/PageApi.java
<gh_stars>0/*
 * JBS Backend Service
 * Journalim Protocol Compatible Backend Service
 *
 * OpenAPI spec version: 0.0.1
 * Contact: anpch@example.com
 *
 * 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.
 */

package io.swagger.client.api;

import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import io.swagger.client.model.ErrorResponseModel;
import io.swagger.client.model.HTTPValidationError;
import io.swagger.client.model.PageCreate;
import io.swagger.client.model.PageLanguageCreate;
import io.swagger.client.model.PageLanguageRead;
import io.swagger.client.model.PageLanguageUpdate;
import io.swagger.client.model.PageRead;
import io.swagger.client.model.PageUpdate;
import io.swagger.client.model.SuccessResponseModel;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PageApi {
    private ApiClient apiClient;

    public PageApi() {
        this(Configuration.getDefaultApiClient());
    }

    public PageApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Build call for createPageLanguagePageLanguagesPost
     * @param body  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call createPageLanguagePageLanguagesPostCall(PageLanguageCreate body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;
        
        // create path and map variables
        String localVarPath = "/page_languages";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {
            "application/json"
        };
        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[] { "OAuth2PasswordBearer" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call createPageLanguagePageLanguagesPostValidateBeforeCall(PageLanguageCreate body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createPageLanguagePageLanguagesPost(Async)");
        }
        
        com.squareup.okhttp.Call call = createPageLanguagePageLanguagesPostCall(body, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Create Page Language
     * Create a PageLanguage.
     * @param body  (required)
     * @return PageLanguageRead
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PageLanguageRead createPageLanguagePageLanguagesPost(PageLanguageCreate body) throws ApiException {
        ApiResponse<PageLanguageRead> resp = createPageLanguagePageLanguagesPostWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Create Page Language
     * Create a PageLanguage.
     * @param body  (required)
     * @return ApiResponse&lt;PageLanguageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<PageLanguageRead> createPageLanguagePageLanguagesPostWithHttpInfo(PageLanguageCreate body) throws ApiException {
        com.squareup.okhttp.Call call = createPageLanguagePageLanguagesPostValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<PageLanguageRead>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create Page Language (asynchronously)
     * Create a PageLanguage.
     * @param body  (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 createPageLanguagePageLanguagesPostAsync(PageLanguageCreate body, final ApiCallback<PageLanguageRead> 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 = createPageLanguagePageLanguagesPostValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<PageLanguageRead>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for createPagePagesPost
     * @param body  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call createPagePagesPostCall(PageCreate body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;
        
        // create path and map variables
        String localVarPath = "/pages";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {
            "application/json"
        };
        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[] { "OAuth2PasswordBearer" };
        return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call createPagePagesPostValidateBeforeCall(PageCreate body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createPagePagesPost(Async)");
        }
        
        com.squareup.okhttp.Call call = createPagePagesPostCall(body, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Create Page
     * Create a Page.
     * @param body  (required)
     * @return PageRead
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PageRead createPagePagesPost(PageCreate body) throws ApiException {
        ApiResponse<PageRead> resp = createPagePagesPostWithHttpInfo(body);
        return resp.getData();
    }

    /**
     * Create Page
     * Create a Page.
     * @param body  (required)
     * @return ApiResponse&lt;PageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<PageRead> createPagePagesPostWithHttpInfo(PageCreate body) throws ApiException {
        com.squareup.okhttp.Call call = createPagePagesPostValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<PageRead>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Create Page (asynchronously)
     * Create a Page.
     * @param body  (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 createPagePagesPostAsync(PageCreate body, final ApiCallback<PageRead> 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 = createPagePagesPostValidateBeforeCall(body, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<PageRead>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deletePageLanguagePageLanguagesPageLanguageIdDelete
     * @param pageLanguageId  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call deletePageLanguagePageLanguagesPageLanguageIdDeleteCall(Integer pageLanguageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/page_languages/{page_language_id}"
            .replaceAll("\\{" + "page_language_id" + "\\}", apiClient.escapeString(pageLanguageId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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[] { "OAuth2PasswordBearer" };
        return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call deletePageLanguagePageLanguagesPageLanguageIdDeleteValidateBeforeCall(Integer pageLanguageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'pageLanguageId' is set
        if (pageLanguageId == null) {
            throw new ApiException("Missing the required parameter 'pageLanguageId' when calling deletePageLanguagePageLanguagesPageLanguageIdDelete(Async)");
        }
        
        com.squareup.okhttp.Call call = deletePageLanguagePageLanguagesPageLanguageIdDeleteCall(pageLanguageId, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Delete Page Language
     * 
     * @param pageLanguageId  (required)
     * @return SuccessResponseModel
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public SuccessResponseModel deletePageLanguagePageLanguagesPageLanguageIdDelete(Integer pageLanguageId) throws ApiException {
        ApiResponse<SuccessResponseModel> resp = deletePageLanguagePageLanguagesPageLanguageIdDeleteWithHttpInfo(pageLanguageId);
        return resp.getData();
    }

    /**
     * Delete Page Language
     * 
     * @param pageLanguageId  (required)
     * @return ApiResponse&lt;SuccessResponseModel&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<SuccessResponseModel> deletePageLanguagePageLanguagesPageLanguageIdDeleteWithHttpInfo(Integer pageLanguageId) throws ApiException {
        com.squareup.okhttp.Call call = deletePageLanguagePageLanguagesPageLanguageIdDeleteValidateBeforeCall(pageLanguageId, null, null);
        Type localVarReturnType = new TypeToken<SuccessResponseModel>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Delete Page Language (asynchronously)
     * 
     * @param pageLanguageId  (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 deletePageLanguagePageLanguagesPageLanguageIdDeleteAsync(Integer pageLanguageId, final ApiCallback<SuccessResponseModel> 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 = deletePageLanguagePageLanguagesPageLanguageIdDeleteValidateBeforeCall(pageLanguageId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<SuccessResponseModel>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for deletePagePagesPageIdDelete
     * @param pageId  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call deletePagePagesPageIdDeleteCall(Integer pageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/pages/{page_id}"
            .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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[] { "OAuth2PasswordBearer" };
        return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call deletePagePagesPageIdDeleteValidateBeforeCall(Integer pageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'pageId' is set
        if (pageId == null) {
            throw new ApiException("Missing the required parameter 'pageId' when calling deletePagePagesPageIdDelete(Async)");
        }
        
        com.squareup.okhttp.Call call = deletePagePagesPageIdDeleteCall(pageId, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Delete Page
     * 
     * @param pageId  (required)
     * @return SuccessResponseModel
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public SuccessResponseModel deletePagePagesPageIdDelete(Integer pageId) throws ApiException {
        ApiResponse<SuccessResponseModel> resp = deletePagePagesPageIdDeleteWithHttpInfo(pageId);
        return resp.getData();
    }

    /**
     * Delete Page
     * 
     * @param pageId  (required)
     * @return ApiResponse&lt;SuccessResponseModel&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<SuccessResponseModel> deletePagePagesPageIdDeleteWithHttpInfo(Integer pageId) throws ApiException {
        com.squareup.okhttp.Call call = deletePagePagesPageIdDeleteValidateBeforeCall(pageId, null, null);
        Type localVarReturnType = new TypeToken<SuccessResponseModel>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Delete Page (asynchronously)
     * 
     * @param pageId  (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 deletePagePagesPageIdDeleteAsync(Integer pageId, final ApiCallback<SuccessResponseModel> 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 = deletePagePagesPageIdDeleteValidateBeforeCall(pageId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<SuccessResponseModel>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readPageLanguagePageLanguagesPageLanguageIdGet
     * @param pageLanguageId  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call readPageLanguagePageLanguagesPageLanguageIdGetCall(Integer pageLanguageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/page_languages/{page_language_id}"
            .replaceAll("\\{" + "page_language_id" + "\\}", apiClient.escapeString(pageLanguageId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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[] {  };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call readPageLanguagePageLanguagesPageLanguageIdGetValidateBeforeCall(Integer pageLanguageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'pageLanguageId' is set
        if (pageLanguageId == null) {
            throw new ApiException("Missing the required parameter 'pageLanguageId' when calling readPageLanguagePageLanguagesPageLanguageIdGet(Async)");
        }
        
        com.squareup.okhttp.Call call = readPageLanguagePageLanguagesPageLanguageIdGetCall(pageLanguageId, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Read Page Language
     * 
     * @param pageLanguageId  (required)
     * @return PageLanguageRead
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PageLanguageRead readPageLanguagePageLanguagesPageLanguageIdGet(Integer pageLanguageId) throws ApiException {
        ApiResponse<PageLanguageRead> resp = readPageLanguagePageLanguagesPageLanguageIdGetWithHttpInfo(pageLanguageId);
        return resp.getData();
    }

    /**
     * Read Page Language
     * 
     * @param pageLanguageId  (required)
     * @return ApiResponse&lt;PageLanguageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<PageLanguageRead> readPageLanguagePageLanguagesPageLanguageIdGetWithHttpInfo(Integer pageLanguageId) throws ApiException {
        com.squareup.okhttp.Call call = readPageLanguagePageLanguagesPageLanguageIdGetValidateBeforeCall(pageLanguageId, null, null);
        Type localVarReturnType = new TypeToken<PageLanguageRead>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Read Page Language (asynchronously)
     * 
     * @param pageLanguageId  (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 readPageLanguagePageLanguagesPageLanguageIdGetAsync(Integer pageLanguageId, final ApiCallback<PageLanguageRead> 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 = readPageLanguagePageLanguagesPageLanguageIdGetValidateBeforeCall(pageLanguageId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<PageLanguageRead>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readPageLanguagesPageLanguagesGet
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call readPageLanguagesPageLanguagesGetCall(String q, Integer offset, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/page_languages";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (q != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("q", q));
        if (offset != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
        if (limit != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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[] {  };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call readPageLanguagesPageLanguagesGetValidateBeforeCall(String q, Integer offset, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        com.squareup.okhttp.Call call = readPageLanguagesPageLanguagesGetCall(q, offset, limit, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Read Page Languages
     * Get all PageLanguage.
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @return List&lt;PageLanguageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<PageLanguageRead> readPageLanguagesPageLanguagesGet(String q, Integer offset, Integer limit) throws ApiException {
        ApiResponse<List<PageLanguageRead>> resp = readPageLanguagesPageLanguagesGetWithHttpInfo(q, offset, limit);
        return resp.getData();
    }

    /**
     * Read Page Languages
     * Get all PageLanguage.
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @return ApiResponse&lt;List&lt;PageLanguageRead&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<PageLanguageRead>> readPageLanguagesPageLanguagesGetWithHttpInfo(String q, Integer offset, Integer limit) throws ApiException {
        com.squareup.okhttp.Call call = readPageLanguagesPageLanguagesGetValidateBeforeCall(q, offset, limit, null, null);
        Type localVarReturnType = new TypeToken<List<PageLanguageRead>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Read Page Languages (asynchronously)
     * Get all PageLanguage.
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @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 readPageLanguagesPageLanguagesGetAsync(String q, Integer offset, Integer limit, final ApiCallback<List<PageLanguageRead>> 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 = readPageLanguagesPageLanguagesGetValidateBeforeCall(q, offset, limit, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<PageLanguageRead>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readPagePagesPageIdGet
     * @param pageId  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call readPagePagesPageIdGetCall(Integer pageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/pages/{page_id}"
            .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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[] {  };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call readPagePagesPageIdGetValidateBeforeCall(Integer pageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'pageId' is set
        if (pageId == null) {
            throw new ApiException("Missing the required parameter 'pageId' when calling readPagePagesPageIdGet(Async)");
        }
        
        com.squareup.okhttp.Call call = readPagePagesPageIdGetCall(pageId, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Read Page
     * 
     * @param pageId  (required)
     * @return PageRead
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PageRead readPagePagesPageIdGet(Integer pageId) throws ApiException {
        ApiResponse<PageRead> resp = readPagePagesPageIdGetWithHttpInfo(pageId);
        return resp.getData();
    }

    /**
     * Read Page
     * 
     * @param pageId  (required)
     * @return ApiResponse&lt;PageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<PageRead> readPagePagesPageIdGetWithHttpInfo(Integer pageId) throws ApiException {
        com.squareup.okhttp.Call call = readPagePagesPageIdGetValidateBeforeCall(pageId, null, null);
        Type localVarReturnType = new TypeToken<PageRead>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Read Page (asynchronously)
     * 
     * @param pageId  (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 readPagePagesPageIdGetAsync(Integer pageId, final ApiCallback<PageRead> 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 = readPagePagesPageIdGetValidateBeforeCall(pageId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<PageRead>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for readPagesPagesGet
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call readPagesPagesGetCall(String q, Integer offset, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/pages";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (q != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("q", q));
        if (offset != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset));
        if (limit != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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[] {  };
        return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call readPagesPagesGetValidateBeforeCall(String q, Integer offset, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        com.squareup.okhttp.Call call = readPagesPagesGetCall(q, offset, limit, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Read Pages
     * Get all Page.
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @return List&lt;PageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<PageRead> readPagesPagesGet(String q, Integer offset, Integer limit) throws ApiException {
        ApiResponse<List<PageRead>> resp = readPagesPagesGetWithHttpInfo(q, offset, limit);
        return resp.getData();
    }

    /**
     * Read Pages
     * Get all Page.
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @return ApiResponse&lt;List&lt;PageRead&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<PageRead>> readPagesPagesGetWithHttpInfo(String q, Integer offset, Integer limit) throws ApiException {
        com.squareup.okhttp.Call call = readPagesPagesGetValidateBeforeCall(q, offset, limit, null, null);
        Type localVarReturnType = new TypeToken<List<PageRead>>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Read Pages (asynchronously)
     * Get all Page.
     * @param q  (optional)
     * @param offset  (optional, default to 0)
     * @param limit  (optional, default to 100)
     * @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 readPagesPagesGetAsync(String q, Integer offset, Integer limit, final ApiCallback<List<PageRead>> 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 = readPagesPagesGetValidateBeforeCall(q, offset, limit, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<PageRead>>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updatePageLanguagePageLanguagesPageLanguageIdPatch
     * @param body  (required)
     * @param pageLanguageId  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call updatePageLanguagePageLanguagesPageLanguageIdPatchCall(PageLanguageUpdate body, Integer pageLanguageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;
        
        // create path and map variables
        String localVarPath = "/page_languages/{page_language_id}"
            .replaceAll("\\{" + "page_language_id" + "\\}", apiClient.escapeString(pageLanguageId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {
            "application/json"
        };
        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[] { "OAuth2PasswordBearer" };
        return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call updatePageLanguagePageLanguagesPageLanguageIdPatchValidateBeforeCall(PageLanguageUpdate body, Integer pageLanguageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updatePageLanguagePageLanguagesPageLanguageIdPatch(Async)");
        }
        // verify the required parameter 'pageLanguageId' is set
        if (pageLanguageId == null) {
            throw new ApiException("Missing the required parameter 'pageLanguageId' when calling updatePageLanguagePageLanguagesPageLanguageIdPatch(Async)");
        }
        
        com.squareup.okhttp.Call call = updatePageLanguagePageLanguagesPageLanguageIdPatchCall(body, pageLanguageId, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Update Page Language
     * 
     * @param body  (required)
     * @param pageLanguageId  (required)
     * @return PageLanguageRead
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PageLanguageRead updatePageLanguagePageLanguagesPageLanguageIdPatch(PageLanguageUpdate body, Integer pageLanguageId) throws ApiException {
        ApiResponse<PageLanguageRead> resp = updatePageLanguagePageLanguagesPageLanguageIdPatchWithHttpInfo(body, pageLanguageId);
        return resp.getData();
    }

    /**
     * Update Page Language
     * 
     * @param body  (required)
     * @param pageLanguageId  (required)
     * @return ApiResponse&lt;PageLanguageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<PageLanguageRead> updatePageLanguagePageLanguagesPageLanguageIdPatchWithHttpInfo(PageLanguageUpdate body, Integer pageLanguageId) throws ApiException {
        com.squareup.okhttp.Call call = updatePageLanguagePageLanguagesPageLanguageIdPatchValidateBeforeCall(body, pageLanguageId, null, null);
        Type localVarReturnType = new TypeToken<PageLanguageRead>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Update Page Language (asynchronously)
     * 
     * @param body  (required)
     * @param pageLanguageId  (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 updatePageLanguagePageLanguagesPageLanguageIdPatchAsync(PageLanguageUpdate body, Integer pageLanguageId, final ApiCallback<PageLanguageRead> 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 = updatePageLanguagePageLanguagesPageLanguageIdPatchValidateBeforeCall(body, pageLanguageId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<PageLanguageRead>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for updatePagePagesPageIdPatch
     * @param body  (required)
     * @param pageId  (required)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call updatePagePagesPageIdPatchCall(PageUpdate body, Integer pageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = body;
        
        // create path and map variables
        String localVarPath = "/pages/{page_id}"
            .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

        final String[] localVarContentTypes = {
            "application/json"
        };
        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[] { "OAuth2PasswordBearer" };
        return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call updatePagePagesPageIdPatchValidateBeforeCall(PageUpdate body, Integer pageId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updatePagePagesPageIdPatch(Async)");
        }
        // verify the required parameter 'pageId' is set
        if (pageId == null) {
            throw new ApiException("Missing the required parameter 'pageId' when calling updatePagePagesPageIdPatch(Async)");
        }
        
        com.squareup.okhttp.Call call = updatePagePagesPageIdPatchCall(body, pageId, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * Update Page
     * 
     * @param body  (required)
     * @param pageId  (required)
     * @return PageRead
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public PageRead updatePagePagesPageIdPatch(PageUpdate body, Integer pageId) throws ApiException {
        ApiResponse<PageRead> resp = updatePagePagesPageIdPatchWithHttpInfo(body, pageId);
        return resp.getData();
    }

    /**
     * Update Page
     * 
     * @param body  (required)
     * @param pageId  (required)
     * @return ApiResponse&lt;PageRead&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<PageRead> updatePagePagesPageIdPatchWithHttpInfo(PageUpdate body, Integer pageId) throws ApiException {
        com.squareup.okhttp.Call call = updatePagePagesPageIdPatchValidateBeforeCall(body, pageId, null, null);
        Type localVarReturnType = new TypeToken<PageRead>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Update Page (asynchronously)
     * 
     * @param body  (required)
     * @param pageId  (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 updatePagePagesPageIdPatchAsync(PageUpdate body, Integer pageId, final ApiCallback<PageRead> 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 = updatePagePagesPageIdPatchValidateBeforeCall(body, pageId, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<PageRead>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}
