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.LobError;
import com.lob.model.MailType;
import java.time.OffsetDateTime;
import com.lob.model.Postcard;
import com.lob.model.PostcardDeletion;
import com.lob.model.PostcardEditable;
import com.lob.model.PostcardList;
import com.lob.model.PostcardSize;
import com.lob.model.SortBy3;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PostcardsApi {
private ApiClient localVarApiClient;
public PostcardsApi() {
this(Configuration.getDefaultApiClient());
}
public PostcardsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for create
* @param postcardEditable (required)
* @param idempotencyKey A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). (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
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createCall(PostcardEditable postcardEditable, String idempotencyKey, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = postcardEditable;
// create path and map variables
String localVarPath = "/postcards";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (idempotencyKey != null) {
localVarHeaderParams.put("Idempotency-Key", localVarApiClient.parameterToString(idempotencyKey));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json", "application/x-www-form-urlencoded", "multipart/form-data"
};
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(PostcardEditable postcardEditable, String idempotencyKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'postcardEditable' is set
if (postcardEditable == null) {
throw new ApiException("Missing the required parameter 'postcardEditable' when calling create(Async)");
}
okhttp3.Call localVarCall = createCall(postcardEditable, idempotencyKey, _callback);
return localVarCall;
}
/**
* create
* Creates a new postcard given information
* @param postcardEditable (required)
* @param idempotencyKey A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). (optional)
* @return Postcard
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Postcard create(PostcardEditable postcardEditable, String idempotencyKey) throws ApiException {
try {
ApiResponse localVarResp = createWithHttpInfo(postcardEditable, idempotencyKey);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* create
* Creates a new postcard given information
* @param postcardEditable (required)
* @param idempotencyKey A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). (optional)
* @return ApiResponse<Postcard>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse createWithHttpInfo(PostcardEditable postcardEditable, String idempotencyKey) throws ApiException {
try {
okhttp3.Call localVarCall = createValidateBeforeCall(postcardEditable, idempotencyKey, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* create (asynchronously)
* Creates a new postcard given information
* @param postcardEditable (required)
* @param idempotencyKey A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). (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
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createAsync(PostcardEditable postcardEditable, String idempotencyKey, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(postcardEditable, idempotencyKey, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for cancel
* @param pscId id of the postcard (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
Deleted
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call cancelCall(String pscId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/postcards/{psc_id}"
.replaceAll("\\{" + "psc_id" + "\\}", localVarApiClient.escapeString(pscId.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 cancelValidateBeforeCall(String pscId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'pscId' is set
if (pscId == null) {
throw new ApiException("Missing the required parameter 'pscId' when calling cancel(Async)");
}
okhttp3.Call localVarCall = cancelCall(pscId, _callback);
return localVarCall;
}
/**
* cancel
* Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access.
* @param pscId id of the postcard (required)
* @return PostcardDeletion
* @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
Deleted
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public PostcardDeletion cancel(String pscId) throws ApiException {
try {
ApiResponse localVarResp = cancelWithHttpInfo(pscId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* cancel
* Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access.
* @param pscId id of the postcard (required)
* @return ApiResponse<PostcardDeletion>
* @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
Deleted
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse cancelWithHttpInfo(String pscId) throws ApiException {
try {
okhttp3.Call localVarCall = cancelValidateBeforeCall(pscId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* cancel (asynchronously)
* Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access.
* @param pscId id of the postcard (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
Deleted
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call cancelAsync(String pscId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = cancelValidateBeforeCall(pscId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for get
* @param pscId id of the postcard (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 a postcard object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getCall(String pscId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/postcards/{psc_id}"
.replaceAll("\\{" + "psc_id" + "\\}", localVarApiClient.escapeString(pscId.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 pscId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'pscId' is set
if (pscId == null) {
throw new ApiException("Missing the required parameter 'pscId' when calling get(Async)");
}
okhttp3.Call localVarCall = getCall(pscId, _callback);
return localVarCall;
}
/**
* get
* Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation.
* @param pscId id of the postcard (required)
* @return Postcard
* @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 a postcard object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Postcard get(String pscId) throws ApiException {
try {
ApiResponse localVarResp = getWithHttpInfo(pscId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* get
* Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation.
* @param pscId id of the postcard (required)
* @return ApiResponse<Postcard>
* @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 a postcard object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse getWithHttpInfo(String pscId) throws ApiException {
try {
okhttp3.Call localVarCall = getValidateBeforeCall(pscId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* get (asynchronously)
* Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation.
* @param pscId id of the postcard (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 a postcard object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getAsync(String pscId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(pscId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for list
* @param limit How many results to return. (optional, default to 10)
* @param before A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. (optional)
* @param after A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. (optional)
* @param include Request that the response include the total count by specifying `include[]=total_count`. (optional)
* @param dateCreated Filter by date created. (optional)
* @param metadata Filter by metadata key-value pair`. (optional)
* @param size Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. (optional)
* @param scheduled * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created` (optional)
* @param sendDate Filter by date sent. (optional)
* @param mailType A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States. (optional)
* @param sortBy Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, not both. (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
A dictionary with a data property that contains an array of up to `limit` postcards.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call listCall(Integer limit, String before, String after, List include, Map dateCreated, Map metadata, List size, Boolean scheduled, Map sendDate, MailType mailType, SortBy3 sortBy, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/postcards";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (limit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
if (after != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("after", after));
}
if (include != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "include", include));
}
if (dateCreated != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("date_created", dateCreated));
}
if (metadata != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("metadata", metadata));
}
if (size != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "size", size));
}
if (scheduled != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("scheduled", scheduled));
}
if (sendDate != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("send_date", sendDate));
}
if (mailType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("mail_type", mailType));
}
if (sortBy != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort_by", sortBy));
}
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(Integer limit, String before, String after, List include, Map dateCreated, Map metadata, List size, Boolean scheduled, Map sendDate, MailType mailType, SortBy3 sortBy, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listCall(limit, before, after, include, dateCreated, metadata, size, scheduled, sendDate, mailType, sortBy, _callback);
return localVarCall;
}
/**
* list
* Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses appearing first.
* @param limit How many results to return. (optional, default to 10)
* @param before A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. (optional)
* @param after A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. (optional)
* @param include Request that the response include the total count by specifying `include[]=total_count`. (optional)
* @param dateCreated Filter by date created. (optional)
* @param metadata Filter by metadata key-value pair`. (optional)
* @param size Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. (optional)
* @param scheduled * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created` (optional)
* @param sendDate Filter by date sent. (optional)
* @param mailType A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States. (optional)
* @param sortBy Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, not both. (optional)
* @return PostcardList
* @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
A dictionary with a data property that contains an array of up to `limit` postcards.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public PostcardList list(Integer limit, String before, String after, List include, Map dateCreated, Map metadata, List size, Boolean scheduled, Map sendDate, MailType mailType, SortBy3 sortBy) throws ApiException {
try {
ApiResponse localVarResp = listWithHttpInfo(limit, before, after, include, dateCreated, metadata, size, scheduled, sendDate, mailType, sortBy);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* list
* Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses appearing first.
* @param limit How many results to return. (optional, default to 10)
* @param before A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. (optional)
* @param after A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. (optional)
* @param include Request that the response include the total count by specifying `include[]=total_count`. (optional)
* @param dateCreated Filter by date created. (optional)
* @param metadata Filter by metadata key-value pair`. (optional)
* @param size Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. (optional)
* @param scheduled * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created` (optional)
* @param sendDate Filter by date sent. (optional)
* @param mailType A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States. (optional)
* @param sortBy Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, not both. (optional)
* @return ApiResponse<PostcardList>
* @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
A dictionary with a data property that contains an array of up to `limit` postcards.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse listWithHttpInfo(Integer limit, String before, String after, List include, Map dateCreated, Map metadata, List size, Boolean scheduled, Map sendDate, MailType mailType, SortBy3 sortBy) throws ApiException {
try {
okhttp3.Call localVarCall = listValidateBeforeCall(limit, before, after, include, dateCreated, metadata, size, scheduled, sendDate, mailType, sortBy, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* list (asynchronously)
* Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses appearing first.
* @param limit How many results to return. (optional, default to 10)
* @param before A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. (optional)
* @param after A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. (optional)
* @param include Request that the response include the total count by specifying `include[]=total_count`. (optional)
* @param dateCreated Filter by date created. (optional)
* @param metadata Filter by metadata key-value pair`. (optional)
* @param size Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations. (optional)
* @param scheduled * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created` (optional)
* @param sendDate Filter by date sent. (optional)
* @param mailType A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States. (optional)
* @param sortBy Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, not both. (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
A dictionary with a data property that contains an array of up to `limit` postcards.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call listAsync(Integer limit, String before, String after, List include, Map dateCreated, Map metadata, List size, Boolean scheduled, Map sendDate, MailType mailType, SortBy3 sortBy, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listValidateBeforeCall(limit, before, after, include, dateCreated, metadata, size, scheduled, sendDate, mailType, sortBy, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}