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.
/*
* MailSlurp API
* MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
*
* The version of the OpenAPI document: 6.5.2
* 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.mailslurp.apis;
import com.mailslurp.clients.ApiCallback;
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.ApiResponse;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.Pair;
import com.mailslurp.clients.ProgressRequestBody;
import com.mailslurp.clients.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.mailslurp.models.CreateTemplateOptions;
import java.time.OffsetDateTime;
import com.mailslurp.models.PageTemplateProjection;
import com.mailslurp.models.TemplateDto;
import com.mailslurp.models.TemplatePreview;
import com.mailslurp.models.TemplateProjection;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TemplateControllerApi {
private ApiClient localVarApiClient;
public TemplateControllerApi() {
this(Configuration.getDefaultApiClient());
}
public TemplateControllerApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for createTemplate
* @param createTemplateOptions (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
Created
-
*/
public okhttp3.Call createTemplateCall(CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = createTemplateOptions;
// 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 = {
"*/*"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createTemplateValidateBeforeCall(CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'createTemplateOptions' is set
if (createTemplateOptions == null) {
throw new ApiException("Missing the required parameter 'createTemplateOptions' when calling createTemplate(Async)");
}
okhttp3.Call localVarCall = createTemplateCall(createTemplateOptions, _callback);
return localVarCall;
}
/**
* Create a Template
* Create an email template with variables for use with templated transactional emails.
* @param createTemplateOptions (required)
* @return TemplateDto
* @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
Created
-
*/
public TemplateDto createTemplate(CreateTemplateOptions createTemplateOptions) throws ApiException {
ApiResponse localVarResp = createTemplateWithHttpInfo(createTemplateOptions);
return localVarResp.getData();
}
/**
* Create a Template
* Create an email template with variables for use with templated transactional emails.
* @param createTemplateOptions (required)
* @return ApiResponse<TemplateDto>
* @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
Created
-
*/
public ApiResponse createTemplateWithHttpInfo(CreateTemplateOptions createTemplateOptions) throws ApiException {
okhttp3.Call localVarCall = createTemplateValidateBeforeCall(createTemplateOptions, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a Template (asynchronously)
* Create an email template with variables for use with templated transactional emails.
* @param createTemplateOptions (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
Created
-
*/
public okhttp3.Call createTemplateAsync(CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createTemplateValidateBeforeCall(createTemplateOptions, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deleteTemplate
* @param templateId Template ID (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
No Content
-
*/
public okhttp3.Call deleteTemplateCall(UUID templateId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}"
.replaceAll("\\{" + "templateId" + "\\}", localVarApiClient.escapeString(templateId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteTemplateValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling deleteTemplate(Async)");
}
okhttp3.Call localVarCall = deleteTemplateCall(templateId, _callback);
return localVarCall;
}
/**
* Delete email template
* Delete template
* @param templateId Template ID (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
No Content
-
*/
public void deleteTemplate(UUID templateId) throws ApiException {
deleteTemplateWithHttpInfo(templateId);
}
/**
* Delete email template
* Delete template
* @param templateId Template ID (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
No Content
-
*/
public ApiResponse deleteTemplateWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = deleteTemplateValidateBeforeCall(templateId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete email template (asynchronously)
* Delete template
* @param templateId Template ID (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
No Content
-
*/
public okhttp3.Call deleteTemplateAsync(UUID templateId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteTemplateValidateBeforeCall(templateId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for getAllTemplates
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (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
OK
-
*/
public okhttp3.Call getAllTemplatesCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/paginated";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (size != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size));
}
if (sort != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
}
if (since != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since));
}
if (before != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("before", before));
}
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"*/*"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllTemplatesValidateBeforeCall(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getAllTemplatesCall(page, size, sort, since, before, _callback);
return localVarCall;
}
/**
* List templates
* Get all templates in paginated format
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return PageTemplateProjection
* @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
OK
-
*/
public PageTemplateProjection getAllTemplates(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
ApiResponse localVarResp = getAllTemplatesWithHttpInfo(page, size, sort, since, before);
return localVarResp.getData();
}
/**
* List templates
* Get all templates in paginated format
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (optional)
* @return ApiResponse<PageTemplateProjection>
* @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
OK
-
*/
public ApiResponse getAllTemplatesWithHttpInfo(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before) throws ApiException {
okhttp3.Call localVarCall = getAllTemplatesValidateBeforeCall(page, size, sort, since, before, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List templates (asynchronously)
* Get all templates in paginated format
* @param page Optional page index in list pagination (optional, default to 0)
* @param size Optional page size in list pagination (optional, default to 20)
* @param sort Optional createdAt sort direction ASC or DESC (optional, default to ASC)
* @param since Filter by created at after the given timestamp (optional)
* @param before Filter by created at before the given timestamp (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
OK
-
*/
public okhttp3.Call getAllTemplatesAsync(Integer page, Integer size, String sort, OffsetDateTime since, OffsetDateTime before, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getAllTemplatesValidateBeforeCall(page, size, sort, since, before, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplate
* @param templateId Template ID (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
OK
-
*/
public okhttp3.Call getTemplateCall(UUID templateId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}"
.replaceAll("\\{" + "templateId" + "\\}", localVarApiClient.escapeString(templateId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"*/*"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplateValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling getTemplate(Async)");
}
okhttp3.Call localVarCall = getTemplateCall(templateId, _callback);
return localVarCall;
}
/**
* Get template
* Get email template
* @param templateId Template ID (required)
* @return TemplateDto
* @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
OK
-
*/
public TemplateDto getTemplate(UUID templateId) throws ApiException {
ApiResponse localVarResp = getTemplateWithHttpInfo(templateId);
return localVarResp.getData();
}
/**
* Get template
* Get email template
* @param templateId Template ID (required)
* @return ApiResponse<TemplateDto>
* @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
OK
-
*/
public ApiResponse getTemplateWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = getTemplateValidateBeforeCall(templateId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get template (asynchronously)
* Get email template
* @param templateId Template ID (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
OK
-
*/
public okhttp3.Call getTemplateAsync(UUID templateId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplateValidateBeforeCall(templateId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplatePreviewHtml
* @param templateId Template ID (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
OK
-
*/
public okhttp3.Call getTemplatePreviewHtmlCall(UUID templateId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}/preview/html"
.replaceAll("\\{" + "templateId" + "\\}", localVarApiClient.escapeString(templateId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"text/html;charset=utf-8", "text/html"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplatePreviewHtmlValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling getTemplatePreviewHtml(Async)");
}
okhttp3.Call localVarCall = getTemplatePreviewHtmlCall(templateId, _callback);
return localVarCall;
}
/**
* Get template preview HTML
* Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
* @param templateId Template ID (required)
* @return String
* @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
OK
-
*/
public String getTemplatePreviewHtml(UUID templateId) throws ApiException {
ApiResponse localVarResp = getTemplatePreviewHtmlWithHttpInfo(templateId);
return localVarResp.getData();
}
/**
* Get template preview HTML
* Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
* @param templateId Template ID (required)
* @return ApiResponse<String>
* @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
OK
-
*/
public ApiResponse getTemplatePreviewHtmlWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewHtmlValidateBeforeCall(templateId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get template preview HTML (asynchronously)
* Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
* @param templateId Template ID (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
OK
-
*/
public okhttp3.Call getTemplatePreviewHtmlAsync(UUID templateId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewHtmlValidateBeforeCall(templateId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplatePreviewJson
* @param templateId Template ID (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
OK
-
*/
public okhttp3.Call getTemplatePreviewJsonCall(UUID templateId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/templates/{templateId}/preview/json"
.replaceAll("\\{" + "templateId" + "\\}", localVarApiClient.escapeString(templateId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"*/*"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplatePreviewJsonValidateBeforeCall(UUID templateId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling getTemplatePreviewJson(Async)");
}
okhttp3.Call localVarCall = getTemplatePreviewJsonCall(templateId, _callback);
return localVarCall;
}
/**
* Get template preview Json
* Get email template preview with passed template variables in JSON format. Pass template variables as query params.
* @param templateId Template ID (required)
* @return TemplatePreview
* @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
OK
-
*/
public TemplatePreview getTemplatePreviewJson(UUID templateId) throws ApiException {
ApiResponse localVarResp = getTemplatePreviewJsonWithHttpInfo(templateId);
return localVarResp.getData();
}
/**
* Get template preview Json
* Get email template preview with passed template variables in JSON format. Pass template variables as query params.
* @param templateId Template ID (required)
* @return ApiResponse<TemplatePreview>
* @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
OK
-
*/
public ApiResponse getTemplatePreviewJsonWithHttpInfo(UUID templateId) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewJsonValidateBeforeCall(templateId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get template preview Json (asynchronously)
* Get email template preview with passed template variables in JSON format. Pass template variables as query params.
* @param templateId Template ID (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
OK
-
*/
public okhttp3.Call getTemplatePreviewJsonAsync(UUID templateId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatePreviewJsonValidateBeforeCall(templateId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTemplates
* @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
OK
-
*/
public okhttp3.Call getTemplatesCall(final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// 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 = {
"*/*"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTemplatesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatesCall(_callback);
return localVarCall;
}
/**
* List templates
* Get all templates
* @return List<TemplateProjection>
* @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
OK
-
*/
public List getTemplates() throws ApiException {
ApiResponse> localVarResp = getTemplatesWithHttpInfo();
return localVarResp.getData();
}
/**
* List templates
* Get all templates
* @return ApiResponse<List<TemplateProjection>>
* @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
OK
-
*/
public ApiResponse> getTemplatesWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getTemplatesValidateBeforeCall(null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List templates (asynchronously)
* Get all templates
* @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
OK
-
*/
public okhttp3.Call getTemplatesAsync(final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getTemplatesValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateTemplate
* @param templateId Template ID (required)
* @param createTemplateOptions (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
Created
-
*/
public okhttp3.Call updateTemplateCall(UUID templateId, CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = createTemplateOptions;
// create path and map variables
String localVarPath = "/templates/{templateId}"
.replaceAll("\\{" + "templateId" + "\\}", localVarApiClient.escapeString(templateId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"*/*"
};
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[] { "API_KEY" };
return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateTemplateValidateBeforeCall(UUID templateId, CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException("Missing the required parameter 'templateId' when calling updateTemplate(Async)");
}
// verify the required parameter 'createTemplateOptions' is set
if (createTemplateOptions == null) {
throw new ApiException("Missing the required parameter 'createTemplateOptions' when calling updateTemplate(Async)");
}
okhttp3.Call localVarCall = updateTemplateCall(templateId, createTemplateOptions, _callback);
return localVarCall;
}
/**
* Update template
* Update email template
* @param templateId Template ID (required)
* @param createTemplateOptions (required)
* @return TemplateDto
* @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
Created
-
*/
public TemplateDto updateTemplate(UUID templateId, CreateTemplateOptions createTemplateOptions) throws ApiException {
ApiResponse localVarResp = updateTemplateWithHttpInfo(templateId, createTemplateOptions);
return localVarResp.getData();
}
/**
* Update template
* Update email template
* @param templateId Template ID (required)
* @param createTemplateOptions (required)
* @return ApiResponse<TemplateDto>
* @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
Created
-
*/
public ApiResponse updateTemplateWithHttpInfo(UUID templateId, CreateTemplateOptions createTemplateOptions) throws ApiException {
okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, createTemplateOptions, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update template (asynchronously)
* Update email template
* @param templateId Template ID (required)
* @param createTemplateOptions (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
Created
-
*/
public okhttp3.Call updateTemplateAsync(UUID templateId, CreateTemplateOptions createTemplateOptions, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateTemplateValidateBeforeCall(templateId, createTemplateOptions, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}