ClickSend.Api.EmailMarketingApi Maven / Gradle / Ivy
The newest version!
/*
* ClickSend v3 API
* This is an official SDK for [ClickSend](https://clicksend.com) Below you will find a current list of the available methods for clicksend. *NOTE: You will need to create a free account to use the API. You can register [here](https://dashboard.clicksend.com/#/signup/step1/)..*
*
* OpenAPI spec version: 3.1
* Contact: [email protected]
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package ClickSend.Api;
import ClickSend.ApiCallback;
import ClickSend.ApiClient;
import ClickSend.ApiException;
import ClickSend.ApiResponse;
import ClickSend.Configuration;
import ClickSend.Pair;
import ClickSend.ProgressRequestBody;
import ClickSend.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ClickSend.Model.EmailAddress;
import ClickSend.Model.EmailCampaign;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class EmailMarketingApi {
private ApiClient apiClient;
public EmailMarketingApi() {
this(Configuration.getDefaultApiClient());
}
public EmailMarketingApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for allowedEmailAddressGet
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call allowedEmailAddressGetCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email/addresses";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (page != null)
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call allowedEmailAddressGetValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = allowedEmailAddressGetCall(page, limit, progressListener, progressRequestListener);
return call;
}
/**
* Get all email addresses
* Get all email addresses
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String allowedEmailAddressGet(Integer page, Integer limit) throws ApiException {
ApiResponse resp = allowedEmailAddressGetWithHttpInfo(page, limit);
return resp.getData();
}
/**
* Get all email addresses
* Get all email addresses
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse allowedEmailAddressGetWithHttpInfo(Integer page, Integer limit) throws ApiException {
com.squareup.okhttp.Call call = allowedEmailAddressGetValidateBeforeCall(page, limit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get all email addresses (asynchronously)
* Get all email addresses
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @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
*/
public com.squareup.okhttp.Call allowedEmailAddressGetAsync(Integer page, Integer limit, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = allowedEmailAddressGetValidateBeforeCall(page, limit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for allowedEmailAddressPost
* @param emailAddress (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call allowedEmailAddressPostCall(EmailAddress emailAddress, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = emailAddress;
// create path and map variables
String localVarPath = "/email/addresses";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call allowedEmailAddressPostValidateBeforeCall(EmailAddress emailAddress, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = allowedEmailAddressPostCall(emailAddress, progressListener, progressRequestListener);
return call;
}
/**
* Create allowed Email Address
* Create allowed Email Address
* @param emailAddress (optional)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String allowedEmailAddressPost(EmailAddress emailAddress) throws ApiException {
ApiResponse resp = allowedEmailAddressPostWithHttpInfo(emailAddress);
return resp.getData();
}
/**
* Create allowed Email Address
* Create allowed Email Address
* @param emailAddress (optional)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse allowedEmailAddressPostWithHttpInfo(EmailAddress emailAddress) throws ApiException {
com.squareup.okhttp.Call call = allowedEmailAddressPostValidateBeforeCall(emailAddress, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create allowed Email Address (asynchronously)
* Create allowed Email Address
* @param emailAddress (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
*/
public com.squareup.okhttp.Call allowedEmailAddressPostAsync(EmailAddress emailAddress, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = allowedEmailAddressPostValidateBeforeCall(emailAddress, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for cancelEmailCampaignPut
* @param emailCampaignId Allowed email campaign id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call cancelEmailCampaignPutCall(Integer emailCampaignId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email-campaigns/{email_campaign_id}/cancel"
.replaceAll("\\{" + "email_campaign_id" + "\\}", apiClient.escapeString(emailCampaignId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call cancelEmailCampaignPutValidateBeforeCall(Integer emailCampaignId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaignId' is set
if (emailCampaignId == null) {
throw new ApiException("Missing the required parameter 'emailCampaignId' when calling cancelEmailCampaignPut(Async)");
}
com.squareup.okhttp.Call call = cancelEmailCampaignPutCall(emailCampaignId, progressListener, progressRequestListener);
return call;
}
/**
* Cancel email campaign
* Cancel email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String cancelEmailCampaignPut(Integer emailCampaignId) throws ApiException {
ApiResponse resp = cancelEmailCampaignPutWithHttpInfo(emailCampaignId);
return resp.getData();
}
/**
* Cancel email campaign
* Cancel email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse cancelEmailCampaignPutWithHttpInfo(Integer emailCampaignId) throws ApiException {
com.squareup.okhttp.Call call = cancelEmailCampaignPutValidateBeforeCall(emailCampaignId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Cancel email campaign (asynchronously)
* Cancel email campaign
* @param emailCampaignId Allowed email campaign 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
*/
public com.squareup.okhttp.Call cancelEmailCampaignPutAsync(Integer emailCampaignId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = cancelEmailCampaignPutValidateBeforeCall(emailCampaignId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignGet
* @param emailCampaignId Allowed email campaign id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignGetCall(Integer emailCampaignId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email-campaigns/{email_campaign_id}"
.replaceAll("\\{" + "email_campaign_id" + "\\}", apiClient.escapeString(emailCampaignId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignGetValidateBeforeCall(Integer emailCampaignId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaignId' is set
if (emailCampaignId == null) {
throw new ApiException("Missing the required parameter 'emailCampaignId' when calling emailCampaignGet(Async)");
}
com.squareup.okhttp.Call call = emailCampaignGetCall(emailCampaignId, progressListener, progressRequestListener);
return call;
}
/**
* Get specific email campaign
* Get specific email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignGet(Integer emailCampaignId) throws ApiException {
ApiResponse resp = emailCampaignGetWithHttpInfo(emailCampaignId);
return resp.getData();
}
/**
* Get specific email campaign
* Get specific email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignGetWithHttpInfo(Integer emailCampaignId) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignGetValidateBeforeCall(emailCampaignId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get specific email campaign (asynchronously)
* Get specific email campaign
* @param emailCampaignId Allowed email campaign 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
*/
public com.squareup.okhttp.Call emailCampaignGetAsync(Integer emailCampaignId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignGetValidateBeforeCall(emailCampaignId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignHistoryExportGet
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignHistoryExportGetCall(Integer emailCampaignId, Integer dateFrom, Integer dateTo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email-campaigns/{email_campaign_id}/history/export"
.replaceAll("\\{" + "email_campaign_id" + "\\}", apiClient.escapeString(emailCampaignId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (dateFrom != null)
localVarQueryParams.addAll(apiClient.parameterToPair("date_from", dateFrom));
if (dateTo != null)
localVarQueryParams.addAll(apiClient.parameterToPair("date_to", dateTo));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignHistoryExportGetValidateBeforeCall(Integer emailCampaignId, Integer dateFrom, Integer dateTo, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaignId' is set
if (emailCampaignId == null) {
throw new ApiException("Missing the required parameter 'emailCampaignId' when calling emailCampaignHistoryExportGet(Async)");
}
com.squareup.okhttp.Call call = emailCampaignHistoryExportGetCall(emailCampaignId, dateFrom, dateTo, progressListener, progressRequestListener);
return call;
}
/**
* Export specific email campaign history
* Export specific email campaign history
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignHistoryExportGet(Integer emailCampaignId, Integer dateFrom, Integer dateTo) throws ApiException {
ApiResponse resp = emailCampaignHistoryExportGetWithHttpInfo(emailCampaignId, dateFrom, dateTo);
return resp.getData();
}
/**
* Export specific email campaign history
* Export specific email campaign history
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignHistoryExportGetWithHttpInfo(Integer emailCampaignId, Integer dateFrom, Integer dateTo) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignHistoryExportGetValidateBeforeCall(emailCampaignId, dateFrom, dateTo, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Export specific email campaign history (asynchronously)
* Export specific email campaign history
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (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
*/
public com.squareup.okhttp.Call emailCampaignHistoryExportGetAsync(Integer emailCampaignId, Integer dateFrom, Integer dateTo, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignHistoryExportGetValidateBeforeCall(emailCampaignId, dateFrom, dateTo, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignHistoryGet
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignHistoryGetCall(Integer emailCampaignId, Integer dateFrom, Integer dateTo, Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email-campaigns/{email_campaign_id}/history"
.replaceAll("\\{" + "email_campaign_id" + "\\}", apiClient.escapeString(emailCampaignId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (dateFrom != null)
localVarQueryParams.addAll(apiClient.parameterToPair("date_from", dateFrom));
if (dateTo != null)
localVarQueryParams.addAll(apiClient.parameterToPair("date_to", dateTo));
if (page != null)
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignHistoryGetValidateBeforeCall(Integer emailCampaignId, Integer dateFrom, Integer dateTo, Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaignId' is set
if (emailCampaignId == null) {
throw new ApiException("Missing the required parameter 'emailCampaignId' when calling emailCampaignHistoryGet(Async)");
}
com.squareup.okhttp.Call call = emailCampaignHistoryGetCall(emailCampaignId, dateFrom, dateTo, page, limit, progressListener, progressRequestListener);
return call;
}
/**
* Get specific email campaign history
* Get specific email campaign history
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignHistoryGet(Integer emailCampaignId, Integer dateFrom, Integer dateTo, Integer page, Integer limit) throws ApiException {
ApiResponse resp = emailCampaignHistoryGetWithHttpInfo(emailCampaignId, dateFrom, dateTo, page, limit);
return resp.getData();
}
/**
* Get specific email campaign history
* Get specific email campaign history
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignHistoryGetWithHttpInfo(Integer emailCampaignId, Integer dateFrom, Integer dateTo, Integer page, Integer limit) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignHistoryGetValidateBeforeCall(emailCampaignId, dateFrom, dateTo, page, limit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get specific email campaign history (asynchronously)
* Get specific email campaign history
* @param emailCampaignId Allowed email campaign id (required)
* @param dateFrom Start date (optional)
* @param dateTo End date (optional)
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @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
*/
public com.squareup.okhttp.Call emailCampaignHistoryGetAsync(Integer emailCampaignId, Integer dateFrom, Integer dateTo, Integer page, Integer limit, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignHistoryGetValidateBeforeCall(emailCampaignId, dateFrom, dateTo, page, limit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignPost
* @param emailCampaign Email model (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignPostCall(EmailCampaign emailCampaign, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = emailCampaign;
// create path and map variables
String localVarPath = "/email-campaigns/send";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignPostValidateBeforeCall(EmailCampaign emailCampaign, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaign' is set
if (emailCampaign == null) {
throw new ApiException("Missing the required parameter 'emailCampaign' when calling emailCampaignPost(Async)");
}
com.squareup.okhttp.Call call = emailCampaignPostCall(emailCampaign, progressListener, progressRequestListener);
return call;
}
/**
* Send email campaign
* Send email campaign
* @param emailCampaign Email model (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignPost(EmailCampaign emailCampaign) throws ApiException {
ApiResponse resp = emailCampaignPostWithHttpInfo(emailCampaign);
return resp.getData();
}
/**
* Send email campaign
* Send email campaign
* @param emailCampaign Email model (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignPostWithHttpInfo(EmailCampaign emailCampaign) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignPostValidateBeforeCall(emailCampaign, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send email campaign (asynchronously)
* Send email campaign
* @param emailCampaign Email model (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
*/
public com.squareup.okhttp.Call emailCampaignPostAsync(EmailCampaign emailCampaign, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignPostValidateBeforeCall(emailCampaign, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignPricePost
* @param emailCampaign Email model (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignPricePostCall(EmailCampaign emailCampaign, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = emailCampaign;
// create path and map variables
String localVarPath = "/email-campaigns/price";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignPricePostValidateBeforeCall(EmailCampaign emailCampaign, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaign' is set
if (emailCampaign == null) {
throw new ApiException("Missing the required parameter 'emailCampaign' when calling emailCampaignPricePost(Async)");
}
com.squareup.okhttp.Call call = emailCampaignPricePostCall(emailCampaign, progressListener, progressRequestListener);
return call;
}
/**
* Calculate email campaign price
* Calculate email campaign price
* @param emailCampaign Email model (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignPricePost(EmailCampaign emailCampaign) throws ApiException {
ApiResponse resp = emailCampaignPricePostWithHttpInfo(emailCampaign);
return resp.getData();
}
/**
* Calculate email campaign price
* Calculate email campaign price
* @param emailCampaign Email model (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignPricePostWithHttpInfo(EmailCampaign emailCampaign) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignPricePostValidateBeforeCall(emailCampaign, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Calculate email campaign price (asynchronously)
* Calculate email campaign price
* @param emailCampaign Email model (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
*/
public com.squareup.okhttp.Call emailCampaignPricePostAsync(EmailCampaign emailCampaign, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignPricePostValidateBeforeCall(emailCampaign, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignPut
* @param emailCampaignId Allowed email campaign id (required)
* @param emailCampaign Email model (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignPutCall(Integer emailCampaignId, EmailCampaign emailCampaign, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = emailCampaign;
// create path and map variables
String localVarPath = "/email-campaigns/{email_campaign_id}"
.replaceAll("\\{" + "email_campaign_id" + "\\}", apiClient.escapeString(emailCampaignId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignPutValidateBeforeCall(Integer emailCampaignId, EmailCampaign emailCampaign, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailCampaignId' is set
if (emailCampaignId == null) {
throw new ApiException("Missing the required parameter 'emailCampaignId' when calling emailCampaignPut(Async)");
}
// verify the required parameter 'emailCampaign' is set
if (emailCampaign == null) {
throw new ApiException("Missing the required parameter 'emailCampaign' when calling emailCampaignPut(Async)");
}
com.squareup.okhttp.Call call = emailCampaignPutCall(emailCampaignId, emailCampaign, progressListener, progressRequestListener);
return call;
}
/**
* Edit email campaign
* Edit email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @param emailCampaign Email model (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignPut(Integer emailCampaignId, EmailCampaign emailCampaign) throws ApiException {
ApiResponse resp = emailCampaignPutWithHttpInfo(emailCampaignId, emailCampaign);
return resp.getData();
}
/**
* Edit email campaign
* Edit email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @param emailCampaign Email model (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignPutWithHttpInfo(Integer emailCampaignId, EmailCampaign emailCampaign) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignPutValidateBeforeCall(emailCampaignId, emailCampaign, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Edit email campaign (asynchronously)
* Edit email campaign
* @param emailCampaignId Allowed email campaign id (required)
* @param emailCampaign Email model (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
*/
public com.squareup.okhttp.Call emailCampaignPutAsync(Integer emailCampaignId, EmailCampaign emailCampaign, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignPutValidateBeforeCall(emailCampaignId, emailCampaign, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for emailCampaignsGet
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call emailCampaignsGetCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email-campaigns";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (page != null)
localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
if (limit != null)
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call emailCampaignsGetValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignsGetCall(page, limit, progressListener, progressRequestListener);
return call;
}
/**
* Get all email campaigns
* Get all email campaigns
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String emailCampaignsGet(Integer page, Integer limit) throws ApiException {
ApiResponse resp = emailCampaignsGetWithHttpInfo(page, limit);
return resp.getData();
}
/**
* Get all email campaigns
* Get all email campaigns
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse emailCampaignsGetWithHttpInfo(Integer page, Integer limit) throws ApiException {
com.squareup.okhttp.Call call = emailCampaignsGetValidateBeforeCall(page, limit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get all email campaigns (asynchronously)
* Get all email campaigns
* @param page Page number (optional, default to 1)
* @param limit Number of records per page (optional, default to 10)
* @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
*/
public com.squareup.okhttp.Call emailCampaignsGetAsync(Integer page, Integer limit, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = emailCampaignsGetValidateBeforeCall(page, limit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for sendVerificationTokenGet
* @param emailAddressId Allowed email address id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call sendVerificationTokenGetCall(Integer emailAddressId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email/address-verify/{email_address_id}/send"
.replaceAll("\\{" + "email_address_id" + "\\}", apiClient.escapeString(emailAddressId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call sendVerificationTokenGetValidateBeforeCall(Integer emailAddressId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailAddressId' is set
if (emailAddressId == null) {
throw new ApiException("Missing the required parameter 'emailAddressId' when calling sendVerificationTokenGet(Async)");
}
com.squareup.okhttp.Call call = sendVerificationTokenGetCall(emailAddressId, progressListener, progressRequestListener);
return call;
}
/**
* Send verification token
* Send verification token
* @param emailAddressId Allowed email address id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String sendVerificationTokenGet(Integer emailAddressId) throws ApiException {
ApiResponse resp = sendVerificationTokenGetWithHttpInfo(emailAddressId);
return resp.getData();
}
/**
* Send verification token
* Send verification token
* @param emailAddressId Allowed email address id (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse sendVerificationTokenGetWithHttpInfo(Integer emailAddressId) throws ApiException {
com.squareup.okhttp.Call call = sendVerificationTokenGetValidateBeforeCall(emailAddressId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Send verification token (asynchronously)
* Send verification token
* @param emailAddressId Allowed email address 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
*/
public com.squareup.okhttp.Call sendVerificationTokenGetAsync(Integer emailAddressId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = sendVerificationTokenGetValidateBeforeCall(emailAddressId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for specificAllowedEmailAddressDelete
* @param emailAddressId Allowed email address id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call specificAllowedEmailAddressDeleteCall(Integer emailAddressId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email/addresses/{email_address_id}"
.replaceAll("\\{" + "email_address_id" + "\\}", apiClient.escapeString(emailAddressId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call specificAllowedEmailAddressDeleteValidateBeforeCall(Integer emailAddressId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailAddressId' is set
if (emailAddressId == null) {
throw new ApiException("Missing the required parameter 'emailAddressId' when calling specificAllowedEmailAddressDelete(Async)");
}
com.squareup.okhttp.Call call = specificAllowedEmailAddressDeleteCall(emailAddressId, progressListener, progressRequestListener);
return call;
}
/**
* Delete specific email address
* Delete specific email address
* @param emailAddressId Allowed email address id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String specificAllowedEmailAddressDelete(Integer emailAddressId) throws ApiException {
ApiResponse resp = specificAllowedEmailAddressDeleteWithHttpInfo(emailAddressId);
return resp.getData();
}
/**
* Delete specific email address
* Delete specific email address
* @param emailAddressId Allowed email address id (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse specificAllowedEmailAddressDeleteWithHttpInfo(Integer emailAddressId) throws ApiException {
com.squareup.okhttp.Call call = specificAllowedEmailAddressDeleteValidateBeforeCall(emailAddressId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Delete specific email address (asynchronously)
* Delete specific email address
* @param emailAddressId Allowed email address 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
*/
public com.squareup.okhttp.Call specificAllowedEmailAddressDeleteAsync(Integer emailAddressId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = specificAllowedEmailAddressDeleteValidateBeforeCall(emailAddressId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for specificAllowedEmailAddressGet
* @param emailAddressId Allowed email address id (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call specificAllowedEmailAddressGetCall(Integer emailAddressId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email/addresses/{email_address_id}"
.replaceAll("\\{" + "email_address_id" + "\\}", apiClient.escapeString(emailAddressId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call specificAllowedEmailAddressGetValidateBeforeCall(Integer emailAddressId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailAddressId' is set
if (emailAddressId == null) {
throw new ApiException("Missing the required parameter 'emailAddressId' when calling specificAllowedEmailAddressGet(Async)");
}
com.squareup.okhttp.Call call = specificAllowedEmailAddressGetCall(emailAddressId, progressListener, progressRequestListener);
return call;
}
/**
* Get specific email address
* Get specific email address
* @param emailAddressId Allowed email address id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String specificAllowedEmailAddressGet(Integer emailAddressId) throws ApiException {
ApiResponse resp = specificAllowedEmailAddressGetWithHttpInfo(emailAddressId);
return resp.getData();
}
/**
* Get specific email address
* Get specific email address
* @param emailAddressId Allowed email address id (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse specificAllowedEmailAddressGetWithHttpInfo(Integer emailAddressId) throws ApiException {
com.squareup.okhttp.Call call = specificAllowedEmailAddressGetValidateBeforeCall(emailAddressId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get specific email address (asynchronously)
* Get specific email address
* @param emailAddressId Allowed email address 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
*/
public com.squareup.okhttp.Call specificAllowedEmailAddressGetAsync(Integer emailAddressId, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = specificAllowedEmailAddressGetValidateBeforeCall(emailAddressId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for verifyAllowedEmailAddressGet
* @param emailAddressId Allowed email address id (required)
* @param activationToken Your activation token. (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call verifyAllowedEmailAddressGetCall(Integer emailAddressId, String activationToken, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/email/address-verify/{email_address_id}/verify/{activation_token}"
.replaceAll("\\{" + "email_address_id" + "\\}", apiClient.escapeString(emailAddressId.toString()))
.replaceAll("\\{" + "activation_token" + "\\}", apiClient.escapeString(activationToken.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { "BasicAuth" };
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call verifyAllowedEmailAddressGetValidateBeforeCall(Integer emailAddressId, String activationToken, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailAddressId' is set
if (emailAddressId == null) {
throw new ApiException("Missing the required parameter 'emailAddressId' when calling verifyAllowedEmailAddressGet(Async)");
}
// verify the required parameter 'activationToken' is set
if (activationToken == null) {
throw new ApiException("Missing the required parameter 'activationToken' when calling verifyAllowedEmailAddressGet(Async)");
}
com.squareup.okhttp.Call call = verifyAllowedEmailAddressGetCall(emailAddressId, activationToken, progressListener, progressRequestListener);
return call;
}
/**
* Verify email address using verification token
* Verify email address using verification token
* @param emailAddressId Allowed email address id (required)
* @param activationToken Your activation token. (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String verifyAllowedEmailAddressGet(Integer emailAddressId, String activationToken) throws ApiException {
ApiResponse resp = verifyAllowedEmailAddressGetWithHttpInfo(emailAddressId, activationToken);
return resp.getData();
}
/**
* Verify email address using verification token
* Verify email address using verification token
* @param emailAddressId Allowed email address id (required)
* @param activationToken Your activation token. (required)
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse verifyAllowedEmailAddressGetWithHttpInfo(Integer emailAddressId, String activationToken) throws ApiException {
com.squareup.okhttp.Call call = verifyAllowedEmailAddressGetValidateBeforeCall(emailAddressId, activationToken, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Verify email address using verification token (asynchronously)
* Verify email address using verification token
* @param emailAddressId Allowed email address id (required)
* @param activationToken Your activation token. (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
*/
public com.squareup.okhttp.Call verifyAllowedEmailAddressGetAsync(Integer emailAddressId, String activationToken, final ApiCallback callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = verifyAllowedEmailAddressGetValidateBeforeCall(emailAddressId, activationToken, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}