abtlibrary.utils.as24ApiClient.api.UsersApi.java Source code

Java tutorial

Introduction

Here is the source code for abtlibrary.utils.as24ApiClient.api.UsersApi.java

Source

/**
 * 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.ResponseMessageUser;
import abtlibrary.utils.as24ApiClient.model.ResponseMessageString;
import abtlibrary.utils.as24ApiClient.model.ResponseMessageListAddress;
import abtlibrary.utils.as24ApiClient.model.ResponseMessageAddress;
import abtlibrary.utils.as24ApiClient.model.ResponseMessageDictionaryStringInt32;
import abtlibrary.utils.as24ApiClient.model.BaseResponseMessage;
import abtlibrary.utils.as24ApiClient.model.RegisterUser;
import abtlibrary.utils.as24ApiClient.model.Address;
import abtlibrary.utils.as24ApiClient.model.User;

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

public class UsersApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /* Build call for gETpublicV41UsersAuthorized */
    private com.squareup.okhttp.Call gETpublicV41UsersAuthorizedCall(
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/public/v4.1/users/authorized".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 ResponseMessageUser
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageUser gETpublicV41UsersAuthorized() throws ApiException {
        ApiResponse<ResponseMessageUser> resp = gETpublicV41UsersAuthorizedWithHttpInfo();
        return resp.getData();
    }

    /**
     * 
     * 
     * @return ApiResponse&lt;ResponseMessageUser&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ResponseMessageUser> gETpublicV41UsersAuthorizedWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = gETpublicV41UsersAuthorizedCall(null, null);
        Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
        }.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 gETpublicV41UsersAuthorizedAsync(
            final ApiCallback<ResponseMessageUser> 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 = gETpublicV41UsersAuthorizedCall(progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersSecuritytoken */
    private com.squareup.okhttp.Call gETpublicV41UsersSecuritytokenCall(
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/public/v4.1/users/securitytoken".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 ResponseMessageString
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageString gETpublicV41UsersSecuritytoken() throws ApiException {
        ApiResponse<ResponseMessageString> resp = gETpublicV41UsersSecuritytokenWithHttpInfo();
        return resp.getData();
    }

    /**
     * 
     * 
     * @return ApiResponse&lt;ResponseMessageString&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<ResponseMessageString> gETpublicV41UsersSecuritytokenWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = gETpublicV41UsersSecuritytokenCall(null, null);
        Type localVarReturnType = new TypeToken<ResponseMessageString>() {
        }.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 gETpublicV41UsersSecuritytokenAsync(
            final ApiCallback<ResponseMessageString> 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 = gETpublicV41UsersSecuritytokenCall(progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageString>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersUserid */
    private com.squareup.okhttp.Call gETpublicV41UsersUseridCall(Integer userId,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling gETpublicV41UsersUserid(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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 userId  (required)
     * @return ResponseMessageUser
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageUser gETpublicV41UsersUserid(Integer userId) throws ApiException {
        ApiResponse<ResponseMessageUser> resp = gETpublicV41UsersUseridWithHttpInfo(userId);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (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 gETpublicV41UsersUseridAsync(Integer userId,
            final ApiCallback<ResponseMessageUser> 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 = gETpublicV41UsersUseridCall(userId, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersUseridAddresses */
    private com.squareup.okhttp.Call gETpublicV41UsersUseridAddressesCall(Integer userId,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling gETpublicV41UsersUseridAddresses(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/addresses".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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 userId  (required)
     * @return ResponseMessageListAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageListAddress gETpublicV41UsersUseridAddresses(Integer userId) throws ApiException {
        ApiResponse<ResponseMessageListAddress> resp = gETpublicV41UsersUseridAddressesWithHttpInfo(userId);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (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 gETpublicV41UsersUseridAddressesAsync(Integer userId,
            final ApiCallback<ResponseMessageListAddress> 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 = gETpublicV41UsersUseridAddressesCall(userId, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageListAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersUseridAddressesId */
    private com.squareup.okhttp.Call gETpublicV41UsersUseridAddressesIdCall(Integer userId, Integer id,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling gETpublicV41UsersUseridAddressesId(Async)");
        }

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException(
                    "Missing the required parameter 'id' when calling gETpublicV41UsersUseridAddressesId(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/addresses/{id}".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.toString()))
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.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 userId  (required)
     * @param id  (required)
     * @return ResponseMessageAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageAddress gETpublicV41UsersUseridAddressesId(Integer userId, Integer id)
            throws ApiException {
        ApiResponse<ResponseMessageAddress> resp = gETpublicV41UsersUseridAddressesIdWithHttpInfo(userId, id);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (required)
     * @param id  (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 gETpublicV41UsersUseridAddressesIdAsync(Integer userId, Integer id,
            final ApiCallback<ResponseMessageAddress> 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 = gETpublicV41UsersUseridAddressesIdCall(userId, id, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersUseridBillingaddress */
    private com.squareup.okhttp.Call gETpublicV41UsersUseridBillingaddressCall(Integer userId,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling gETpublicV41UsersUseridBillingaddress(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/billingaddress".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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 userId  (required)
     * @return ResponseMessageAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageAddress gETpublicV41UsersUseridBillingaddress(Integer userId) throws ApiException {
        ApiResponse<ResponseMessageAddress> resp = gETpublicV41UsersUseridBillingaddressWithHttpInfo(userId);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (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 gETpublicV41UsersUseridBillingaddressAsync(Integer userId,
            final ApiCallback<ResponseMessageAddress> 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 = gETpublicV41UsersUseridBillingaddressCall(userId, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersUseridNumberof */
    private com.squareup.okhttp.Call gETpublicV41UsersUseridNumberofCall(Integer userId,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling gETpublicV41UsersUseridNumberof(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/numberof".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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 userId  (required)
     * @return ResponseMessageDictionaryStringInt32
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageDictionaryStringInt32 gETpublicV41UsersUseridNumberof(Integer userId)
            throws ApiException {
        ApiResponse<ResponseMessageDictionaryStringInt32> resp = gETpublicV41UsersUseridNumberofWithHttpInfo(
                userId);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (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 gETpublicV41UsersUseridNumberofAsync(Integer userId,
            final ApiCallback<ResponseMessageDictionaryStringInt32> 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 = gETpublicV41UsersUseridNumberofCall(userId, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageDictionaryStringInt32>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for gETpublicV41UsersUseridPublicationaddress */
    private com.squareup.okhttp.Call gETpublicV41UsersUseridPublicationaddressCall(Integer userId,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling gETpublicV41UsersUseridPublicationaddress(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/publicationaddress".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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 userId  (required)
     * @return ResponseMessageAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageAddress gETpublicV41UsersUseridPublicationaddress(Integer userId) throws ApiException {
        ApiResponse<ResponseMessageAddress> resp = gETpublicV41UsersUseridPublicationaddressWithHttpInfo(userId);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (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 gETpublicV41UsersUseridPublicationaddressAsync(Integer userId,
            final ApiCallback<ResponseMessageAddress> 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 = gETpublicV41UsersUseridPublicationaddressCall(userId, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pOSTpublicV41UsersChangepassword */
    private com.squareup.okhttp.Call pOSTpublicV41UsersChangepasswordCall(String oldPassword, String newPassword,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'oldPassword' is set
        if (oldPassword == null) {
            throw new ApiException(
                    "Missing the required parameter 'oldPassword' when calling pOSTpublicV41UsersChangepassword(Async)");
        }

        // verify the required parameter 'newPassword' is set
        if (newPassword == null) {
            throw new ApiException(
                    "Missing the required parameter 'newPassword' when calling pOSTpublicV41UsersChangepassword(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/changepassword".replaceAll("\\{format\\}", "json");

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (oldPassword != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "oldPassword", oldPassword));
        if (newPassword != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "newPassword", newPassword));

        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, "POST", localVarQueryParams, localVarPostBody,
                localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * 
     * 
     * @param oldPassword  (required)
     * @param newPassword  (required)
     * @return BaseResponseMessage
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public BaseResponseMessage pOSTpublicV41UsersChangepassword(String oldPassword, String newPassword)
            throws ApiException {
        ApiResponse<BaseResponseMessage> resp = pOSTpublicV41UsersChangepasswordWithHttpInfo(oldPassword,
                newPassword);
        return resp.getData();
    }

    /**
     * 
     * 
     * @param oldPassword  (required)
     * @param newPassword  (required)
     * @return ApiResponse&lt;BaseResponseMessage&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<BaseResponseMessage> pOSTpublicV41UsersChangepasswordWithHttpInfo(String oldPassword,
            String newPassword) throws ApiException {
        com.squareup.okhttp.Call call = pOSTpublicV41UsersChangepasswordCall(oldPassword, newPassword, null, null);
        Type localVarReturnType = new TypeToken<BaseResponseMessage>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     *  (asynchronously)
     * 
     * @param oldPassword  (required)
     * @param newPassword  (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 pOSTpublicV41UsersChangepasswordAsync(String oldPassword, String newPassword,
            final ApiCallback<BaseResponseMessage> 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 = pOSTpublicV41UsersChangepasswordCall(oldPassword, newPassword,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<BaseResponseMessage>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pOSTpublicV41UsersPasswordresetrequest */
    private com.squareup.okhttp.Call pOSTpublicV41UsersPasswordresetrequestCall(String email,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'email' is set
        if (email == null) {
            throw new ApiException(
                    "Missing the required parameter 'email' when calling pOSTpublicV41UsersPasswordresetrequest(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/passwordresetrequest".replaceAll("\\{format\\}", "json");

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (email != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "email", email));

        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, "POST", localVarQueryParams, localVarPostBody,
                localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * 
     * 
     * @param email  (required)
     * @return BaseResponseMessage
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public BaseResponseMessage pOSTpublicV41UsersPasswordresetrequest(String email) throws ApiException {
        ApiResponse<BaseResponseMessage> resp = pOSTpublicV41UsersPasswordresetrequestWithHttpInfo(email);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param email  (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 pOSTpublicV41UsersPasswordresetrequestAsync(String email,
            final ApiCallback<BaseResponseMessage> 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 = pOSTpublicV41UsersPasswordresetrequestCall(email, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<BaseResponseMessage>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pOSTpublicV41UsersRegistration */
    private com.squareup.okhttp.Call pOSTpublicV41UsersRegistrationCall(RegisterUser ru,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = ru;

        // verify the required parameter 'ru' is set
        if (ru == null) {
            throw new ApiException(
                    "Missing the required parameter 'ru' when calling pOSTpublicV41UsersRegistration(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/registration".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 = { "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, "POST", localVarQueryParams, localVarPostBody,
                localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * 
     * 
     * @param ru  (required)
     * @return ResponseMessageUser
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageUser pOSTpublicV41UsersRegistration(RegisterUser ru) throws ApiException {
        ApiResponse<ResponseMessageUser> resp = pOSTpublicV41UsersRegistrationWithHttpInfo(ru);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param ru  (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 pOSTpublicV41UsersRegistrationAsync(RegisterUser ru,
            final ApiCallback<ResponseMessageUser> 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 = pOSTpublicV41UsersRegistrationCall(ru, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pOSTpublicV41UsersUseridBillingaddress */
    private com.squareup.okhttp.Call pOSTpublicV41UsersUseridBillingaddressCall(Integer userId, Address address,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = address;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling pOSTpublicV41UsersUseridBillingaddress(Async)");
        }

        // verify the required parameter 'address' is set
        if (address == null) {
            throw new ApiException(
                    "Missing the required parameter 'address' when calling pOSTpublicV41UsersUseridBillingaddress(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/billingaddress".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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, "POST", localVarQueryParams, localVarPostBody,
                localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * 
     * 
     * @param userId  (required)
     * @param address  (required)
     * @return ResponseMessageAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageAddress pOSTpublicV41UsersUseridBillingaddress(Integer userId, Address address)
            throws ApiException {
        ApiResponse<ResponseMessageAddress> resp = pOSTpublicV41UsersUseridBillingaddressWithHttpInfo(userId,
                address);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (required)
     * @param address  (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 pOSTpublicV41UsersUseridBillingaddressAsync(Integer userId, Address address,
            final ApiCallback<ResponseMessageAddress> 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 = pOSTpublicV41UsersUseridBillingaddressCall(userId, address,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pOSTpublicV41UsersUseridPublicationaddress */
    private com.squareup.okhttp.Call pOSTpublicV41UsersUseridPublicationaddressCall(Integer userId, Address address,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = address;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling pOSTpublicV41UsersUseridPublicationaddress(Async)");
        }

        // verify the required parameter 'address' is set
        if (address == null) {
            throw new ApiException(
                    "Missing the required parameter 'address' when calling pOSTpublicV41UsersUseridPublicationaddress(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/publicationaddress".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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, "POST", localVarQueryParams, localVarPostBody,
                localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * 
     * 
     * @param userId  (required)
     * @param address  (required)
     * @return ResponseMessageAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageAddress pOSTpublicV41UsersUseridPublicationaddress(Integer userId, Address address)
            throws ApiException {
        ApiResponse<ResponseMessageAddress> resp = pOSTpublicV41UsersUseridPublicationaddressWithHttpInfo(userId,
                address);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (required)
     * @param address  (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 pOSTpublicV41UsersUseridPublicationaddressAsync(Integer userId, Address address,
            final ApiCallback<ResponseMessageAddress> 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 = pOSTpublicV41UsersUseridPublicationaddressCall(userId, address,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pUTpublicV41Users */
    private com.squareup.okhttp.Call pUTpublicV41UsersCall(User user,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = user;

        // verify the required parameter 'user' is set
        if (user == null) {
            throw new ApiException("Missing the required parameter 'user' when calling pUTpublicV41Users(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users".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 = { "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 user  (required)
     * @return ResponseMessageUser
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageUser pUTpublicV41Users(User user) throws ApiException {
        ApiResponse<ResponseMessageUser> resp = pUTpublicV41UsersWithHttpInfo(user);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param user  (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 pUTpublicV41UsersAsync(User user,
            final ApiCallback<ResponseMessageUser> 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 = pUTpublicV41UsersCall(user, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageUser>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for pUTpublicV41UsersUseridAddress */
    private com.squareup.okhttp.Call pUTpublicV41UsersUseridAddressCall(Integer userId, Address address,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = address;

        // verify the required parameter 'userId' is set
        if (userId == null) {
            throw new ApiException(
                    "Missing the required parameter 'userId' when calling pUTpublicV41UsersUseridAddress(Async)");
        }

        // verify the required parameter 'address' is set
        if (address == null) {
            throw new ApiException(
                    "Missing the required parameter 'address' when calling pUTpublicV41UsersUseridAddress(Async)");
        }

        // create path and map variables
        String localVarPath = "/public/v4.1/users/{userId}/address".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.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 userId  (required)
     * @param address  (required)
     * @return ResponseMessageAddress
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ResponseMessageAddress pUTpublicV41UsersUseridAddress(Integer userId, Address address)
            throws ApiException {
        ApiResponse<ResponseMessageAddress> resp = pUTpublicV41UsersUseridAddressWithHttpInfo(userId, address);
        return resp.getData();
    }

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

    /**
     *  (asynchronously)
     * 
     * @param userId  (required)
     * @param address  (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 pUTpublicV41UsersUseridAddressAsync(Integer userId, Address address,
            final ApiCallback<ResponseMessageAddress> 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 = pUTpublicV41UsersUseridAddressCall(userId, address, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<ResponseMessageAddress>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}