All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lob.api.client.TemplatesApi Maven / Gradle / Ivy

The newest version!
/*
 * 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 java.time.OffsetDateTime; import com.lob.model.Template; import com.lob.model.TemplateDeletion; import com.lob.model.TemplateList; import com.lob.model.TemplateUpdate; import com.lob.model.TemplateWritable; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class TemplatesApi { private ApiClient localVarApiClient; public TemplatesApi() { this(Configuration.getDefaultApiClient()); } public TemplatesApi(ApiClient apiClient) { this.localVarApiClient = apiClient; } public ApiClient getApiClient() { return localVarApiClient; } public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } /** * Build call for create * @param templateWritable (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 template object * ratelimit-limit -
* ratelimit-remaining -
* ratelimit-reset -
0 Lob uses RESTful HTTP response codes to indicate success or failure of an API request. -
*/ public okhttp3.Call createCall(TemplateWritable templateWritable, final ApiCallback _callback) throws ApiException { Object localVarPostBody = templateWritable; // create path and map variables String localVarPath = "/templates"; 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createValidateBeforeCall(TemplateWritable templateWritable, final ApiCallback _callback) throws ApiException { // verify the required parameter 'templateWritable' is set if (templateWritable == null) { throw new ApiException("Missing the required parameter 'templateWritable' when calling create(Async)"); } okhttp3.Call localVarCall = createCall(templateWritable, _callback); return localVarCall; } /** * create * Creates a new template for use with the Print & Mail API. In Live mode, you can only have as many non-deleted templates as allotted in your current [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions). If you attempt to create a template past your limit, you will receive a `403` error. There is no limit in Test mode. * @param templateWritable (required) * @return Template * @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 template object * ratelimit-limit -
* ratelimit-remaining -
* ratelimit-reset -
0 Lob uses RESTful HTTP response codes to indicate success or failure of an API request. -
*/ public Template create(TemplateWritable templateWritable) throws ApiException { try { ApiResponse