Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Lob
* The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors.
Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.lob.api.client;
import com.lob.api.ApiCallback;
import com.lob.api.ApiClient;
import com.lob.api.ApiException;
import com.lob.api.ApiResponse;
import com.lob.api.Configuration;
import com.lob.api.Pair;
import com.lob.api.ProgressRequestBody;
import com.lob.api.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import com.lob.model.Export;
import com.lob.model.ExportModel;
import com.lob.model.LobError;
import com.lob.model.Upload;
import com.lob.model.UploadCreateExport;
import com.lob.model.UploadFile;
import com.lob.model.UploadUpdatable;
import com.lob.model.UploadWritable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UploadsApi {
private ApiClient localVarApiClient;
public UploadsApi() {
this(Configuration.getDefaultApiClient());
}
public UploadsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for get_export
* @param uplId ID of the upload (required)
* @param exId ID of the export (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Returns an export object
-
*/
public okhttp3.Call get_exportCall(String uplId, String exId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/uploads/{upl_id}/exports/{ex_id}"
.replaceAll("\\{" + "upl_id" + "\\}", localVarApiClient.escapeString(uplId.toString()))
.replaceAll("\\{" + "ex_id" + "\\}", localVarApiClient.escapeString(exId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call get_exportValidateBeforeCall(String uplId, String exId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uplId' is set
if (uplId == null) {
throw new ApiException("Missing the required parameter 'uplId' when calling get_export(Async)");
}
// verify the required parameter 'exId' is set
if (exId == null) {
throw new ApiException("Missing the required parameter 'exId' when calling get_export(Async)");
}
okhttp3.Call localVarCall = get_exportCall(uplId, exId, _callback);
return localVarCall;
}
/**
* get_export
* Retrieves the details of an existing export. You need only supply the unique export identifier that was returned upon export creation. If you try retrieving an export immediately after creating one (i.e., before we're done processing the export), you will get back an export object with `state = in_progress`.
* @param uplId ID of the upload (required)
* @param exId ID of the export (required)
* @return Export
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Returns an export object
-
*/
public Export get_export(String uplId, String exId) throws ApiException {
try {
ApiResponse localVarResp = get_exportWithHttpInfo(uplId, exId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* get_export
* Retrieves the details of an existing export. You need only supply the unique export identifier that was returned upon export creation. If you try retrieving an export immediately after creating one (i.e., before we're done processing the export), you will get back an export object with `state = in_progress`.
* @param uplId ID of the upload (required)
* @param exId ID of the export (required)
* @return ApiResponse<Export>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Returns an export object
-
*/
public ApiResponse get_exportWithHttpInfo(String uplId, String exId) throws ApiException {
try {
okhttp3.Call localVarCall = get_exportValidateBeforeCall(uplId, exId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* get_export (asynchronously)
* Retrieves the details of an existing export. You need only supply the unique export identifier that was returned upon export creation. If you try retrieving an export immediately after creating one (i.e., before we're done processing the export), you will get back an export object with `state = in_progress`.
* @param uplId ID of the upload (required)
* @param exId ID of the export (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
* @http.response.details
Status Code
Description
Response Headers
200
Returns an export object
-
*/
public okhttp3.Call get_exportAsync(String uplId, String exId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = get_exportValidateBeforeCall(uplId, exId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for get
* @param uplId id of the upload (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getCall(String uplId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/uploads/{upl_id}"
.replaceAll("\\{" + "upl_id" + "\\}", localVarApiClient.escapeString(uplId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getValidateBeforeCall(String uplId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uplId' is set
if (uplId == null) {
throw new ApiException("Missing the required parameter 'uplId' when calling get(Async)");
}
okhttp3.Call localVarCall = getCall(uplId, _callback);
return localVarCall;
}
/**
* get
* Retrieves the details of an existing upload. You need only supply the unique upload identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @return Upload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Upload get(String uplId) throws ApiException {
try {
ApiResponse localVarResp = getWithHttpInfo(uplId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* get
* Retrieves the details of an existing upload. You need only supply the unique upload identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @return ApiResponse<Upload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse getWithHttpInfo(String uplId) throws ApiException {
try {
okhttp3.Call localVarCall = getValidateBeforeCall(uplId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* get (asynchronously)
* Retrieves the details of an existing upload. You need only supply the unique upload identifier that was returned upon upload creation.
* @param uplId id of the upload (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
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getAsync(String uplId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(uplId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for create
* @param uploadWritable (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
201
Upload created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createCall(UploadWritable uploadWritable, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = uploadWritable;
// create path and map variables
String localVarPath = "/uploads";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createValidateBeforeCall(UploadWritable uploadWritable, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uploadWritable' is set
if (uploadWritable == null) {
throw new ApiException("Missing the required parameter 'uploadWritable' when calling create(Async)");
}
okhttp3.Call localVarCall = createCall(uploadWritable, _callback);
return localVarCall;
}
/**
* create
* Creates a new upload with the provided properties.
* @param uploadWritable (required)
* @return Upload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Upload created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Upload create(UploadWritable uploadWritable) throws ApiException {
try {
ApiResponse localVarResp = createWithHttpInfo(uploadWritable);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* create
* Creates a new upload with the provided properties.
* @param uploadWritable (required)
* @return ApiResponse<Upload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Upload created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse createWithHttpInfo(UploadWritable uploadWritable) throws ApiException {
try {
okhttp3.Call localVarCall = createValidateBeforeCall(uploadWritable, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* create (asynchronously)
* Creates a new upload with the provided properties.
* @param uploadWritable (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
* @http.response.details
Status Code
Description
Response Headers
201
Upload created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createAsync(UploadWritable uploadWritable, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(uploadWritable, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for delete
* @param uplId id of the upload (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
204
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call deleteCall(String uplId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/uploads/{upl_id}"
.replaceAll("\\{" + "upl_id" + "\\}", localVarApiClient.escapeString(uplId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteValidateBeforeCall(String uplId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uplId' is set
if (uplId == null) {
throw new ApiException("Missing the required parameter 'uplId' when calling delete(Async)");
}
okhttp3.Call localVarCall = deleteCall(uplId, _callback);
return localVarCall;
}
/**
* delete
* Delete an existing upload. You need only supply the unique identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
204
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public void delete(String uplId) throws ApiException {
try {
deleteWithHttpInfo(uplId);
} catch (ApiException e) {
throw e;
}
}
/**
* delete
* Delete an existing upload. You need only supply the unique identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
204
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse deleteWithHttpInfo(String uplId) throws ApiException {
try {
okhttp3.Call localVarCall = deleteValidateBeforeCall(uplId, null);
return localVarApiClient.execute(localVarCall);
} catch (ApiException e) {
throw e;
}
}
/**
* delete (asynchronously)
* Delete an existing upload. You need only supply the unique identifier that was returned upon upload creation.
* @param uplId id of the upload (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
* @http.response.details
Status Code
Description
Response Headers
204
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call deleteAsync(String uplId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteValidateBeforeCall(uplId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for create_export
* @param uplId ID of the upload (required)
* @param exportModel (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call create_exportCall(String uplId, ExportModel exportModel, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = exportModel;
// create path and map variables
String localVarPath = "/uploads/{upl_id}/exports"
.replaceAll("\\{" + "upl_id" + "\\}", localVarApiClient.escapeString(uplId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call create_exportValidateBeforeCall(String uplId, ExportModel exportModel, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uplId' is set
if (uplId == null) {
throw new ApiException("Missing the required parameter 'uplId' when calling create_export(Async)");
}
// verify the required parameter 'exportModel' is set
if (exportModel == null) {
throw new ApiException("Missing the required parameter 'exportModel' when calling create_export(Async)");
}
okhttp3.Call localVarCall = create_exportCall(uplId, exportModel, _callback);
return localVarCall;
}
/**
* create_export
* Campaign Exports can help you understand exactly which records in a campaign could not be created. By initiating and retrieving an export, you will get row-by-row errors for your campaign. For a step-by-step walkthrough of creating a campaign and exporting failures, see our [Campaigns Guide](https://help.lob.com/best-practices/launching-your-first-campaign). Create an export file associated with an upload.
* @param uplId ID of the upload (required)
* @param exportModel (required)
* @return UploadCreateExport
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public UploadCreateExport create_export(String uplId, ExportModel exportModel) throws ApiException {
try {
ApiResponse localVarResp = create_exportWithHttpInfo(uplId, exportModel);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* create_export
* Campaign Exports can help you understand exactly which records in a campaign could not be created. By initiating and retrieving an export, you will get row-by-row errors for your campaign. For a step-by-step walkthrough of creating a campaign and exporting failures, see our [Campaigns Guide](https://help.lob.com/best-practices/launching-your-first-campaign). Create an export file associated with an upload.
* @param uplId ID of the upload (required)
* @param exportModel (required)
* @return ApiResponse<UploadCreateExport>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse create_exportWithHttpInfo(String uplId, ExportModel exportModel) throws ApiException {
try {
okhttp3.Call localVarCall = create_exportValidateBeforeCall(uplId, exportModel, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* create_export (asynchronously)
* Campaign Exports can help you understand exactly which records in a campaign could not be created. By initiating and retrieving an export, you will get row-by-row errors for your campaign. For a step-by-step walkthrough of creating a campaign and exporting failures, see our [Campaigns Guide](https://help.lob.com/best-practices/launching-your-first-campaign). Create an export file associated with an upload.
* @param uplId ID of the upload (required)
* @param exportModel (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
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call create_exportAsync(String uplId, ExportModel exportModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = create_exportValidateBeforeCall(uplId, exportModel, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for upload_file
* @param uplId ID of the upload (required)
* @param file (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
202
Successful Response
-
422
Validation Error
-
*/
public okhttp3.Call upload_fileCall(String uplId, Object file, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/uploads/{upl_id}/file"
.replaceAll("\\{" + "upl_id" + "\\}", localVarApiClient.escapeString(uplId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (file != null) {
localVarFormParams.put("file", file);
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"multipart/form-data"
};
final String localVarContentType = file != null ? "multipart/form-data" : localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call upload_fileValidateBeforeCall(String uplId, Object file, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uplId' is set
if (uplId == null) {
throw new ApiException("Missing the required parameter 'uplId' when calling upload_file(Async)");
}
// verify the required parameter 'file' is set
if (file == null) {
throw new ApiException("Missing the required parameter 'file' when calling upload_file(Async)");
}
okhttp3.Call localVarCall = upload_fileCall(uplId, file, _callback);
return localVarCall;
}
/**
* upload_file
* Upload an [audience file](https://help.lob.com/best-practices/campaign-audience-guide) and associate it with an upload.
* @param uplId ID of the upload (required)
* @param file (required)
* @return UploadFile
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
202
Successful Response
-
422
Validation Error
-
*/
public UploadFile upload_file(String uplId, Object file) throws ApiException {
try {
ApiResponse localVarResp = upload_fileWithHttpInfo(uplId, file);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* upload_file
* Upload an [audience file](https://help.lob.com/best-practices/campaign-audience-guide) and associate it with an upload.
* @param uplId ID of the upload (required)
* @param file (required)
* @return ApiResponse<UploadFile>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
202
Successful Response
-
422
Validation Error
-
*/
public ApiResponse upload_fileWithHttpInfo(String uplId, Object file) throws ApiException {
try {
okhttp3.Call localVarCall = upload_fileValidateBeforeCall(uplId, file, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* upload_file (asynchronously)
* Upload an [audience file](https://help.lob.com/best-practices/campaign-audience-guide) and associate it with an upload.
* @param uplId ID of the upload (required)
* @param file (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
* @http.response.details
Status Code
Description
Response Headers
202
Successful Response
-
422
Validation Error
-
*/
public okhttp3.Call upload_fileAsync(String uplId, Object file, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = upload_fileValidateBeforeCall(uplId, file, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for update
* @param uplId id of the upload (required)
* @param uploadUpdatable (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call updateCall(String uplId, UploadUpdatable uploadUpdatable, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = uploadUpdatable;
// create path and map variables
String localVarPath = "/uploads/{upl_id}"
.replaceAll("\\{" + "upl_id" + "\\}", localVarApiClient.escapeString(uplId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateValidateBeforeCall(String uplId, UploadUpdatable uploadUpdatable, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'uplId' is set
if (uplId == null) {
throw new ApiException("Missing the required parameter 'uplId' when calling update(Async)");
}
// verify the required parameter 'uploadUpdatable' is set
if (uploadUpdatable == null) {
throw new ApiException("Missing the required parameter 'uploadUpdatable' when calling update(Async)");
}
okhttp3.Call localVarCall = updateCall(uplId, uploadUpdatable, _callback);
return localVarCall;
}
/**
* update
* Update the details of an existing upload. You need only supply the unique identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @param uploadUpdatable (required)
* @return Upload
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Upload update(String uplId, UploadUpdatable uploadUpdatable) throws ApiException {
try {
ApiResponse localVarResp = updateWithHttpInfo(uplId, uploadUpdatable);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* update
* Update the details of an existing upload. You need only supply the unique identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @param uploadUpdatable (required)
* @return ApiResponse<Upload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse updateWithHttpInfo(String uplId, UploadUpdatable uploadUpdatable) throws ApiException {
try {
okhttp3.Call localVarCall = updateValidateBeforeCall(uplId, uploadUpdatable, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* update (asynchronously)
* Update the details of an existing upload. You need only supply the unique identifier that was returned upon upload creation.
* @param uplId id of the upload (required)
* @param uploadUpdatable (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
* @http.response.details
Status Code
Description
Response Headers
200
Returns an upload object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call updateAsync(String uplId, UploadUpdatable uploadUpdatable, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateValidateBeforeCall(uplId, uploadUpdatable, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for list
* @param campaignId id of the campaign (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
An array of matching uploads. Each entry in the array is a separate upload.
-
*/
public okhttp3.Call listCall(String campaignId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/uploads";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (campaignId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignId", campaignId));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "basicAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listValidateBeforeCall(String campaignId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listCall(campaignId, _callback);
return localVarCall;
}
/**
* list
* Returns a list of your uploads. Optionally, filter uploads by campaign.
* @param campaignId id of the campaign (optional)
* @return List<Upload>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
An array of matching uploads. Each entry in the array is a separate upload.
-
*/
public List list(String campaignId) throws ApiException {
try {
ApiResponse> localVarResp = listWithHttpInfo(campaignId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* list
* Returns a list of your uploads. Optionally, filter uploads by campaign.
* @param campaignId id of the campaign (optional)
* @return ApiResponse<List<Upload>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
An array of matching uploads. Each entry in the array is a separate upload.
-
*/
public ApiResponse> listWithHttpInfo(String campaignId) throws ApiException {
try {
okhttp3.Call localVarCall = listValidateBeforeCall(campaignId, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* list (asynchronously)
* Returns a list of your uploads. Optionally, filter uploads by campaign.
* @param campaignId id of the campaign (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
* @http.response.details
Status Code
Description
Response Headers
200
An array of matching uploads. Each entry in the array is a separate upload.
-
*/
public okhttp3.Call listAsync(String campaignId, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listValidateBeforeCall(campaignId, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}