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.CreativePatch;
import com.lob.model.CreativeResponse;
import com.lob.model.CreativeWritable;
import com.lob.model.LobError;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CreativesApi {
private ApiClient localVarApiClient;
public CreativesApi() {
this(Configuration.getDefaultApiClient());
}
public CreativesApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for create
* @param creativeWritable (required)
* @param xLangOutput * `native` - Translate response to the native language of the country in the request * `match` - match the response to the language in the request Default response is in English. (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
Creative created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createCall(CreativeWritable creativeWritable, String xLangOutput, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = creativeWritable;
// create path and map variables
String localVarPath = "/creatives";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (xLangOutput != null) {
localVarHeaderParams.put("x-lang-output", localVarApiClient.parameterToString(xLangOutput));
}
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(CreativeWritable creativeWritable, String xLangOutput, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'creativeWritable' is set
if (creativeWritable == null) {
throw new ApiException("Missing the required parameter 'creativeWritable' when calling create(Async)");
}
okhttp3.Call localVarCall = createCall(creativeWritable, xLangOutput, _callback);
return localVarCall;
}
/**
* create
* Creates a new creative with the provided properties
* @param creativeWritable (required)
* @param xLangOutput * `native` - Translate response to the native language of the country in the request * `match` - match the response to the language in the request Default response is in English. (optional)
* @return CreativeResponse
* @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
Creative created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public CreativeResponse create(CreativeWritable creativeWritable, String xLangOutput) throws ApiException {
try {
ApiResponse localVarResp = createWithHttpInfo(creativeWritable, xLangOutput);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* create
* Creates a new creative with the provided properties
* @param creativeWritable (required)
* @param xLangOutput * `native` - Translate response to the native language of the country in the request * `match` - match the response to the language in the request Default response is in English. (optional)
* @return ApiResponse<CreativeResponse>
* @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
Creative created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse createWithHttpInfo(CreativeWritable creativeWritable, String xLangOutput) throws ApiException {
try {
okhttp3.Call localVarCall = createValidateBeforeCall(creativeWritable, xLangOutput, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* create (asynchronously)
* Creates a new creative with the provided properties
* @param creativeWritable (required)
* @param xLangOutput * `native` - Translate response to the native language of the country in the request * `match` - match the response to the language in the request Default response is in English. (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
Creative created successfully
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call createAsync(CreativeWritable creativeWritable, String xLangOutput, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(creativeWritable, xLangOutput, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for get
* @param crvId id of the creative (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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getCall(String crvId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/creatives/{crv_id}"
.replaceAll("\\{" + "crv_id" + "\\}", localVarApiClient.escapeString(crvId.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 crvId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'crvId' is set
if (crvId == null) {
throw new ApiException("Missing the required parameter 'crvId' when calling get(Async)");
}
okhttp3.Call localVarCall = getCall(crvId, _callback);
return localVarCall;
}
/**
* get
* Retrieves the details of an existing creative. You need only supply the unique creative identifier that was returned upon creative creation.
* @param crvId id of the creative (required)
* @return CreativeResponse
* @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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public CreativeResponse get(String crvId) throws ApiException {
try {
ApiResponse localVarResp = getWithHttpInfo(crvId);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* get
* Retrieves the details of an existing creative. You need only supply the unique creative identifier that was returned upon creative creation.
* @param crvId id of the creative (required)
* @return ApiResponse<CreativeResponse>
* @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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse getWithHttpInfo(String crvId) throws ApiException {
try {
okhttp3.Call localVarCall = getValidateBeforeCall(crvId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* get (asynchronously)
* Retrieves the details of an existing creative. You need only supply the unique creative identifier that was returned upon creative creation.
* @param crvId id of the creative (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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call getAsync(String crvId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(crvId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for update
* @param crvId id of the creative (required)
* @param creativePatch (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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call updateCall(String crvId, CreativePatch creativePatch, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = creativePatch;
// create path and map variables
String localVarPath = "/creatives/{crv_id}"
.replaceAll("\\{" + "crv_id" + "\\}", localVarApiClient.escapeString(crvId.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", "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, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateValidateBeforeCall(String crvId, CreativePatch creativePatch, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'crvId' is set
if (crvId == null) {
throw new ApiException("Missing the required parameter 'crvId' when calling update(Async)");
}
// verify the required parameter 'creativePatch' is set
if (creativePatch == null) {
throw new ApiException("Missing the required parameter 'creativePatch' when calling update(Async)");
}
okhttp3.Call localVarCall = updateCall(crvId, creativePatch, _callback);
return localVarCall;
}
/**
* update
* Update the details of an existing creative. You need only supply the unique identifier that was returned upon creative creation.
* @param crvId id of the creative (required)
* @param creativePatch (required)
* @return CreativeResponse
* @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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public CreativeResponse update(String crvId, CreativePatch creativePatch) throws ApiException {
try {
ApiResponse localVarResp = updateWithHttpInfo(crvId, creativePatch);
return localVarResp.getData();
} catch (ApiException e) {
throw e;
}
}
/**
* update
* Update the details of an existing creative. You need only supply the unique identifier that was returned upon creative creation.
* @param crvId id of the creative (required)
* @param creativePatch (required)
* @return ApiResponse<CreativeResponse>
* @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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public ApiResponse updateWithHttpInfo(String crvId, CreativePatch creativePatch) throws ApiException {
try {
okhttp3.Call localVarCall = updateValidateBeforeCall(crvId, creativePatch, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
throw e;
}
}
/**
* update (asynchronously)
* Update the details of an existing creative. You need only supply the unique identifier that was returned upon creative creation.
* @param crvId id of the creative (required)
* @param creativePatch (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 creative object
-
0
Lob uses RESTful HTTP response codes to indicate success or failure of an API request.
-
*/
public okhttp3.Call updateAsync(String crvId, CreativePatch creativePatch, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateValidateBeforeCall(crvId, creativePatch, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}