ClickSend.Api.EmailToSmsApi 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.EmailSMSAddress;
import ClickSend.Model.StrippedString;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class EmailToSmsApi {
private ApiClient apiClient;
public EmailToSmsApi() {
this(Configuration.getDefaultApiClient());
}
public EmailToSmsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for smsEmailSmsGet
* @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 smsEmailSmsGetCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/email-sms";
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 smsEmailSmsGetValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsGetCall(page, limit, progressListener, progressRequestListener);
return call;
}
/**
* Get list of email to sms allowed addresses
* Get list of email to sms allowed 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 smsEmailSmsGet(Integer page, Integer limit) throws ApiException {
ApiResponse resp = smsEmailSmsGetWithHttpInfo(page, limit);
return resp.getData();
}
/**
* Get list of email to sms allowed addresses
* Get list of email to sms allowed 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 smsEmailSmsGetWithHttpInfo(Integer page, Integer limit) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsGetValidateBeforeCall(page, limit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get list of email to sms allowed addresses (asynchronously)
* Get list of email to sms allowed 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 smsEmailSmsGetAsync(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 = smsEmailSmsGetValidateBeforeCall(page, limit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for smsEmailSmsPost
* @param emailSmsAddress EmailSMSAddress 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 smsEmailSmsPostCall(EmailSMSAddress emailSmsAddress, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = emailSmsAddress;
// create path and map variables
String localVarPath = "/sms/email-sms";
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 smsEmailSmsPostValidateBeforeCall(EmailSMSAddress emailSmsAddress, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'emailSmsAddress' is set
if (emailSmsAddress == null) {
throw new ApiException("Missing the required parameter 'emailSmsAddress' when calling smsEmailSmsPost(Async)");
}
com.squareup.okhttp.Call call = smsEmailSmsPostCall(emailSmsAddress, progressListener, progressRequestListener);
return call;
}
/**
* Create email to sms allowed address
* Create email to sms allowed address
* @param emailSmsAddress EmailSMSAddress model (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String smsEmailSmsPost(EmailSMSAddress emailSmsAddress) throws ApiException {
ApiResponse resp = smsEmailSmsPostWithHttpInfo(emailSmsAddress);
return resp.getData();
}
/**
* Create email to sms allowed address
* Create email to sms allowed address
* @param emailSmsAddress EmailSMSAddress 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 smsEmailSmsPostWithHttpInfo(EmailSMSAddress emailSmsAddress) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsPostValidateBeforeCall(emailSmsAddress, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create email to sms allowed address (asynchronously)
* Create email to sms allowed address
* @param emailSmsAddress EmailSMSAddress 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 smsEmailSmsPostAsync(EmailSMSAddress emailSmsAddress, 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 = smsEmailSmsPostValidateBeforeCall(emailSmsAddress, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for smsEmailSmsStrippedStringDelete
* @param ruleId Your rule 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 smsEmailSmsStrippedStringDeleteCall(Integer ruleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/email-sms-stripped-strings/{rule_id}"
.replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.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 smsEmailSmsStrippedStringDeleteValidateBeforeCall(Integer ruleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'ruleId' is set
if (ruleId == null) {
throw new ApiException("Missing the required parameter 'ruleId' when calling smsEmailSmsStrippedStringDelete(Async)");
}
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringDeleteCall(ruleId, progressListener, progressRequestListener);
return call;
}
/**
* Delete email to sms stripped string rule
* Delete email to sms stripped string rule
* @param ruleId Your rule id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String smsEmailSmsStrippedStringDelete(Integer ruleId) throws ApiException {
ApiResponse resp = smsEmailSmsStrippedStringDeleteWithHttpInfo(ruleId);
return resp.getData();
}
/**
* Delete email to sms stripped string rule
* Delete email to sms stripped string rule
* @param ruleId Your rule 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 smsEmailSmsStrippedStringDeleteWithHttpInfo(Integer ruleId) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringDeleteValidateBeforeCall(ruleId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Delete email to sms stripped string rule (asynchronously)
* Delete email to sms stripped string rule
* @param ruleId Your rule 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 smsEmailSmsStrippedStringDeleteAsync(Integer ruleId, 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 = smsEmailSmsStrippedStringDeleteValidateBeforeCall(ruleId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for smsEmailSmsStrippedStringGet
* @param ruleId Your rule 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 smsEmailSmsStrippedStringGetCall(Integer ruleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/email-sms-stripped-strings/{rule_id}"
.replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.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 smsEmailSmsStrippedStringGetValidateBeforeCall(Integer ruleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'ruleId' is set
if (ruleId == null) {
throw new ApiException("Missing the required parameter 'ruleId' when calling smsEmailSmsStrippedStringGet(Async)");
}
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringGetCall(ruleId, progressListener, progressRequestListener);
return call;
}
/**
* Get email to sms stripped string rule
* Get email to sms stripped string rule
* @param ruleId Your rule id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String smsEmailSmsStrippedStringGet(Integer ruleId) throws ApiException {
ApiResponse resp = smsEmailSmsStrippedStringGetWithHttpInfo(ruleId);
return resp.getData();
}
/**
* Get email to sms stripped string rule
* Get email to sms stripped string rule
* @param ruleId Your rule 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 smsEmailSmsStrippedStringGetWithHttpInfo(Integer ruleId) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringGetValidateBeforeCall(ruleId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get email to sms stripped string rule (asynchronously)
* Get email to sms stripped string rule
* @param ruleId Your rule 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 smsEmailSmsStrippedStringGetAsync(Integer ruleId, 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 = smsEmailSmsStrippedStringGetValidateBeforeCall(ruleId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for smsEmailSmsStrippedStringPost
* @param strippedString StrippedString 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 smsEmailSmsStrippedStringPostCall(StrippedString strippedString, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = strippedString;
// create path and map variables
String localVarPath = "/sms/email-sms-stripped-strings";
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 smsEmailSmsStrippedStringPostValidateBeforeCall(StrippedString strippedString, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'strippedString' is set
if (strippedString == null) {
throw new ApiException("Missing the required parameter 'strippedString' when calling smsEmailSmsStrippedStringPost(Async)");
}
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringPostCall(strippedString, progressListener, progressRequestListener);
return call;
}
/**
* Create email to sms stripped string rule
* Create email to sms stripped string rules
* @param strippedString StrippedString model (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String smsEmailSmsStrippedStringPost(StrippedString strippedString) throws ApiException {
ApiResponse resp = smsEmailSmsStrippedStringPostWithHttpInfo(strippedString);
return resp.getData();
}
/**
* Create email to sms stripped string rule
* Create email to sms stripped string rules
* @param strippedString StrippedString 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 smsEmailSmsStrippedStringPostWithHttpInfo(StrippedString strippedString) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringPostValidateBeforeCall(strippedString, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Create email to sms stripped string rule (asynchronously)
* Create email to sms stripped string rules
* @param strippedString StrippedString 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 smsEmailSmsStrippedStringPostAsync(StrippedString strippedString, 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 = smsEmailSmsStrippedStringPostValidateBeforeCall(strippedString, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for smsEmailSmsStrippedStringPut
* @param strippedString StrippedString model (required)
* @param ruleId Your rule 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 smsEmailSmsStrippedStringPutCall(StrippedString strippedString, Integer ruleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = strippedString;
// create path and map variables
String localVarPath = "/sms/email-sms-stripped-strings/{rule_id}"
.replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.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 smsEmailSmsStrippedStringPutValidateBeforeCall(StrippedString strippedString, Integer ruleId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'strippedString' is set
if (strippedString == null) {
throw new ApiException("Missing the required parameter 'strippedString' when calling smsEmailSmsStrippedStringPut(Async)");
}
// verify the required parameter 'ruleId' is set
if (ruleId == null) {
throw new ApiException("Missing the required parameter 'ruleId' when calling smsEmailSmsStrippedStringPut(Async)");
}
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringPutCall(strippedString, ruleId, progressListener, progressRequestListener);
return call;
}
/**
* Update email to sms stripped string rule
* Update email to sms stripped string rule
* @param strippedString StrippedString model (required)
* @param ruleId Your rule id (required)
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public String smsEmailSmsStrippedStringPut(StrippedString strippedString, Integer ruleId) throws ApiException {
ApiResponse resp = smsEmailSmsStrippedStringPutWithHttpInfo(strippedString, ruleId);
return resp.getData();
}
/**
* Update email to sms stripped string rule
* Update email to sms stripped string rule
* @param strippedString StrippedString model (required)
* @param ruleId Your rule 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 smsEmailSmsStrippedStringPutWithHttpInfo(StrippedString strippedString, Integer ruleId) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringPutValidateBeforeCall(strippedString, ruleId, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Update email to sms stripped string rule (asynchronously)
* Update email to sms stripped string rule
* @param strippedString StrippedString model (required)
* @param ruleId Your rule 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 smsEmailSmsStrippedStringPutAsync(StrippedString strippedString, Integer ruleId, 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 = smsEmailSmsStrippedStringPutValidateBeforeCall(strippedString, ruleId, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for smsEmailSmsStrippedStringsGet
* @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 smsEmailSmsStrippedStringsGetCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/sms/email-sms-stripped-strings";
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 smsEmailSmsStrippedStringsGetValidateBeforeCall(Integer page, Integer limit, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringsGetCall(page, limit, progressListener, progressRequestListener);
return call;
}
/**
* Get list of email to sms stripped string rules
* Get list of email to sms stripped string rules
* @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 smsEmailSmsStrippedStringsGet(Integer page, Integer limit) throws ApiException {
ApiResponse resp = smsEmailSmsStrippedStringsGetWithHttpInfo(page, limit);
return resp.getData();
}
/**
* Get list of email to sms stripped string rules
* Get list of email to sms stripped string rules
* @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 smsEmailSmsStrippedStringsGetWithHttpInfo(Integer page, Integer limit) throws ApiException {
com.squareup.okhttp.Call call = smsEmailSmsStrippedStringsGetValidateBeforeCall(page, limit, null, null);
Type localVarReturnType = new TypeToken(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* Get list of email to sms stripped string rules (asynchronously)
* Get list of email to sms stripped string rules
* @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 smsEmailSmsStrippedStringsGetAsync(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 = smsEmailSmsStrippedStringsGetValidateBeforeCall(page, limit, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}