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.Address;
import com.lob.model.AddressDeletion;
import com.lob.model.AddressEditable;
import com.lob.model.AddressList;
import com.lob.model.LobError;
import java.time.OffsetDateTime;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AddressesApi {
private ApiClient localVarApiClient;
public AddressesApi() {
this(Configuration.getDefaultApiClient());
}
public AddressesApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for create
* @param addressEditable (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
Echos the writable fields of a newly created address object.
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Address create(AddressEditable addressEditable) throws ApiException {
try {
ApiResponse localVarResp = createWithHttpInfo(addressEditable);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* create
* Creates a new address given information
* @param addressEditable (required)
* @return ApiResponse<Address>
* @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
Echos the writable fields of a newly created address object.
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse createWithHttpInfo(AddressEditable addressEditable) throws ApiException {
try {
okhttp3.Call localVarCall = createValidateBeforeCall(addressEditable, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* create (asynchronously)
* Creates a new address given information
* @param addressEditable (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
Echos the writable fields of a newly created address object.
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createAsync(AddressEditable addressEditable, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(addressEditable, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for delete
* @param adrId id of the address (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 deleteCall(String adrId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/addresses/{adr_id}"
.replaceAll("\\{" + "adr_id" + "\\}", localVarApiClient.escapeString(adrId.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 adrId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'adrId' is set
if (adrId == null) {
throw new ApiException("Missing the required parameter 'adrId' when calling delete(Async)");
}
okhttp3.Call localVarCall = deleteCall(adrId, _callback);
return localVarCall;
}
/**
* delete
* Deletes the details of an existing address.
* @param adrId id of the address (required)
* @return AddressDeletion
* @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 AddressDeletion delete(String adrId) throws ApiException {
try {
ApiResponse localVarResp = deleteWithHttpInfo(adrId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* delete
* Deletes the details of an existing address.
* @param adrId id of the address (required)
* @return ApiResponse<AddressDeletion>
* @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 deleteWithHttpInfo(String adrId) throws ApiException {
try {
okhttp3.Call localVarCall = deleteValidateBeforeCall(adrId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* delete (asynchronously)
* Deletes the details of an existing address.
* @param adrId id of the address (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @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 deleteAsync(String adrId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteValidateBeforeCall(adrId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for get
* @param adrId id of the address (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 address object if a valid identifier was provided.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getCall(String adrId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/addresses/{adr_id}"
.replaceAll("\\{" + "adr_id" + "\\}", localVarApiClient.escapeString(adrId.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 adrId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'adrId' is set
if (adrId == null) {
throw new ApiException("Missing the required parameter 'adrId' when calling get(Async)");
}
okhttp3.Call localVarCall = getCall(adrId, _callback);
return localVarCall;
}
/**
* get
* Retrieves the details of an existing address.
* @param adrId id of the address (required)
* @return Address
* @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 address object if a valid identifier was provided.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public Address get(String adrId) throws ApiException {
try {
ApiResponse localVarResp = getWithHttpInfo(adrId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* get
* Retrieves the details of an existing address.
* @param adrId id of the address (required)
* @return ApiResponse<Address>
* @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 address object if a valid identifier was provided.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse getWithHttpInfo(String adrId) throws ApiException {
try {
okhttp3.Call localVarCall = getValidateBeforeCall(adrId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* get (asynchronously)
* Retrieves the details of an existing address.
* @param adrId id of the address (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Returns an address object if a valid identifier was provided.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getAsync(String adrId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(adrId, _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 _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` addresses.
-
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, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/addresses";
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));
}
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, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listCall(limit, before, after, include, dateCreated, metadata, _callback);
return localVarCall;
}
/**
* list
* Returns a list of your addresses.
* @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)
* @return AddressList
* @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` addresses.
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public AddressList list(Integer limit, String before, String after, List include, Map dateCreated, Map metadata) throws ApiException {
try {
ApiResponse localVarResp = listWithHttpInfo(limit, before, after, include, dateCreated, metadata);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* list
* Returns a list of your addresses.
* @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)
* @return ApiResponse<AddressList>
* @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` addresses.
-
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) throws ApiException {
try {
okhttp3.Call localVarCall = listValidateBeforeCall(limit, before, after, include, dateCreated, metadata, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* list (asynchronously)
* Returns a list of your addresses.
* @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 _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` addresses.
-
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, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listValidateBeforeCall(limit, before, after, include, dateCreated, metadata, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}