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.DealersApi.java

License:Apache License

/**
 *  (asynchronously)/*from ww w  .jav  a2s . c o  m*/
 * 
 * @param accountId  (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 gETpublicV41DealersAccountidAsync(Integer accountId,
        final ApiCallback<ResponseMessageDealer> 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 = gETpublicV41DealersAccountidCall(accountId, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageDealer>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * //from www. j a  v  a 2  s  . c o m
 * 
 * @param accountId  (required)
 * @return ApiResponse&lt;ResponseMessageListMake&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageListMake> gETpublicV41DealersAccountidMakesWithHttpInfo(Integer accountId)
        throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41DealersAccountidMakesCall(accountId, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageListMake>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

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

License:Apache License

/**
 *  (asynchronously)/*from   w w w.  j av  a2 s.  c  o  m*/
 * 
 * @param accountId  (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 gETpublicV41DealersAccountidMakesAsync(Integer accountId,
        final ApiCallback<ResponseMessageListMake> 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 = gETpublicV41DealersAccountidMakesCall(accountId, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageListMake>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * //from ww  w . ja va2s.c o  m
 * 
 * @param accountId  (required)
 * @return ApiResponse&lt;ResponseMessageListModel&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageListModel> gETpublicV41DealersAccountidModelsWithHttpInfo(Integer accountId)
        throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41DealersAccountidModelsCall(accountId, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageListModel>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

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

License:Apache License

/**
 *  (asynchronously)/*from w w  w  .  j  ava2 s.  com*/
 * 
 * @param accountId  (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 gETpublicV41DealersAccountidModelsAsync(Integer accountId,
        final ApiCallback<ResponseMessageListModel> 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 = gETpublicV41DealersAccountidModelsCall(accountId, progressListener,
            progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageListModel>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * //w w  w.  j ava  2s .  c  om
 * 
 * @param accountId  (required)
 * @param skip  (required)
 * @param take  (required)
 * @param filter  (optional)
 * @return ApiResponse&lt;ResponseMessageCollectionListUser&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageCollectionListUser> gETpublicV41DealersAccountidUsersWithHttpInfo(
        Integer accountId, Integer skip, Integer take, String filter) throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41DealersAccountidUsersCall(accountId, skip, take, filter, null,
            null);
    Type localVarReturnType = new TypeToken<ResponseMessageCollectionListUser>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

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

License:Apache License

/**
 *  (asynchronously)/* w  ww . j  a v  a  2  s. c om*/
 * 
 * @param accountId  (required)
 * @param skip  (required)
 * @param take  (required)
 * @param filter  (optional)
 * @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 gETpublicV41DealersAccountidUsersAsync(Integer accountId, Integer skip,
        Integer take, String filter, final ApiCallback<ResponseMessageCollectionListUser> 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 = gETpublicV41DealersAccountidUsersCall(accountId, skip, take, filter,
            progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageCollectionListUser>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * //from   w w  w . j a v  a2  s  . c om
 * 
 * @param accountId  (required)
 * @param filter  (optional)
 * @return ApiResponse&lt;ResponseMessageCount&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageCount> gETpublicV41DealersAccountidUsersCountWithHttpInfo(Integer accountId,
        String filter) throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41DealersAccountidUsersCountCall(accountId, filter, null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageCount>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}

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

License:Apache License

/**
 *  (asynchronously)/*from  w  w w .  j  a  v  a 2s.c o m*/
 * 
 * @param accountId  (required)
 * @param filter  (optional)
 * @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 gETpublicV41DealersAccountidUsersCountAsync(Integer accountId, String filter,
        final ApiCallback<ResponseMessageCount> 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 = gETpublicV41DealersAccountidUsersCountCall(accountId, filter,
            progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ResponseMessageCount>() {
    }.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}

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

License:Apache License

/**
 * /*from  ww w .ja  v a  2  s.  c o  m*/
 * 
 * @param accountId  (required)
 * @param skip  (required)
 * @param take  (required)
 * @param filter  (optional)
 * @return ApiResponse&lt;ResponseMessageCollectionListAdDealer&gt;
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public ApiResponse<ResponseMessageCollectionListAdDealer> gETpublicV41DealersAccountidVehiclesWithHttpInfo(
        Integer accountId, Integer skip, Integer take, String filter) throws ApiException {
    com.squareup.okhttp.Call call = gETpublicV41DealersAccountidVehiclesCall(accountId, skip, take, filter,
            null, null);
    Type localVarReturnType = new TypeToken<ResponseMessageCollectionListAdDealer>() {
    }.getType();
    return apiClient.execute(call, localVarReturnType);
}