Example usage for com.google.gson.reflect TypeToken TypeToken

List of usage examples for com.google.gson.reflect TypeToken TypeToken

Introduction

In this page you can find the example usage for com.google.gson.reflect TypeToken TypeToken.

Prototype

@SuppressWarnings("unchecked")
protected TypeToken() 

Source Link

Document

Constructs a new type literal.

Usage

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)/*from  w  w w  .  j  a  v a2s .  c  om*/
 * 
 * @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;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * /*from   w ww. jav  a 2 s  . c o  m*/
 * 
 * @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);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)/*from  w w w  .j av a2s . c o m*/
 * 
 * @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;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * /*from w ww.j  ava 2  s  .  c  o m*/
 * 
 * @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);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)//from   w ww . j a v a2  s  . co m
 * 
 * @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;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * /*from   w  ww .  j a v a  2  s .  c  o m*/
 * 
 * @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);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)/*from  w ww .  ja  va 2  s  . com*/
 * 
 * @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;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * //from  w  w w  . j a  v a2s.  c  o m
 * 
 * @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);
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 *  (asynchronously)//from www. j  a  v a2  s.c  om
 * 
 * @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;
}

From source file:abtlibrary.utils.as24ApiClient.api.UsersApi.java

License:Apache License

/**
 * /*  ww w .  j av a 2 s .co m*/
 * 
 * @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);
}